From 14b1cb8d5a27ec9716d3f790fce95f0469e35605 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 7 Mar 2010 13:28:57 +0000 Subject: Updated to Mesa 7.7 --- mesalib/src/SConscript | 11 - mesalib/src/glu/sgi/libtess/mesh.c | 7 +- mesalib/src/glu/sgi/libutil/mipmap.c | 10 + mesalib/src/mesa/Makefile | 6 +- mesalib/src/mesa/SConscript | 356 - mesalib/src/mesa/depend | 0 mesalib/src/mesa/drivers/common/driverfuncs.c | 37 +- mesalib/src/mesa/drivers/common/meta.c | 1516 ++- mesalib/src/mesa/drivers/common/meta.h | 109 +- mesalib/src/mesa/drivers/dri/Makefile.template | 28 +- mesalib/src/mesa/drivers/dri/common/dri_util.c | 11 +- .../src/mesa/drivers/dri/common/drirenderbuffer.c | 72 +- .../src/mesa/drivers/dri/common/drirenderbuffer.h | 5 +- .../src/mesa/drivers/dri/common/extension_helper.h | 6609 ---------- mesalib/src/mesa/drivers/dri/common/spantmp2.h | 211 + mesalib/src/mesa/drivers/dri/common/texmem.c | 64 +- mesalib/src/mesa/drivers/dri/common/texmem.h | 21 +- mesalib/src/mesa/drivers/dri/common/utils.c | 94 +- mesalib/src/mesa/drivers/dri/common/utils.h | 32 +- .../mesa/drivers/dri/common/xmlpool/gen_xmlpool.py | 191 - mesalib/src/mesa/drivers/dri/swrast/Makefile | 1 - mesalib/src/mesa/drivers/dri/swrast/swrast.c | 96 +- mesalib/src/mesa/drivers/dri/swrast/swrast_span.c | 72 +- mesalib/src/mesa/drivers/windows/fx/fx.rc | 39 - .../mesa/drivers/windows/gdi/InitCritSections.cpp | 32 - mesalib/src/mesa/drivers/windows/gdi/mesa.def | 19 +- mesalib/src/mesa/drivers/windows/gdi/wmesa.c | 5 + .../drivers/windows/gldirect/dx7/gld_driver_dx7.c | 1196 -- .../mesa/drivers/windows/gldirect/dx7/gld_dx7.h | 292 - .../mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h | 77 - .../drivers/windows/gldirect/dx7/gld_ext_dx7.c | 346 - .../windows/gldirect/dx7/gld_pipeline_dx7.c | 77 - .../windows/gldirect/dx7/gld_primitive_dx7.c | 1448 --- .../drivers/windows/gldirect/dx7/gld_texture_dx7.c | 2196 ---- .../windows/gldirect/dx7/gld_vb_d3d_render_dx7.c | 257 - .../windows/gldirect/dx7/gld_vb_mesa_render_dx7.c | 422 - .../drivers/windows/gldirect/dx7/gld_wgl_dx7.c | 1613 --- .../drivers/windows/gldirect/dx8/gld_driver_dx8.c | 1176 -- .../mesa/drivers/windows/gldirect/dx8/gld_dx8.h | 324 - .../mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h | 77 - .../drivers/windows/gldirect/dx8/gld_ext_dx8.c | 344 - .../windows/gldirect/dx8/gld_pipeline_dx8.c | 77 - .../windows/gldirect/dx8/gld_primitive_dx8.c | 1446 --- .../drivers/windows/gldirect/dx8/gld_texture_dx8.c | 2046 --- .../windows/gldirect/dx8/gld_vb_d3d_render_dx8.c | 249 - .../windows/gldirect/dx8/gld_vb_mesa_render_dx8.c | 448 - .../drivers/windows/gldirect/dx8/gld_wgl_dx8.c | 1336 -- .../drivers/windows/gldirect/dx9/gld_driver_dx9.c | 1206 -- .../mesa/drivers/windows/gldirect/dx9/gld_dx9.h | 327 - .../mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h | 77 - .../drivers/windows/gldirect/dx9/gld_ext_dx9.c | 344 - .../windows/gldirect/dx9/gld_pipeline_dx9.c | 77 - .../windows/gldirect/dx9/gld_primitive_dx9.c | 1446 --- .../drivers/windows/gldirect/dx9/gld_texture_dx9.c | 2104 ---- .../windows/gldirect/dx9/gld_vb_d3d_render_dx9.c | 263 - .../windows/gldirect/dx9/gld_vb_mesa_render_dx9.c | 443 - .../drivers/windows/gldirect/dx9/gld_wgl_dx9.c | 1346 -- .../src/mesa/drivers/windows/gldirect/gldirect.rc | 43 - .../mesa/drivers/windows/gldirect/mesasw/colors.h | 520 - .../windows/gldirect/mesasw/gld_wgl_mesasw.c | 1720 --- .../src/mesa/drivers/windows/gldirect/opengl32.ref | 495 - mesalib/src/mesa/drivers/windows/icd/mesa.def | 18 +- .../src/mesa/glapi/APPLE_vertex_array_object.xml | 27 - mesalib/src/mesa/glapi/ARB_copy_buffer.xml | 24 - mesalib/src/mesa/glapi/ARB_framebuffer_object.xml | 269 - mesalib/src/mesa/glapi/ARB_map_buffer_range.xml | 34 - mesalib/src/mesa/glapi/ARB_seamless_cube_map.xml | 12 - mesalib/src/mesa/glapi/ARB_sync.xml | 82 - mesalib/src/mesa/glapi/ARB_vertex_array_object.xml | 34 - mesalib/src/mesa/glapi/EXT_framebuffer_object.xml | 195 - mesalib/src/mesa/glapi/EXT_provoking_vertex.xml | 22 - mesalib/src/mesa/glapi/EXT_texture_array.xml | 41 - mesalib/src/mesa/glapi/Makefile | 152 - mesalib/src/mesa/glapi/dispatch.h | 3964 +----- mesalib/src/mesa/glapi/extension_helper.py | 324 - mesalib/src/mesa/glapi/glX_API.xml | 220 - mesalib/src/mesa/glapi/glX_XML.py | 570 - mesalib/src/mesa/glapi/glX_doc.py | 280 - mesalib/src/mesa/glapi/glX_proto_common.py | 95 - mesalib/src/mesa/glapi/glX_proto_recv.py | 554 - mesalib/src/mesa/glapi/glX_proto_send.py | 1042 -- mesalib/src/mesa/glapi/glX_proto_size.py | 704 -- mesalib/src/mesa/glapi/glX_server_table.py | 411 - mesalib/src/mesa/glapi/gl_API.dtd | 140 - mesalib/src/mesa/glapi/gl_API.xml | 12514 ------------------- mesalib/src/mesa/glapi/gl_SPARC_asm.py | 275 - mesalib/src/mesa/glapi/gl_XML.py | 964 -- mesalib/src/mesa/glapi/gl_and_glX_API.xml | 7 - mesalib/src/mesa/glapi/gl_apitemp.py | 253 - mesalib/src/mesa/glapi/gl_enums.py | 243 - mesalib/src/mesa/glapi/gl_offsets.py | 103 - mesalib/src/mesa/glapi/gl_procs.py | 188 - mesalib/src/mesa/glapi/gl_table.py | 199 - mesalib/src/mesa/glapi/gl_x86-64_asm.py | 334 - mesalib/src/mesa/glapi/gl_x86_asm.py | 270 - mesalib/src/mesa/glapi/glapidispatch.h | 4007 ++++++ mesalib/src/mesa/glapi/glapioffsets.h | 450 +- mesalib/src/mesa/glapi/glapitable.h | 439 +- mesalib/src/mesa/glapi/glapitemp.h | 230 +- mesalib/src/mesa/glapi/glprocs.h | 1158 +- mesalib/src/mesa/glapi/license.py | 47 - mesalib/src/mesa/glapi/mesadef.py | 222 - mesalib/src/mesa/glapi/next_available_offset.sh | 39 - mesalib/src/mesa/glapi/typeexpr.py | 292 - mesalib/src/mesa/main/Makefile.ugl | 364 - mesalib/src/mesa/main/Makefile.win | 208 - mesalib/src/mesa/main/accum.c | 16 +- mesalib/src/mesa/main/accum.h | 39 +- mesalib/src/mesa/main/api_arrayelt.c | 19 +- mesalib/src/mesa/main/api_arrayelt.h | 47 +- mesalib/src/mesa/main/api_exec.c | 224 +- mesalib/src/mesa/main/api_loopback.c | 7 + mesalib/src/mesa/main/api_loopback.h | 16 +- mesalib/src/mesa/main/api_noop.c | 110 +- mesalib/src/mesa/main/api_noop.h | 16 +- mesalib/src/mesa/main/api_validate.c | 63 +- mesalib/src/mesa/main/api_validate.h | 4 +- mesalib/src/mesa/main/attrib.c | 24 + mesalib/src/mesa/main/attrib.h | 38 +- mesalib/src/mesa/main/blend.c | 6 +- mesalib/src/mesa/main/bufferobj.c | 111 +- mesalib/src/mesa/main/buffers.c | 55 +- mesalib/src/mesa/main/colormac.h | 20 +- mesalib/src/mesa/main/colortab.c | 57 +- mesalib/src/mesa/main/colortab.h | 71 +- mesalib/src/mesa/main/compiler.h | 10 +- mesalib/src/mesa/main/config.h | 2 +- mesalib/src/mesa/main/context.c | 82 +- mesalib/src/mesa/main/convolve.c | 56 +- mesalib/src/mesa/main/convolve.h | 118 +- mesalib/src/mesa/main/dd.h | 63 +- mesalib/src/mesa/main/debug.c | 243 +- mesalib/src/mesa/main/debug.h | 11 +- mesalib/src/mesa/main/depth.c | 4 +- mesalib/src/mesa/main/depthstencil.c | 344 +- mesalib/src/mesa/main/dispatch.c | 2 +- mesalib/src/mesa/main/dlist.c | 677 +- mesalib/src/mesa/main/dlist.h | 84 +- mesalib/src/mesa/main/dlopen.c | 14 +- mesalib/src/mesa/main/drawpix.c | 26 +- mesalib/src/mesa/main/drawpix.h | 35 +- mesalib/src/mesa/main/enable.c | 39 +- mesalib/src/mesa/main/enums.c | 5282 ++++---- mesalib/src/mesa/main/eval.c | 61 +- mesalib/src/mesa/main/eval.h | 84 +- mesalib/src/mesa/main/execmem.c | 7 +- mesalib/src/mesa/main/extensions.c | 19 +- mesalib/src/mesa/main/fbobject.c | 480 +- mesalib/src/mesa/main/feedback.c | 39 +- mesalib/src/mesa/main/feedback.h | 62 +- mesalib/src/mesa/main/ffvertex_prog.c | 2 +- mesalib/src/mesa/main/fog.c | 11 +- mesalib/src/mesa/main/formats.c | 1158 ++ mesalib/src/mesa/main/formats.h | 185 + mesalib/src/mesa/main/framebuffer.c | 96 +- mesalib/src/mesa/main/framebuffer.h | 5 + mesalib/src/mesa/main/get.c | 33 +- mesalib/src/mesa/main/get_gen.py | 1252 -- mesalib/src/mesa/main/histogram.c | 45 +- mesalib/src/mesa/main/histogram.h | 48 +- mesalib/src/mesa/main/light.c | 22 +- mesalib/src/mesa/main/mfeatures.h | 48 +- mesalib/src/mesa/main/mipmap.c | 78 +- mesalib/src/mesa/main/mtypes.h | 191 +- mesalib/src/mesa/main/pixel.c | 40 +- mesalib/src/mesa/main/pixel.h | 47 +- mesalib/src/mesa/main/points.c | 18 +- mesalib/src/mesa/main/queryobj.c | 48 +- mesalib/src/mesa/main/queryobj.h | 59 +- mesalib/src/mesa/main/rastpos.c | 162 +- mesalib/src/mesa/main/rastpos.h | 163 +- mesalib/src/mesa/main/rbadaptors.c | 18 +- mesalib/src/mesa/main/remap.c | 216 + mesalib/src/mesa/main/remap.h | 87 + mesalib/src/mesa/main/remap_helper.h | 5891 +++++++++ mesalib/src/mesa/main/renderbuffer.c | 255 +- mesalib/src/mesa/main/shaders.c | 41 +- mesalib/src/mesa/main/shared.c | 4 - mesalib/src/mesa/main/sources | 158 - mesalib/src/mesa/main/state.c | 4 - mesalib/src/mesa/main/texcompress.c | 275 +- mesalib/src/mesa/main/texcompress.h | 34 +- mesalib/src/mesa/main/texcompress_fxt1.c | 122 +- mesalib/src/mesa/main/texcompress_fxt1.h | 59 + mesalib/src/mesa/main/texcompress_s3tc.c | 297 +- mesalib/src/mesa/main/texcompress_s3tc.h | 106 + mesalib/src/mesa/main/texenv.c | 5 +- mesalib/src/mesa/main/texenvprogram.c | 2 +- mesalib/src/mesa/main/texfetch.c | 693 + mesalib/src/mesa/main/texfetch.h | 40 + mesalib/src/mesa/main/texfetch_tmp.h | 1394 +++ mesalib/src/mesa/main/texformat.c | 1783 +-- mesalib/src/mesa/main/texformat.h | 264 +- mesalib/src/mesa/main/texformat_tmp.h | 1474 --- mesalib/src/mesa/main/texgen.c | 59 +- mesalib/src/mesa/main/texgen.h | 43 +- mesalib/src/mesa/main/texgetimage.c | 807 +- mesalib/src/mesa/main/teximage.c | 1137 +- mesalib/src/mesa/main/teximage.h | 3 + mesalib/src/mesa/main/texobj.c | 15 +- mesalib/src/mesa/main/texparam.c | 132 +- mesalib/src/mesa/main/texrender.c | 47 +- mesalib/src/mesa/main/texstate.c | 20 +- mesalib/src/mesa/main/texstore.c | 1402 +-- mesalib/src/mesa/main/texstore.h | 77 +- mesalib/src/mesa/main/varray.c | 102 +- mesalib/src/mesa/main/varray.h | 15 + mesalib/src/mesa/main/version.h | 8 +- mesalib/src/mesa/main/vtxfmt.c | 32 +- mesalib/src/mesa/main/vtxfmt.h | 28 +- mesalib/src/mesa/main/vtxfmt_tmp.h | 42 +- mesalib/src/mesa/math/m_clip_tmp.h | 44 +- mesalib/src/mesa/math/m_debug_clip.c | 31 +- mesalib/src/mesa/math/m_xform.h | 6 +- mesalib/src/mesa/ppc/common_ppc.c | 91 + mesalib/src/mesa/ppc/common_ppc_features.h | 54 + mesalib/src/mesa/shader/grammar/grammar.syn | 567 - mesalib/src/mesa/shader/lex.yy.c | 1822 +-- mesalib/src/mesa/shader/nvfragparse.c | 8 +- mesalib/src/mesa/shader/prog_instruction.h | 1 - mesalib/src/mesa/shader/prog_optimize.c | 256 +- mesalib/src/mesa/shader/prog_parameter.c | 2 +- mesalib/src/mesa/shader/prog_print.c | 13 +- mesalib/src/mesa/shader/program.c | 21 +- mesalib/src/mesa/shader/program_lexer.l | 187 +- mesalib/src/mesa/shader/program_parse.tab.c | 2578 ++-- mesalib/src/mesa/shader/program_parse.tab.h | 174 +- mesalib/src/mesa/shader/program_parse.y | 486 +- mesalib/src/mesa/shader/program_parse_extra.c | 126 + mesalib/src/mesa/shader/program_parser.h | 30 +- mesalib/src/mesa/shader/programopt.c | 109 +- mesalib/src/mesa/shader/programopt.h | 7 + mesalib/src/mesa/shader/shader_api.c | 63 +- mesalib/src/mesa/shader/slang/slang_codegen.c | 2 +- mesalib/src/mesa/shader/slang/slang_compile.c | 34 +- .../mesa/shader/slang/slang_compile_operation.c | 1 + .../mesa/shader/slang/slang_compile_operation.h | 1 - mesalib/src/mesa/shader/slang/slang_emit.c | 124 +- mesalib/src/mesa/shader/slang/slang_link.c | 25 +- mesalib/src/mesa/shader/slang/slang_simplify.c | 9 +- mesalib/src/mesa/shader/slang/slang_vartable.c | 4 +- mesalib/src/mesa/sources.mak | 6 +- mesalib/src/mesa/swrast/NOTES | 55 - mesalib/src/mesa/swrast/s_atifragshader.c | 2 +- mesalib/src/mesa/swrast/s_clear.c | 8 +- mesalib/src/mesa/swrast/s_depth.c | 50 +- mesalib/src/mesa/swrast/s_depth.h | 2 + mesalib/src/mesa/swrast/s_fragprog.c | 12 +- mesalib/src/mesa/swrast/s_imaging.c | 196 - mesalib/src/mesa/swrast/s_readpix.c | 34 +- mesalib/src/mesa/swrast/s_span.c | 11 +- mesalib/src/mesa/swrast/s_texfilter.c | 64 +- mesalib/src/mesa/swrast/s_texstore.c | 601 - mesalib/src/mesa/swrast/s_triangle.c | 199 +- mesalib/src/mesa/swrast/swrast.h | 54 - mesalib/src/mesa/swrast_setup/NOTES | 65 - mesalib/src/mesa/swrast_setup/ss_tritmp.h | 6 +- mesalib/src/mesa/tnl/NOTES | 102 - mesalib/src/mesa/tnl/t_context.c | 2 +- mesalib/src/mesa/tnl/t_context.h | 4 + mesalib/src/mesa/tnl/t_draw.c | 58 +- mesalib/src/mesa/tnl/t_rasterpos.c | 25 +- mesalib/src/mesa/tnl/t_vb_program.c | 16 +- mesalib/src/mesa/tnl/t_vb_vertex.c | 24 +- mesalib/src/mesa/vbo/vbo.h | 1 + mesalib/src/mesa/vbo/vbo_exec.h | 22 + mesalib/src/mesa/vbo/vbo_exec_api.c | 164 +- mesalib/src/mesa/vbo/vbo_exec_array.c | 203 +- mesalib/src/mesa/vbo/vbo_exec_draw.c | 6 + mesalib/src/mesa/vbo/vbo_exec_eval.c | 33 +- mesalib/src/mesa/vbo/vbo_rebase.c | 18 +- mesalib/src/mesa/vbo/vbo_save_api.c | 65 +- mesalib/src/mesa/vbo/vbo_split.c | 8 +- mesalib/src/mesa/vbo/vbo_split_copy.c | 52 +- 274 files changed, 29436 insertions(+), 76829 deletions(-) delete mode 100644 mesalib/src/SConscript delete mode 100644 mesalib/src/mesa/SConscript create mode 100644 mesalib/src/mesa/depend delete mode 100644 mesalib/src/mesa/drivers/dri/common/extension_helper.h delete mode 100644 mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py delete mode 100644 mesalib/src/mesa/drivers/windows/fx/fx.rc delete mode 100644 mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c delete mode 100644 mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref delete mode 100644 mesalib/src/mesa/glapi/APPLE_vertex_array_object.xml delete mode 100644 mesalib/src/mesa/glapi/ARB_copy_buffer.xml delete mode 100644 mesalib/src/mesa/glapi/ARB_framebuffer_object.xml delete mode 100644 mesalib/src/mesa/glapi/ARB_map_buffer_range.xml delete mode 100644 mesalib/src/mesa/glapi/ARB_seamless_cube_map.xml delete mode 100644 mesalib/src/mesa/glapi/ARB_sync.xml delete mode 100644 mesalib/src/mesa/glapi/ARB_vertex_array_object.xml delete mode 100644 mesalib/src/mesa/glapi/EXT_framebuffer_object.xml delete mode 100644 mesalib/src/mesa/glapi/EXT_provoking_vertex.xml delete mode 100644 mesalib/src/mesa/glapi/EXT_texture_array.xml delete mode 100644 mesalib/src/mesa/glapi/Makefile delete mode 100644 mesalib/src/mesa/glapi/extension_helper.py delete mode 100644 mesalib/src/mesa/glapi/glX_API.xml delete mode 100644 mesalib/src/mesa/glapi/glX_XML.py delete mode 100644 mesalib/src/mesa/glapi/glX_doc.py delete mode 100644 mesalib/src/mesa/glapi/glX_proto_common.py delete mode 100644 mesalib/src/mesa/glapi/glX_proto_recv.py delete mode 100644 mesalib/src/mesa/glapi/glX_proto_send.py delete mode 100644 mesalib/src/mesa/glapi/glX_proto_size.py delete mode 100644 mesalib/src/mesa/glapi/glX_server_table.py delete mode 100644 mesalib/src/mesa/glapi/gl_API.dtd delete mode 100644 mesalib/src/mesa/glapi/gl_API.xml delete mode 100644 mesalib/src/mesa/glapi/gl_SPARC_asm.py delete mode 100644 mesalib/src/mesa/glapi/gl_XML.py delete mode 100644 mesalib/src/mesa/glapi/gl_and_glX_API.xml delete mode 100644 mesalib/src/mesa/glapi/gl_apitemp.py delete mode 100644 mesalib/src/mesa/glapi/gl_enums.py delete mode 100644 mesalib/src/mesa/glapi/gl_offsets.py delete mode 100644 mesalib/src/mesa/glapi/gl_procs.py delete mode 100644 mesalib/src/mesa/glapi/gl_table.py delete mode 100644 mesalib/src/mesa/glapi/gl_x86-64_asm.py delete mode 100644 mesalib/src/mesa/glapi/gl_x86_asm.py create mode 100644 mesalib/src/mesa/glapi/glapidispatch.h delete mode 100644 mesalib/src/mesa/glapi/license.py delete mode 100644 mesalib/src/mesa/glapi/mesadef.py delete mode 100644 mesalib/src/mesa/glapi/next_available_offset.sh delete mode 100644 mesalib/src/mesa/glapi/typeexpr.py delete mode 100644 mesalib/src/mesa/main/Makefile.ugl delete mode 100644 mesalib/src/mesa/main/Makefile.win create mode 100644 mesalib/src/mesa/main/formats.c create mode 100644 mesalib/src/mesa/main/formats.h delete mode 100644 mesalib/src/mesa/main/get_gen.py create mode 100644 mesalib/src/mesa/main/remap.c create mode 100644 mesalib/src/mesa/main/remap.h create mode 100644 mesalib/src/mesa/main/remap_helper.h delete mode 100644 mesalib/src/mesa/main/sources create mode 100644 mesalib/src/mesa/main/texcompress_fxt1.h create mode 100644 mesalib/src/mesa/main/texcompress_s3tc.h create mode 100644 mesalib/src/mesa/main/texfetch.c create mode 100644 mesalib/src/mesa/main/texfetch.h create mode 100644 mesalib/src/mesa/main/texfetch_tmp.h delete mode 100644 mesalib/src/mesa/main/texformat_tmp.h create mode 100644 mesalib/src/mesa/ppc/common_ppc.c create mode 100644 mesalib/src/mesa/ppc/common_ppc_features.h delete mode 100644 mesalib/src/mesa/shader/grammar/grammar.syn delete mode 100644 mesalib/src/mesa/swrast/NOTES delete mode 100644 mesalib/src/mesa/swrast/s_imaging.c delete mode 100644 mesalib/src/mesa/swrast/s_texstore.c delete mode 100644 mesalib/src/mesa/swrast_setup/NOTES delete mode 100644 mesalib/src/mesa/tnl/NOTES (limited to 'mesalib/src') diff --git a/mesalib/src/SConscript b/mesalib/src/SConscript deleted file mode 100644 index 5440acd13..000000000 --- a/mesalib/src/SConscript +++ /dev/null @@ -1,11 +0,0 @@ -Import('*') - -SConscript('gallium/SConscript') - -if 'mesa' in env['statetrackers']: - SConscript('mesa/SConscript') - -SConscript('gallium/winsys/SConscript') - -SConscript('glut/glx/SConscript') -SConscript('glew/SConscript') diff --git a/mesalib/src/glu/sgi/libtess/mesh.c b/mesalib/src/glu/sgi/libtess/mesh.c index ae861f864..95f87cdc9 100644 --- a/mesalib/src/glu/sgi/libtess/mesh.c +++ b/mesalib/src/glu/sgi/libtess/mesh.c @@ -284,7 +284,12 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) } e = MakeEdge( &mesh->eHead ); - if (e == NULL) return NULL; + if (e == NULL) { + memFree(newVertex1); + memFree(newVertex2); + memFree(newFace); + return NULL; + } MakeVertex( newVertex1, e, &mesh->vHead ); MakeVertex( newVertex2, e->Sym, &mesh->vHead ); diff --git a/mesalib/src/glu/sgi/libutil/mipmap.c b/mesalib/src/glu/sgi/libutil/mipmap.c index af647af73..d1fd5a7d7 100644 --- a/mesalib/src/glu/sgi/libutil/mipmap.c +++ b/mesalib/src/glu/sgi/libutil/mipmap.c @@ -3526,6 +3526,8 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, afterImage = malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { + free(beforeImage); + free(afterImage); return GLU_OUT_OF_MEMORY; } @@ -3606,6 +3608,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, 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; } } @@ -3760,6 +3763,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, 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; } } @@ -4104,6 +4108,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, 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 */ @@ -4346,6 +4351,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, 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; } } @@ -7382,6 +7388,8 @@ int gluScaleImage3D(GLenum format, 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); @@ -8093,6 +8101,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, 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 */ @@ -8227,6 +8236,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, 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; } } diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile index 8300b3014..6f58ad616 100644 --- a/mesalib/src/mesa/Makefile +++ b/mesalib/src/mesa/Makefile @@ -39,11 +39,7 @@ libmesagallium.a: $(MESA_GALLIUM_OBJECTS) # Make archive of gl* API dispatcher functions only libglapi.a: $(GLAPI_OBJECTS) - @if [ "${WINDOW_SYSTEM}" = "dri" ] ; then \ - touch libglapi.a ; \ - else \ - $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) ; \ - fi + $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) ###################################################################### # Device drivers diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript deleted file mode 100644 index cad567632..000000000 --- a/mesalib/src/mesa/SConscript +++ /dev/null @@ -1,356 +0,0 @@ -####################################################################### -# SConscript for Mesa - - -Import('*') - -if env['platform'] != 'winddk': - - env = env.Clone() - - env.Append(CPPPATH = [ - '#/src/mesa', - ]) - - 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 - 'WIN32_THREADS', # use Win32 thread API - ]) - - # - # 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/attrib.c', - 'main/arrayobj.c', - 'main/blend.c', - 'main/bufferobj.c', - 'main/buffers.c', - 'main/clear.c', - 'main/clip.c', - 'main/colortab.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/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/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/pixel.c', - 'main/pixelstore.c', - 'main/points.c', - 'main/polygon.c', - 'main/queryobj.c', - 'main/rastpos.c', - 'main/rbadaptors.c', - 'main/readpix.c', - 'main/renderbuffer.c', - 'main/scissor.c', - 'main/shaders.c', - 'main/shared.c', - 'main/state.c', - 'main/stencil.c', - 'main/syncobj.c', - 'main/texcompress.c', - 'main/texcompress_s3tc.c', - 'main/texcompress_fxt1.c', - 'main/texenv.c', - 'main/texenvprogram.c', - 'main/texformat.c', - 'main/texgen.c', - 'main/texgetimage.c', - 'main/teximage.c', - 'main/texobj.c', - 'main/texparam.c', - 'main/texrender.c', - 'main/texstate.c', - 'main/texstore.c', - 'main/varray.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', - ] - - 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', - ] - - vf_sources = [ - 'vf/vf.c', - 'vf/vf_generic.c', - 'vf/vf_sse.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_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_flush.c', - 'state_tracker/st_cb_drawpixels.c', - 'state_tracker/st_cb_fbo.c', - 'state_tracker/st_cb_get.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_strings.c', - 'state_tracker/st_cb_texture.c', - 'state_tracker/st_cb_viewport.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_framebuffer.c', - 'state_tracker/st_gen_mipmap.c', - 'state_tracker/st_mesa_to_tgsi.c', - 'state_tracker/st_program.c', - 'state_tracker/st_texture.c', - ] - - shader_sources = [ - 'shader/arbprogparse.c', - 'shader/arbprogram.c', - 'shader/atifragshader.c', - 'shader/grammar/grammar_mesa.c', - 'shader/hash_table.c', - 'shader/lex.yy.c', - 'shader/nvfragparse.c', - 'shader/nvprogram.c', - 'shader/nvvertparse.c', - 'shader/program.c', - 'shader/program_parse.tab.c', - 'shader/program_parse_extra.c', - 'shader/prog_cache.c', - 'shader/prog_execute.c', - 'shader/prog_instruction.c', - 'shader/prog_noise.c', - 'shader/prog_optimize.c', - 'shader/prog_parameter.c', - 'shader/prog_parameter_layout.c', - 'shader/prog_print.c', - 'shader/prog_statevars.c', - 'shader/prog_uniform.c', - 'shader/programopt.c', - 'shader/symbol_table.c', - 'shader/shader_api.c', - ] - - slang_sources = [ - 'shader/slang/slang_builtin.c', - 'shader/slang/slang_codegen.c', - 'shader/slang/slang_compile.c', - 'shader/slang/slang_compile_function.c', - 'shader/slang/slang_compile_operation.c', - 'shader/slang/slang_compile_struct.c', - 'shader/slang/slang_compile_variable.c', - 'shader/slang/slang_emit.c', - 'shader/slang/slang_ir.c', - 'shader/slang/slang_label.c', - 'shader/slang/slang_link.c', - 'shader/slang/slang_log.c', - 'shader/slang/slang_mem.c', - 'shader/slang/slang_preprocess.c', - 'shader/slang/slang_print.c', - 'shader/slang/slang_simplify.c', - 'shader/slang/slang_storage.c', - 'shader/slang/slang_typeinfo.c', - 'shader/slang/slang_vartable.c', - 'shader/slang/slang_utility.c', - ] - - mesa_sources = ( - main_sources + - math_sources + - vbo_sources + - vf_sources + - statetracker_sources + - shader_sources + - slang_sources - ) - - glapi_sources = [ - 'main/dispatch.c', - 'glapi/glapi.c', - 'glapi/glapi_getproc.c', - 'glapi/glthread.c', - ] - - # - # Assembly sources - # - if gcc and 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', - ] - glapi_sources += [ - 'x86/glapi_x86.S', - ] - elif gcc and env['machine'] == 'x86_64': - env.Append(CPPDEFINES = [ - 'USE_X86_64_ASM', - ]) - mesa_sources += [ - 'x86-64/x86-64.c', - 'x86-64/xform4.S', - ] - glapi_sources += [ - 'x86-64/glapi_x86-64.S' - ] - elif gcc and env['machine'] == 'ppc': - env.Append(CPPDEFINES = [ - 'USE_PPC_ASM', - 'USE_VMX_ASM', - ]) - mesa_sources += [ - 'ppc/common_ppc.c', - ] - glapi_sources += [ - ] - elif gcc and env['machine'] == 'sparc': - mesa_sources += [ - 'sparc/sparc.c', - 'sparc/clip.S', - 'sparc/norm.S', - 'sparc/xform.S', - ] - glapi_sources += [ - 'sparc/glapi_sparc.S' - ] - else: - pass - - # Generate matypes.h - if gcc and 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]) - - # - # Libraries - # - - mesa = env.ConvenienceLibrary( - target = 'mesa', - source = mesa_sources, - ) - Export('mesa') - - if not dri: - glapi = env.ConvenienceLibrary( - target = 'glapi', - source = glapi_sources, - ) - Export('glapi') - diff --git a/mesalib/src/mesa/depend b/mesalib/src/mesa/depend new file mode 100644 index 000000000..e69de29bb diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c index a9f3c8e72..4ca0e7bcc 100644 --- a/mesalib/src/mesa/drivers/common/driverfuncs.c +++ b/mesalib/src/mesa/drivers/common/driverfuncs.c @@ -56,6 +56,7 @@ #include "swrast/swrast.h" #include "driverfuncs.h" +#include "meta.h" @@ -100,12 +101,12 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexSubImage2D = _mesa_store_texsubimage2d; driver->TexSubImage3D = _mesa_store_texsubimage3d; driver->GetTexImage = _mesa_get_teximage; - driver->CopyTexImage1D = _swrast_copy_teximage1d; - driver->CopyTexImage2D = _swrast_copy_teximage2d; - driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; - driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; - driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; - driver->GenerateMipmap = _mesa_generate_mipmap; + 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; @@ -114,7 +115,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; driver->GetCompressedTexImage = _mesa_get_compressed_teximage; - driver->CompressedTextureSize = _mesa_compressed_texture_size; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; @@ -124,15 +124,14 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UnmapTexture = NULL; driver->TextureMemCpy = _mesa_memcpy; driver->IsTextureResident = NULL; - driver->PrioritizeTexture = NULL; driver->ActiveTexture = NULL; driver->UpdateTexturePalette = NULL; /* imaging */ - driver->CopyColorTable = _swrast_CopyColorTable; - driver->CopyColorSubTable = _swrast_CopyColorSubTable; - driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + driver->CopyColorTable = _mesa_meta_CopyColorTable; + driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable; + driver->CopyConvolutionFilter1D = _mesa_meta_CopyConvolutionFilter1D; + driver->CopyConvolutionFilter2D = _mesa_meta_CopyConvolutionFilter2D; /* Vertex/fragment programs */ driver->BindProgram = NULL; @@ -182,22 +181,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; - driver->TextureMatrix = NULL; driver->Viewport = NULL; - /* vertex arrays */ - driver->VertexPointer = NULL; - driver->NormalPointer = NULL; - driver->ColorPointer = NULL; - driver->FogCoordPointer = NULL; - driver->IndexPointer = NULL; - driver->SecondaryColorPointer = NULL; - driver->TexCoordPointer = NULL; - driver->EdgeFlagPointer = NULL; - driver->VertexAttribPointer = NULL; - driver->LockArraysEXT = NULL; - driver->UnlockArraysEXT = NULL; - /* state queries */ driver->GetBooleanv = NULL; driver->GetDoublev = NULL; diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index b6c6ef70f..cd9075b39 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -37,18 +37,26 @@ #include "main/arrayobj.h" #include "main/blend.h" #include "main/bufferobj.h" +#include "main/buffers.h" +#include "main/colortab.h" +#include "main/convolve.h" #include "main/depth.h" #include "main/enable.h" +#include "main/fbobject.h" +#include "main/formats.h" #include "main/image.h" #include "main/macros.h" #include "main/matrix.h" +#include "main/mipmap.h" #include "main/polygon.h" #include "main/readpix.h" #include "main/scissor.h" #include "main/shaders.h" +#include "main/state.h" #include "main/stencil.h" #include "main/texobj.h" #include "main/texenv.h" +#include "main/texformat.h" #include "main/teximage.h" #include "main/texparam.h" #include "main/texstate.h" @@ -60,6 +68,33 @@ #include "drivers/common/meta.h" +/** Return offset in bytes of the field within a vertex struct */ +#define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD)) + + +/** + * Flags passed to _mesa_meta_begin(). + */ +/*@{*/ +#define META_ALL ~0x0 +#define META_ALPHA_TEST 0x1 +#define META_BLEND 0x2 /**< includes logicop */ +#define META_COLOR_MASK 0x4 +#define META_DEPTH_TEST 0x8 +#define META_FOG 0x10 +#define META_PIXEL_STORE 0x20 +#define META_PIXEL_TRANSFER 0x40 +#define META_RASTERIZATION 0x80 +#define META_SCISSOR 0x100 +#define META_SHADER 0x200 +#define META_STENCIL_TEST 0x400 +#define META_TRANSFORM 0x800 /**< modelview, projection, clip planes */ +#define META_TEXTURE 0x1000 +#define META_VERTEX 0x2000 +#define META_VIEWPORT 0x4000 +/*@}*/ + + /** * State which we may save/restore across meta ops. * XXX this may be incomplete... @@ -87,6 +122,17 @@ struct save_state /** META_PIXEL_STORE */ struct gl_pixelstore_attrib Pack, Unpack; + /** META_PIXEL_TRANSFER */ + GLfloat RedBias, RedScale; + GLfloat GreenBias, GreenScale; + GLfloat BlueBias, BlueScale; + GLfloat AlphaBias, AlphaScale; + GLfloat DepthBias, DepthScale; + GLboolean MapColorFlag; + GLboolean Convolution1DEnabled; + GLboolean Convolution2DEnabled; + GLboolean Separable2DEnabled; + /** META_RASTERIZATION */ GLenum FrontPolygonMode, BackPolygonMode; GLboolean PolygonOffset; @@ -137,6 +183,24 @@ struct save_state }; +/** + * Temporary texture used for glBlitFramebuffer, glDrawPixels, etc. + * This is currently shared by all the meta ops. But we could create a + * separate one for each of glDrawPixel, glBlitFramebuffer, glCopyPixels, etc. + */ +struct temp_texture +{ + GLuint TexObj; + GLenum Target; /**< GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE */ + GLsizei MinSize; /**< Min texture size to allocate */ + GLsizei MaxSize; /**< Max possible texture size */ + GLboolean NPOT; /**< Non-power of two size OK? */ + GLsizei Width, Height; /**< Current texture size */ + GLenum IntFormat; + GLfloat Sright, Ttop; /**< right, top texcoords */ +}; + + /** * State for glBlitFramebufer() */ @@ -181,19 +245,24 @@ struct drawpix_state /** - * Temporary texture used for glBlitFramebuffer, glDrawPixels, etc. - * This is currently shared by all the meta ops. But we could create a - * separate one for each of glDrawPixel, glBlitFramebuffer, glCopyPixels, etc. + * State for glBitmap() */ -struct temp_texture +struct bitmap_state { - GLuint TexObj; - GLenum Target; /**< GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE */ - GLsizei MaxSize; /**< Max possible texture size */ - GLboolean NPOT; /**< Non-power of two size OK? */ - GLsizei Width, Height; /**< Current texture size */ - GLenum IntFormat; - GLfloat Sright, Ttop; /**< right, top texcoords */ + GLuint ArrayObj; + GLuint VBO; + struct temp_texture Tex; /**< separate texture from other meta ops */ +}; + + +/** + * State for _mesa_meta_generate_mipmap() + */ +struct gen_mipmap_state +{ + GLuint ArrayObj; + GLuint VBO; + GLuint FBO; }; @@ -206,15 +275,12 @@ struct gl_meta_state struct temp_texture TempTex; - struct blit_state Blit; /**< For _mesa_meta_blit_framebuffer() */ - struct clear_state Clear; /**< For _mesa_meta_clear() */ - struct copypix_state CopyPix; /**< For _mesa_meta_copy_pixels() */ - struct drawpix_state DrawPix; /**< For _mesa_meta_draw_pixels() */ - - /* other possible meta-ops: - * glBitmap() - * glGenerateMipmap() - */ + struct blit_state Blit; /**< For _mesa_meta_BlitFramebuffer() */ + struct clear_state Clear; /**< For _mesa_meta_Clear() */ + struct copypix_state CopyPix; /**< For _mesa_meta_CopyPixels() */ + struct drawpix_state DrawPix; /**< For _mesa_meta_DrawPixels() */ + struct bitmap_state Bitmap; /**< For _mesa_meta_Bitmap() */ + struct gen_mipmap_state Mipmap; /**< For _mesa_meta_GenerateMipmap() */ }; @@ -264,16 +330,16 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_ALPHA_TEST) { save->AlphaEnabled = ctx->Color.AlphaEnabled; if (ctx->Color.AlphaEnabled) - _mesa_Disable(GL_ALPHA_TEST); + _mesa_set_enable(ctx, GL_ALPHA_TEST, GL_FALSE); } if (state & META_BLEND) { save->BlendEnabled = ctx->Color.BlendEnabled; if (ctx->Color.BlendEnabled) - _mesa_Disable(GL_BLEND); + _mesa_set_enable(ctx, GL_BLEND, GL_FALSE); save->ColorLogicOpEnabled = ctx->Color.ColorLogicOpEnabled; if (ctx->Color.ColorLogicOpEnabled) - _mesa_Disable(GL_COLOR_LOGIC_OP); + _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, GL_FALSE); } if (state & META_COLOR_MASK) { @@ -288,7 +354,7 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_DEPTH_TEST) { save->Depth = ctx->Depth; /* struct copy */ if (ctx->Depth.Test) - _mesa_Disable(GL_DEPTH_TEST); + _mesa_set_enable(ctx, GL_DEPTH_TEST, GL_FALSE); } if (state & META_FOG) { @@ -304,6 +370,35 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) ctx->Unpack = ctx->DefaultPacking; } + if (state & META_PIXEL_TRANSFER) { + save->RedScale = ctx->Pixel.RedScale; + save->RedBias = ctx->Pixel.RedBias; + save->GreenScale = ctx->Pixel.GreenScale; + save->GreenBias = ctx->Pixel.GreenBias; + save->BlueScale = ctx->Pixel.BlueScale; + save->BlueBias = ctx->Pixel.BlueBias; + save->AlphaScale = ctx->Pixel.AlphaScale; + save->AlphaBias = ctx->Pixel.AlphaBias; + save->MapColorFlag = ctx->Pixel.MapColorFlag; + save->Convolution1DEnabled = ctx->Pixel.Convolution1DEnabled; + save->Convolution2DEnabled = ctx->Pixel.Convolution2DEnabled; + save->Separable2DEnabled = ctx->Pixel.Separable2DEnabled; + 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; + ctx->Pixel.MapColorFlag = GL_FALSE; + ctx->Pixel.Convolution1DEnabled = GL_FALSE; + ctx->Pixel.Convolution2DEnabled = GL_FALSE; + ctx->Pixel.Separable2DEnabled = GL_FALSE; + /* XXX more state */ + ctx->NewState |=_NEW_PIXEL; + } + if (state & META_RASTERIZATION) { save->FrontPolygonMode = ctx->Polygon.FrontMode; save->BackPolygonMode = ctx->Polygon.BackMode; @@ -345,7 +440,7 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_STENCIL_TEST) { save->Stencil = ctx->Stencil; /* struct copy */ if (ctx->Stencil.Enabled) - _mesa_Disable(GL_STENCIL_TEST); + _mesa_set_enable(ctx, GL_STENCIL_TEST, GL_FALSE); /* NOTE: other stencil state not reset */ } @@ -499,6 +594,23 @@ _mesa_meta_end(GLcontext *ctx) ctx->Unpack = save->Unpack; } + if (state & META_PIXEL_TRANSFER) { + ctx->Pixel.RedScale = save->RedScale; + ctx->Pixel.RedBias = save->RedBias; + ctx->Pixel.GreenScale = save->GreenScale; + ctx->Pixel.GreenBias = save->GreenBias; + ctx->Pixel.BlueScale = save->BlueScale; + ctx->Pixel.BlueBias = save->BlueBias; + ctx->Pixel.AlphaScale = save->AlphaScale; + ctx->Pixel.AlphaBias = save->AlphaBias; + ctx->Pixel.MapColorFlag = save->MapColorFlag; + ctx->Pixel.Convolution1DEnabled = save->Convolution1DEnabled; + ctx->Pixel.Convolution2DEnabled = save->Convolution2DEnabled; + ctx->Pixel.Separable2DEnabled = save->Separable2DEnabled; + /* XXX more state */ + ctx->NewState |=_NEW_PIXEL; + } + if (state & META_RASTERIZATION) { _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode); _mesa_PolygonMode(GL_BACK, save->BackPolygonMode); @@ -669,8 +781,35 @@ _mesa_meta_end(GLcontext *ctx) /** - * Return pointer to temp_texture info. This does some one-time init - * if needed. + * One-time init for a temp_texture object. + * Choose tex target, compute max tex size, etc. + */ +static void +init_temp_texture(GLcontext *ctx, struct temp_texture *tex) +{ + /* prefer texture rectangle */ + if (ctx->Extensions.NV_texture_rectangle) { + tex->Target = GL_TEXTURE_RECTANGLE; + tex->MaxSize = ctx->Const.MaxTextureRectSize; + tex->NPOT = GL_TRUE; + } + else { + /* use 2D texture, NPOT if possible */ + tex->Target = GL_TEXTURE_2D; + tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1); + tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two; + } + tex->MinSize = 16; /* 16 x 16 at least */ + assert(tex->MaxSize > 0); + + _mesa_GenTextures(1, &tex->TexObj); + _mesa_BindTexture(tex->Target, tex->TexObj); +} + + +/** + * Return pointer to temp_texture info for non-bitmap ops. + * This does some one-time init if needed. */ static struct temp_texture * get_temp_texture(GLcontext *ctx) @@ -678,24 +817,25 @@ get_temp_texture(GLcontext *ctx) struct temp_texture *tex = &ctx->Meta->TempTex; if (!tex->TexObj) { - /* do one-time init */ + init_temp_texture(ctx, tex); + } - /* prefer texture rectangle */ - if (ctx->Extensions.NV_texture_rectangle) { - tex->Target = GL_TEXTURE_RECTANGLE; - tex->MaxSize = ctx->Const.MaxTextureRectSize; - tex->NPOT = GL_TRUE; - } - else { - /* use 2D texture, NPOT if possible */ - tex->Target = GL_TEXTURE_2D; - tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two; - } - assert(tex->MaxSize > 0); + return tex; +} - _mesa_GenTextures(1, &tex->TexObj); - _mesa_BindTexture(tex->Target, tex->TexObj); + +/** + * Return pointer to temp_texture info for _mesa_meta_bitmap(). + * We use a separate texture for bitmaps to reduce texture + * allocation/deallocation. + */ +static struct temp_texture * +get_bitmap_temp_texture(GLcontext *ctx) +{ + struct temp_texture *tex = &ctx->Meta->Bitmap.Tex; + + if (!tex->TexObj) { + init_temp_texture(ctx, tex); } return tex; @@ -717,6 +857,9 @@ alloc_texture(struct temp_texture *tex, { GLboolean newTex = GL_FALSE; + ASSERT(width <= tex->MaxSize); + ASSERT(height <= tex->MaxSize); + if (width > tex->Width || height > tex->Height || intFormat != tex->IntFormat) { @@ -724,13 +867,13 @@ alloc_texture(struct temp_texture *tex, if (tex->NPOT) { /* use non-power of two size */ - tex->Width = width; - tex->Height = height; + tex->Width = MAX2(tex->MinSize, width); + tex->Height = MAX2(tex->MinSize, height); } else { /* find power of two size */ GLsizei w, h; - w = h = 16; + w = h = tex->MinSize; while (w < width) w *= 2; while (h < height) @@ -803,7 +946,8 @@ setup_copypix_texture(struct temp_texture *tex, * Setup/load texture for glDrawPixels. */ static void -setup_drawpix_texture(struct temp_texture *tex, +setup_drawpix_texture(GLcontext *ctx, + struct temp_texture *tex, GLboolean newTex, GLenum texIntFormat, GLsizei width, GLsizei height, @@ -824,9 +968,17 @@ setup_drawpix_texture(struct temp_texture *tex, tex->Width, tex->Height, 0, format, type, pixels); } else { + struct gl_buffer_object *save_unpack_obj = NULL; + + _mesa_reference_buffer_object(ctx, &save_unpack_obj, + ctx->Unpack.BufferObj); + _mesa_BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); /* create empty texture */ _mesa_TexImage2D(tex->Target, 0, tex->IntFormat, tex->Width, tex->Height, 0, format, type, NULL); + if (save_unpack_obj != NULL) + _mesa_BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + save_unpack_obj->Name); /* load image */ _mesa_TexSubImage2D(tex->Target, 0, 0, 0, width, height, format, type, pixels); @@ -873,15 +1025,144 @@ init_blit_depth_pixels(GLcontext *ctx) } +/** + * Try to do a glBlitFramebuffer using no-copy texturing. + * We can do this when the src renderbuffer is actually a texture. + * But if the src buffer == dst buffer we cannot do this. + * + * \return new buffer mask indicating the buffers left to blit using the + * normal path. + */ +static GLbitfield +blitframebuffer_texture(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + if (mask & GL_COLOR_BUFFER_BIT) { + const struct gl_framebuffer *drawFb = ctx->DrawBuffer; + const struct gl_framebuffer *readFb = ctx->ReadBuffer; + const struct gl_renderbuffer_attachment *drawAtt = + &drawFb->Attachment[drawFb->_ColorDrawBufferIndexes[0]]; + const struct gl_renderbuffer_attachment *readAtt = + &readFb->Attachment[readFb->_ColorReadBufferIndex]; + + if (readAtt && readAtt->Texture) { + const struct gl_texture_object *texObj = readAtt->Texture; + const GLuint srcLevel = readAtt->TextureLevel; + const GLenum minFilterSave = texObj->MinFilter; + const GLenum magFilterSave = texObj->MagFilter; + const GLint baseLevelSave = texObj->BaseLevel; + const GLint maxLevelSave = texObj->MaxLevel; + const GLenum wrapSSave = texObj->WrapS; + const GLenum wrapTSave = texObj->WrapT; + const GLenum target = texObj->Target; + + if (drawAtt->Texture == readAtt->Texture) { + /* Can't use same texture as both the source and dest. We need + * to handle overlapping blits and besides, some hw may not + * support this. + */ + return mask; + } + + if (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_ARB) { + /* Can't handle other texture types at this time */ + return mask; + } + + /* + printf("Blit from texture!\n"); + printf(" srcAtt %p dstAtt %p\n", readAtt, drawAtt); + printf(" srcTex %p dstText %p\n", texObj, drawAtt->Texture); + */ + + /* Prepare src texture state */ + _mesa_BindTexture(target, texObj->Name); + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + _mesa_set_enable(ctx, target, GL_TRUE); + + /* Prepare vertex data (the VBO was previously created and bound) */ + { + struct vertex { + GLfloat x, y, s, t; + }; + struct vertex verts[4]; + GLfloat s0, t0, s1, t1; + + if (target == GL_TEXTURE_2D) { + const struct gl_texture_image *texImage + = _mesa_select_tex_image(ctx, texObj, target, srcLevel); + s0 = srcX0 / (float) texImage->Width; + s1 = srcX1 / (float) texImage->Width; + t0 = srcY0 / (float) texImage->Height; + t1 = srcY1 / (float) texImage->Height; + } + else { + assert(target == GL_TEXTURE_RECTANGLE_ARB); + s0 = srcX0; + s1 = srcX1; + t0 = srcY0; + t1 = srcY1; + } + + verts[0].x = (GLfloat) dstX0; + verts[0].y = (GLfloat) dstY0; + verts[1].x = (GLfloat) dstX1; + verts[1].y = (GLfloat) dstY0; + verts[2].x = (GLfloat) dstX1; + verts[2].y = (GLfloat) dstY1; + verts[3].x = (GLfloat) dstX0; + verts[3].y = (GLfloat) dstY1; + + verts[0].s = s0; + verts[0].t = t0; + verts[1].s = s1; + verts[1].t = t0; + verts[2].s = s1; + verts[2].t = t1; + verts[3].s = s0; + verts[3].t = t1; + + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + + /* Restore texture object state, the texture binding will + * be restored by _mesa_meta_end(). + */ + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); + + /* Done with color buffer */ + mask &= ~GL_COLOR_BUFFER_BIT; + } + } + + return mask; +} + + /** * Meta implementation of ctx->Driver.BlitFramebuffer() in terms * of texture mapping and polygon rendering. */ void -_mesa_meta_blit_framebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) +_mesa_meta_BlitFramebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) { struct blit_state *blit = &ctx->Meta->Blit; struct temp_texture *tex = get_temp_texture(ctx); @@ -892,7 +1173,10 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, const GLint srcH = abs(srcY1 - srcY0); const GLboolean srcFlipX = srcX1 < srcX0; const GLboolean srcFlipY = srcY1 < srcY0; - GLfloat verts[4][4]; /* four verts of X,Y,S,T */ + struct vertex { + GLfloat x, y, s, t; + }; + struct vertex verts[4]; GLboolean newTex; if (srcW > maxTexSize || srcH > maxTexSize) { @@ -931,10 +1215,8 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (2 * sizeof(GLfloat))); + _mesa_VertexPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); } @@ -943,33 +1225,45 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, blit->VBO); } + /* Try faster, direct texture approach first */ + mask = blitframebuffer_texture(ctx, srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, mask, filter); + if (mask == 0x0) { + _mesa_meta_end(ctx); + return; + } + + /* Continue with "normal" approach which involves copying the src rect + * into a temporary texture and is "blitted" by drawing a textured quad. + */ + newTex = alloc_texture(tex, srcW, srcH, GL_RGBA); /* vertex positions/texcoords (after texture allocation!) */ { - verts[0][0] = (GLfloat) dstX0; - verts[0][1] = (GLfloat) dstY0; - verts[1][0] = (GLfloat) dstX1; - verts[1][1] = (GLfloat) dstY0; - verts[2][0] = (GLfloat) dstX1; - verts[2][1] = (GLfloat) dstY1; - verts[3][0] = (GLfloat) dstX0; - verts[3][1] = (GLfloat) dstY1; - - verts[0][2] = 0.0F; - verts[0][3] = 0.0F; - verts[1][2] = tex->Sright; - verts[1][3] = 0.0F; - verts[2][2] = tex->Sright; - verts[2][3] = tex->Ttop; - verts[3][2] = 0.0F; - verts[3][3] = tex->Ttop; + verts[0].x = (GLfloat) dstX0; + verts[0].y = (GLfloat) dstY0; + verts[1].x = (GLfloat) dstX1; + verts[1].y = (GLfloat) dstY0; + verts[2].x = (GLfloat) dstX1; + verts[2].y = (GLfloat) dstY1; + verts[3].x = (GLfloat) dstX0; + verts[3].y = (GLfloat) dstY1; + + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; /* upload new vertex data */ _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); } - _mesa_Enable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_TRUE); if (mask & GL_COLOR_BUFFER_BIT) { setup_copypix_texture(tex, newTex, srcX, srcY, srcW, srcH, @@ -990,7 +1284,7 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, _mesa_ReadPixels(srcX, srcY, srcW, srcH, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp); - setup_drawpix_texture(tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH, + setup_drawpix_texture(ctx, tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); @@ -1011,7 +1305,7 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, /* XXX can't easily do stencil */ } - _mesa_Disable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_FALSE); _mesa_meta_end(ctx); @@ -1026,10 +1320,13 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, * Meta implementation of ctx->Driver.Clear() in terms of polygon rendering. */ void -_mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) +_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers) { struct clear_state *clear = &ctx->Meta->Clear; - GLfloat verts[4][7]; /* four verts of X,Y,Z,R,G,B,A */ + struct vertex { + GLfloat x, y, z, r, g, b, a; + }; + struct vertex verts[4]; /* save all state but scissor, pixel pack/unpack */ GLbitfield metaSave = META_ALL - META_SCISSOR - META_PIXEL_STORE; @@ -1050,14 +1347,10 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) /* create vertex array buffer */ _mesa_GenBuffersARB(1, &clear->VBO); _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, clear->VBO); - _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), - NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_ColorPointer(4, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_ColorPointer(4, GL_FLOAT, sizeof(struct vertex), OFFSET(r)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_COLOR_ARRAY); } @@ -1107,26 +1400,30 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) const GLfloat z = 1.0 - 2.0 * ctx->Depth.Clear; GLuint i; - verts[0][0] = x0; - verts[0][1] = y0; - verts[0][2] = z; - verts[1][0] = x1; - verts[1][1] = y0; - verts[1][2] = z; - verts[2][0] = x1; - verts[2][1] = y1; - verts[2][2] = z; - verts[3][0] = x0; - verts[3][1] = y1; - verts[3][2] = z; + verts[0].x = x0; + verts[0].y = y0; + verts[0].z = z; + verts[1].x = x1; + verts[1].y = y0; + verts[1].z = z; + verts[2].x = x1; + verts[2].y = y1; + verts[2].z = z; + verts[3].x = x0; + verts[3].y = y1; + verts[3].z = z; /* vertex colors */ for (i = 0; i < 4; i++) { - COPY_4FV(&verts[i][3], ctx->Color.ClearColor); + verts[i].r = ctx->Color.ClearColor[0]; + verts[i].g = ctx->Color.ClearColor[1]; + verts[i].b = ctx->Color.ClearColor[2]; + verts[i].a = ctx->Color.ClearColor[3]; } /* upload new vertex data */ - _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts, + GL_DYNAMIC_DRAW_ARB); } /* draw quad */ @@ -1141,13 +1438,16 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) * of texture mapping and polygon rendering. */ void -_mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, - GLsizei width, GLsizei height, - GLint dstX, GLint dstY, GLenum type) +_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcX, GLint srcY, + GLsizei width, GLsizei height, + GLint dstX, GLint dstY, GLenum type) { struct copypix_state *copypix = &ctx->Meta->CopyPix; struct temp_texture *tex = get_temp_texture(ctx); - GLfloat verts[4][5]; /* four verts of X,Y,Z,S,T */ + struct vertex { + GLfloat x, y, z, s, t; + }; + struct vertex verts[4]; GLboolean newTex; GLenum intFormat = GL_RGBA; @@ -1185,10 +1485,8 @@ _mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); } @@ -1207,26 +1505,26 @@ _mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, const GLfloat dstY1 = dstY + height * ctx->Pixel.ZoomY; const GLfloat z = ctx->Current.RasterPos[2]; - verts[0][0] = dstX0; - verts[0][1] = dstY0; - verts[0][2] = z; - verts[0][3] = 0.0F; - verts[0][4] = 0.0F; - verts[1][0] = dstX1; - verts[1][1] = dstY0; - verts[1][2] = z; - verts[1][3] = tex->Sright; - verts[1][4] = 0.0F; - verts[2][0] = dstX1; - verts[2][1] = dstY1; - verts[2][2] = z; - verts[2][3] = tex->Sright; - verts[2][4] = tex->Ttop; - verts[3][0] = dstX0; - verts[3][1] = dstY1; - verts[3][2] = z; - verts[3][3] = 0.0F; - verts[3][4] = tex->Ttop; + verts[0].x = dstX0; + verts[0].y = dstY0; + verts[0].z = z; + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].x = dstX1; + verts[1].y = dstY0; + verts[1].z = z; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].x = dstX1; + verts[2].y = dstY1; + verts[2].z = z; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].x = dstX0; + verts[3].y = dstY1; + verts[3].z = z; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; /* upload new vertex data */ _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); @@ -1236,12 +1534,12 @@ _mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, setup_copypix_texture(tex, newTex, srcX, srcY, width, height, GL_RGBA, GL_NEAREST); - _mesa_Enable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_TRUE); /* draw textured quad */ _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - _mesa_Disable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_FALSE); _mesa_meta_end(ctx); } @@ -1279,9 +1577,8 @@ tiled_draw_pixels(GLcontext *ctx, tileUnpack.SkipRows = unpack->SkipRows + j; - _mesa_meta_draw_pixels(ctx, tileX, tileY, - tileWidth, tileHeight, - format, type, &tileUnpack, pixels); + _mesa_meta_DrawPixels(ctx, tileX, tileY, tileWidth, tileHeight, + format, type, &tileUnpack, pixels); } } } @@ -1390,17 +1687,20 @@ init_draw_depth_pixels(GLcontext *ctx) * of texture mapping and polygon rendering. */ void -_mesa_meta_draw_pixels(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) +_mesa_meta_DrawPixels(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels) { struct drawpix_state *drawpix = &ctx->Meta->DrawPix; struct temp_texture *tex = get_temp_texture(ctx); const struct gl_pixelstore_attrib unpackSave = ctx->Unpack; const GLuint origStencilMask = ctx->Stencil.WriteMask[0]; - GLfloat verts[4][5]; /* four verts of X,Y,Z,S,T */ + struct vertex { + GLfloat x, y, z, s, t; + }; + struct vertex verts[4]; GLenum texIntFormat; GLboolean fallback, newTex; GLbitfield metaExtraSave = 0x0; @@ -1494,26 +1794,26 @@ _mesa_meta_draw_pixels(GLcontext *ctx, const GLfloat y1 = y + height * ctx->Pixel.ZoomY; const GLfloat z = ctx->Current.RasterPos[2]; - verts[0][0] = x0; - verts[0][1] = y0; - verts[0][2] = z; - verts[0][3] = 0.0F; - verts[0][4] = 0.0F; - verts[1][0] = x1; - verts[1][1] = y0; - verts[1][2] = z; - verts[1][3] = tex->Sright; - verts[1][4] = 0.0F; - verts[2][0] = x1; - verts[2][1] = y1; - verts[2][2] = z; - verts[2][3] = tex->Sright; - verts[2][4] = tex->Ttop; - verts[3][0] = x0; - verts[3][1] = y1; - verts[3][2] = z; - verts[3][3] = 0.0F; - verts[3][4] = tex->Ttop; + verts[0].x = x0; + verts[0].y = y0; + verts[0].z = z; + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].x = x1; + verts[1].y = y0; + verts[1].z = z; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].x = x1; + verts[2].y = y1; + verts[2].z = z; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].x = x0; + verts[3].y = y1; + verts[3].z = z; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; } if (drawpix->ArrayObj == 0) { @@ -1529,17 +1829,15 @@ _mesa_meta_draw_pixels(GLcontext *ctx, verts, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); /* set given unpack params */ ctx->Unpack = *unpack; - _mesa_Enable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_TRUE); if (_mesa_is_stencil_format(format)) { /* Drawing stencil */ @@ -1548,7 +1846,7 @@ _mesa_meta_draw_pixels(GLcontext *ctx, if (!drawpix->StencilFP) init_draw_stencil_pixels(ctx); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, GL_ALPHA, type, pixels); _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); @@ -1591,19 +1889,19 @@ _mesa_meta_draw_pixels(GLcontext *ctx, _mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, ctx->Current.RasterColor); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, format, type, pixels); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } else { /* Drawing RGBA */ - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, format, type, pixels); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } - _mesa_Disable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_FALSE); _mesa_DeleteBuffersARB(1, &vbo); @@ -1612,3 +1910,889 @@ _mesa_meta_draw_pixels(GLcontext *ctx, _mesa_meta_end(ctx); } + + +/** + * Do glBitmap with a alpha texture quad. Use the alpha test to + * cull the 'off' bits. If alpha test is already enabled, fall back + * to swrast (should be a rare case). + * A bitmap cache as in the gallium/mesa state tracker would + * improve performance a lot. + */ +void +_mesa_meta_Bitmap(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap1) +{ + struct bitmap_state *bitmap = &ctx->Meta->Bitmap; + struct temp_texture *tex = get_bitmap_temp_texture(ctx); + const GLenum texIntFormat = GL_ALPHA; + const struct gl_pixelstore_attrib unpackSave = *unpack; + struct vertex { + GLfloat x, y, z, s, t, r, g, b, a; + }; + struct vertex verts[4]; + GLboolean newTex; + GLubyte *bitmap8; + + /* + * Check if swrast fallback is needed. + */ + if (ctx->_ImageTransferState || + ctx->Color.AlphaEnabled || + ctx->Fog.Enabled || + ctx->Texture._EnabledUnits || + width > tex->MaxSize || + height > tex->MaxSize) { + _swrast_Bitmap(ctx, x, y, width, height, unpack, bitmap1); + return; + } + + /* Most GL state applies to glBitmap (like blending, stencil, etc), + * but a there's a few things we need to override: + */ + _mesa_meta_begin(ctx, (META_ALPHA_TEST | + META_PIXEL_STORE | + META_RASTERIZATION | + META_SHADER | + META_TEXTURE | + META_TRANSFORM | + META_VERTEX | + META_VIEWPORT)); + + if (bitmap->ArrayObj == 0) { + /* one-time setup */ + + /* create vertex array object */ + _mesa_GenVertexArraysAPPLE(1, &bitmap->ArrayObj); + _mesa_BindVertexArrayAPPLE(bitmap->ArrayObj); + + /* create vertex array buffer */ + _mesa_GenBuffersARB(1, &bitmap->VBO); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, bitmap->VBO); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), + NULL, GL_DYNAMIC_DRAW_ARB); + + /* setup vertex arrays */ + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); + _mesa_ColorPointer(4, GL_FLOAT, sizeof(struct vertex), OFFSET(r)); + _mesa_EnableClientState(GL_VERTEX_ARRAY); + _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); + _mesa_EnableClientState(GL_COLOR_ARRAY); + } + else { + _mesa_BindVertexArray(bitmap->ArrayObj); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, bitmap->VBO); + } + + newTex = alloc_texture(tex, width, height, texIntFormat); + + /* vertex positions, texcoords, colors (after texture allocation!) */ + { + const GLfloat x0 = (GLfloat) x; + const GLfloat y0 = (GLfloat) y; + const GLfloat x1 = (GLfloat) (x + width); + const GLfloat y1 = (GLfloat) (y + height); + const GLfloat z = ctx->Current.RasterPos[2]; + GLuint i; + + verts[0].x = x0; + verts[0].y = y0; + verts[0].z = z; + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].x = x1; + verts[1].y = y0; + verts[1].z = z; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].x = x1; + verts[2].y = y1; + verts[2].z = z; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].x = x0; + verts[3].y = y1; + verts[3].z = z; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; + + for (i = 0; i < 4; i++) { + verts[i].r = ctx->Current.RasterColor[0]; + verts[i].g = ctx->Current.RasterColor[1]; + verts[i].b = ctx->Current.RasterColor[2]; + verts[i].a = ctx->Current.RasterColor[3]; + } + + /* upload new vertex data */ + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + bitmap1 = _mesa_map_pbo_source(ctx, &unpackSave, bitmap1); + if (!bitmap1) + return; + + bitmap8 = (GLubyte *) _mesa_calloc(width * height); + if (bitmap8) { + _mesa_expand_bitmap(width, height, &unpackSave, bitmap1, + bitmap8, width, 0xff); + + _mesa_set_enable(ctx, tex->Target, GL_TRUE); + + _mesa_set_enable(ctx, GL_ALPHA_TEST, GL_TRUE); + _mesa_AlphaFunc(GL_GREATER, 0.0); + + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, + GL_ALPHA, GL_UNSIGNED_BYTE, bitmap8); + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + + _mesa_set_enable(ctx, tex->Target, GL_FALSE); + + _mesa_free(bitmap8); + } + + _mesa_unmap_pbo_source(ctx, &unpackSave); + + _mesa_meta_end(ctx); +} + + +/** + * Check if the call to _mesa_meta_GenerateMipmap() will require a + * software fallback. The fallback path will require that the texture + * images are mapped. + * \return GL_TRUE if a fallback is needed, GL_FALSE otherwise + */ +GLboolean +_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + const GLuint fboSave = ctx->DrawBuffer->Name; + struct gen_mipmap_state *mipmap = &ctx->Meta->Mipmap; + struct gl_texture_image *baseImage; + GLuint srcLevel; + GLenum status; + + /* check for fallbacks */ + if (!ctx->Extensions.EXT_framebuffer_object || + target == GL_TEXTURE_3D) { + return GL_TRUE; + } + + srcLevel = texObj->BaseLevel; + baseImage = _mesa_select_tex_image(ctx, texObj, target, srcLevel); + if (!baseImage || _mesa_is_format_compressed(baseImage->TexFormat)) { + return GL_TRUE; + } + + /* + * Test that we can actually render in the texture's format. + */ + if (!mipmap->FBO) + _mesa_GenFramebuffersEXT(1, &mipmap->FBO); + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); + + if (target == GL_TEXTURE_1D) { + _mesa_FramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel); + } + else if (target == GL_TEXTURE_3D) { + GLint zoffset = 0; + _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel, zoffset); + } + else { + /* 2D / cube */ + _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel); + } + + status = _mesa_CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); + + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + return GL_TRUE; + } + + return GL_FALSE; +} + + +/** + * Called via ctx->Driver.GenerateMipmap() + * Note: texture borders and 3D texture support not yet complete. + */ +void +_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + struct gen_mipmap_state *mipmap = &ctx->Meta->Mipmap; + struct vertex { + GLfloat x, y, s, t, r; + }; + struct vertex verts[4]; + const GLuint baseLevel = texObj->BaseLevel; + const GLuint maxLevel = texObj->MaxLevel; + const GLenum minFilterSave = texObj->MinFilter; + const GLenum magFilterSave = texObj->MagFilter; + const GLint baseLevelSave = texObj->BaseLevel; + const GLint maxLevelSave = texObj->MaxLevel; + const GLboolean genMipmapSave = texObj->GenerateMipmap; + const GLenum wrapSSave = texObj->WrapS; + const GLenum wrapTSave = texObj->WrapT; + const GLenum wrapRSave = texObj->WrapR; + const GLuint fboSave = ctx->DrawBuffer->Name; + const GLuint original_active_unit = ctx->Texture.CurrentUnit; + GLenum faceTarget; + GLuint dstLevel; + GLuint border = 0; + + if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) { + _mesa_generate_mipmap(ctx, target, texObj); + return; + } + + if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && + target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) { + faceTarget = target; + target = GL_TEXTURE_CUBE_MAP; + } + else { + faceTarget = target; + } + + _mesa_meta_begin(ctx, META_ALL); + + if (original_active_unit != 0) + _mesa_BindTexture(target, texObj->Name); + + if (mipmap->ArrayObj == 0) { + /* one-time setup */ + + /* create vertex array object */ + _mesa_GenVertexArraysAPPLE(1, &mipmap->ArrayObj); + _mesa_BindVertexArrayAPPLE(mipmap->ArrayObj); + + /* create vertex array buffer */ + _mesa_GenBuffersARB(1, &mipmap->VBO); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), + NULL, GL_DYNAMIC_DRAW_ARB); + + /* setup vertex arrays */ + _mesa_VertexPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); + _mesa_EnableClientState(GL_VERTEX_ARRAY); + _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); + } + else { + _mesa_BindVertexArray(mipmap->ArrayObj); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO); + } + + if (!mipmap->FBO) { + _mesa_GenFramebuffersEXT(1, &mipmap->FBO); + } + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); + + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + _mesa_set_enable(ctx, target, GL_TRUE); + + /* setup texcoords once (XXX what about border?) */ + switch (faceTarget) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[0].r = 0.0F; + verts[1].s = 1.0F; + verts[1].t = 0.0F; + verts[1].r = 0.0F; + verts[2].s = 1.0F; + verts[2].t = 1.0F; + verts[2].r = 0.0F; + verts[3].s = 0.0F; + verts[3].t = 1.0F; + verts[3].r = 0.0F; + break; + case GL_TEXTURE_3D: + abort(); + break; + default: + /* cube face */ + { + static const GLfloat st[4][2] = { + {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f} + }; + GLuint i; + + /* loop over quad verts */ + for (i = 0; i < 4; i++) { + /* Compute sc = +/-scale and tc = +/-scale. + * Not +/-1 to avoid cube face selection ambiguity near the edges, + * though that can still sometimes happen with this scale factor... + */ + const GLfloat scale = 0.9999f; + const GLfloat sc = (2.0f * st[i][0] - 1.0f) * scale; + const GLfloat tc = (2.0f * st[i][1] - 1.0f) * scale; + + switch (faceTarget) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + verts[i].s = 1.0f; + verts[i].t = -tc; + verts[i].r = -sc; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + verts[i].s = -1.0f; + verts[i].t = -tc; + verts[i].r = sc; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + verts[i].s = sc; + verts[i].t = 1.0f; + verts[i].r = tc; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + verts[i].s = sc; + verts[i].t = -1.0f; + verts[i].r = -tc; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + verts[i].s = sc; + verts[i].t = -tc; + verts[i].r = 1.0f; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + verts[i].s = -sc; + verts[i].t = -tc; + verts[i].r = -1.0f; + break; + default: + assert(0); + } + } + } + } + + _mesa_set_enable(ctx, target, GL_TRUE); + + /* texture is already locked, unlock now */ + _mesa_unlock_texture(ctx, texObj); + + for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) { + const struct gl_texture_image *srcImage; + const GLuint srcLevel = dstLevel - 1; + GLsizei srcWidth, srcHeight, srcDepth; + GLsizei dstWidth, dstHeight, dstDepth; + GLenum status; + + srcImage = _mesa_select_tex_image(ctx, texObj, faceTarget, srcLevel); + assert(srcImage->Border == 0); /* XXX we can fix this */ + + /* src size w/out border */ + srcWidth = srcImage->Width - 2 * border; + srcHeight = srcImage->Height - 2 * border; + srcDepth = srcImage->Depth - 2 * border; + + /* new dst size w/ border */ + dstWidth = MAX2(1, srcWidth / 2) + 2 * border; + dstHeight = MAX2(1, srcHeight / 2) + 2 * border; + dstDepth = MAX2(1, srcDepth / 2) + 2 * border; + + if (dstWidth == srcImage->Width && + dstHeight == srcImage->Height && + dstDepth == srcImage->Depth) { + /* all done */ + break; + } + + /* Create empty dest image */ + if (target == GL_TEXTURE_1D) { + _mesa_TexImage1D(target, dstLevel, srcImage->InternalFormat, + dstWidth, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else if (target == GL_TEXTURE_3D) { + _mesa_TexImage3D(target, dstLevel, srcImage->InternalFormat, + dstWidth, dstHeight, dstDepth, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else { + /* 2D or cube */ + _mesa_TexImage2D(faceTarget, dstLevel, srcImage->InternalFormat, + dstWidth, dstHeight, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + + if (target == GL_TEXTURE_CUBE_MAP) { + /* If texturing from a cube, we need to make sure all src faces + * have been defined (even if we're not sampling from them.) + * Otherwise the texture object will be 'incomplete' and + * texturing from it will not be allowed. + */ + GLuint face; + for (face = 0; face < 6; face++) { + if (!texObj->Image[face][srcLevel] || + texObj->Image[face][srcLevel]->Width != srcWidth) { + _mesa_TexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, + srcLevel, srcImage->InternalFormat, + srcWidth, srcHeight, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + } + } + } + + /* setup vertex positions */ + { + verts[0].x = 0.0F; + verts[0].y = 0.0F; + verts[1].x = (GLfloat) dstWidth; + verts[1].y = 0.0F; + verts[2].x = (GLfloat) dstWidth; + verts[2].y = (GLfloat) dstHeight; + verts[3].x = 0.0F; + verts[3].y = (GLfloat) dstHeight; + + /* upload new vertex data */ + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + /* limit sampling to src level */ + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); + + /* Set to draw into the current dstLevel */ + if (target == GL_TEXTURE_1D) { + _mesa_FramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, + texObj->Name, + dstLevel); + } + else if (target == GL_TEXTURE_3D) { + GLint zoffset = 0; /* XXX unfinished */ + _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, + texObj->Name, + dstLevel, zoffset); + } + else { + /* 2D / cube */ + _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + faceTarget, + texObj->Name, + dstLevel); + } + + _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); + + /* sanity check */ + status = _mesa_CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + abort(); + break; + } + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + } + + _mesa_lock_texture(ctx, texObj); /* relock */ + + _mesa_meta_end(ctx); + + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, wrapRSave); + + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); +} + + +/** + * Determine the GL data type to use for the temporary image read with + * ReadPixels() and passed to Tex[Sub]Image(). + */ +static GLenum +get_temp_image_type(GLcontext *ctx, GLenum baseFormat) +{ + switch (baseFormat) { + case GL_RGBA: + case GL_RGB: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_INTENSITY: + if (ctx->DrawBuffer->Visual.redBits <= 8) + return GL_UNSIGNED_BYTE; + else if (ctx->DrawBuffer->Visual.redBits <= 8) + return GL_UNSIGNED_SHORT; + else + return GL_FLOAT; + case GL_DEPTH_COMPONENT: + return GL_UNSIGNED_INT; + case GL_DEPTH_STENCIL: + return GL_UNSIGNED_INT_24_8; + default: + _mesa_problem(ctx, "Unexpected format in get_temp_image_type()"); + return 0; + } +} + + +/** + * Helper for _mesa_meta_CopyTexImage1/2D() functions. + * Have to be careful with locking and meta state for pixel transfer. + */ +static void +copy_tex_image(GLcontext *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; + GLsizei postConvWidth = width, postConvHeight = height; + GLenum format, type; + GLint bpp; + void *buf; + + texObj = _mesa_get_current_tex_object(ctx, target); + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + + format = _mesa_base_tex_format(ctx, internalFormat); + type = get_temp_image_type(ctx, format); + bpp = _mesa_bytes_per_pixel(format, type); + if (bpp <= 0) { + _mesa_problem(ctx, "Bad bpp in meta copy_tex_image()"); + return; + } + + /* + * Alloc image buffer (XXX could use a PBO) + */ + buf = _mesa_malloc(width * height * bpp); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); + return; + } + + if (texImage->TexFormat == MESA_FORMAT_NONE) + texImage->TexFormat = ctx->Driver.ChooseTextureFormat(ctx, + internalFormat, + format, + type); + + _mesa_unlock_texture(ctx, texObj); /* need to unlock first */ + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, height, + format, type, &ctx->Pack, buf); + _mesa_meta_end(ctx); + + /* + * Prepare for new texture image size/data + */ +#if FEATURE_convolve + if (_mesa_is_color_format(internalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } +#endif + + if (texImage->Data) { + ctx->Driver.FreeTexImageData(ctx, texImage); + } + + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + /* + * Store texture data (with pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE); + + _mesa_update_state(ctx); /* to update pixel transfer state */ + + if (target == GL_TEXTURE_1D) { + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, format, type, + buf, &ctx->Unpack, texObj, texImage); + } + else { + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, format, type, + buf, &ctx->Unpack, texObj, texImage); + } + _mesa_meta_end(ctx); + + _mesa_lock_texture(ctx, texObj); /* re-lock */ + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyTexImage1D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLint border) +{ + copy_tex_image(ctx, 1, target, level, internalFormat, x, y, + width, 1, border); +} + + +void +_mesa_meta_CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLint border) +{ + copy_tex_image(ctx, 2, target, level, internalFormat, x, y, + width, height, border); +} + + + +/** + * Helper for _mesa_meta_CopyTexSubImage1/2/3D() functions. + * Have to be careful with locking and meta state for pixel transfer. + */ +static void +copy_tex_sub_image(GLcontext *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; + GLenum format, type; + GLint bpp; + void *buf; + + texObj = _mesa_get_current_tex_object(ctx, target); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + format = _mesa_get_format_base_format(texImage->TexFormat); + type = get_temp_image_type(ctx, format); + bpp = _mesa_bytes_per_pixel(format, type); + if (bpp <= 0) { + _mesa_problem(ctx, "Bad bpp in meta copy_tex_sub_image()"); + return; + } + + /* + * Alloc image buffer (XXX could use a PBO) + */ + buf = _mesa_malloc(width * height * bpp); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage%uD", dims); + return; + } + + _mesa_unlock_texture(ctx, texObj); /* need to unlock first */ + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, height, + format, type, &ctx->Pack, buf); + _mesa_meta_end(ctx); + + _mesa_update_state(ctx); /* to update pixel transfer state */ + + /* + * Store texture data (with pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE); + if (target == GL_TEXTURE_1D) { + ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, + width, format, type, buf, + &ctx->Unpack, texObj, texImage); + } + else if (target == GL_TEXTURE_3D) { + ctx->Driver.TexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, + width, height, 1, format, type, buf, + &ctx->Unpack, texObj, texImage); + } + else { + ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset, + width, height, format, type, buf, + &ctx->Unpack, texObj, texImage); + } + _mesa_meta_end(ctx); + + _mesa_lock_texture(ctx, texObj); /* re-lock */ + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyTexSubImage1D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, + GLint x, GLint y, GLsizei width) +{ + copy_tex_sub_image(ctx, 1, target, level, xoffset, 0, 0, + x, y, width, 1); +} + + +void +_mesa_meta_CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + copy_tex_sub_image(ctx, 2, target, level, xoffset, yoffset, 0, + x, y, width, height); +} + + +void +_mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + copy_tex_sub_image(ctx, 3, target, level, xoffset, yoffset, zoffset, + x, y, width, height); +} + + +void +_mesa_meta_CopyColorTable(GLcontext *ctx, + GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ColorTable(target, internalformat, width, GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ColorSubTable(target, start, width, GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + _mesa_update_state(ctx); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ConvolutionFilter1D(target, internalFormat, width, + GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + _mesa_update_state(ctx); + + ctx->Driver.ReadPixels(ctx, x, y, width, height, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ConvolutionFilter2D(target, internalFormat, width, height, + GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h index b03b64c48..6225b9418 100644 --- a/mesalib/src/mesa/drivers/common/meta.h +++ b/mesalib/src/mesa/drivers/common/meta.h @@ -27,29 +27,6 @@ #define META_H -/** - * Flags passed to _mesa_meta_begin(). - * XXX these flags may evolve... - */ -/*@{*/ -#define META_ALPHA_TEST 0x1 -#define META_BLEND 0x2 /**< includes logicop */ -#define META_COLOR_MASK 0x4 -#define META_DEPTH_TEST 0x8 -#define META_FOG 0x10 -#define META_RASTERIZATION 0x20 -#define META_SCISSOR 0x40 -#define META_SHADER 0x80 -#define META_STENCIL_TEST 0x100 -#define META_TRANSFORM 0x200 /**< modelview, projection */ -#define META_TEXTURE 0x400 -#define META_VERTEX 0x800 -#define META_VIEWPORT 0x1000 -#define META_PIXEL_STORE 0x2000 -#define META_ALL ~0x0 -/*@}*/ - - extern void _mesa_meta_init(GLcontext *ctx); @@ -57,25 +34,85 @@ extern void _mesa_meta_free(GLcontext *ctx); extern void -_mesa_meta_blit_framebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter); +_mesa_meta_BlitFramebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); + +extern void +_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers); + +extern void +_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type); + +extern void +_mesa_meta_DrawPixels(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels); + +extern void +_mesa_meta_Bitmap(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap); + +extern GLboolean +_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj); + +extern void +_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj); + +extern void +_mesa_meta_CopyTexImage1D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLint border); + +extern void +_mesa_meta_CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLint border); + +extern void +_mesa_meta_CopyTexSubImage1D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, + GLint x, GLint y, GLsizei width); + +extern void +_mesa_meta_CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); + +extern void +_mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); + +extern void +_mesa_meta_CopyColorTable(GLcontext *ctx, + GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width); extern void -_mesa_meta_clear(GLcontext *ctx, GLbitfield buffers); +_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width); extern void -_mesa_meta_copy_pixels(GLcontext *ctx, GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type); +_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width); extern void -_mesa_meta_draw_pixels(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels); +_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height); #endif /* META_H */ diff --git a/mesalib/src/mesa/drivers/dri/Makefile.template b/mesalib/src/mesa/drivers/dri/Makefile.template index 18dbeba24..39d25ce3f 100644 --- a/mesalib/src/mesa/drivers/dri/Makefile.template +++ b/mesalib/src/mesa/drivers/dri/Makefile.template @@ -60,18 +60,40 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: symlinks depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) +default: subdirs lib -$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template +.PHONY: lib +lib: symlinks subdirs depend + @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) + +$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) Makefile \ + $(TOP)/src/mesa/drivers/dri/Makefile.template $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS) + $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) \ + $(DRI_LIB_DEPS) $(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) $(ASM_SOURCES) $(SYMLINKS) @ echo "running $(MKDEP)" @ rm -f depend diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index e48e10d7c..547f18a00 100644 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -167,11 +167,12 @@ static int driBindContext(__DRIcontext *pcp, __DRIdrawable *pdp, __DRIdrawable *prp) { - __DRIscreenPrivate *psp = pcp->driScreenPriv; + __DRIscreenPrivate *psp = NULL; /* Bind the drawable to the context */ if (pcp) { + psp = pcp->driScreenPriv; pcp->driDrawablePriv = pdp; pcp->driReadablePriv = prp; if (pdp) { @@ -498,11 +499,11 @@ static void dri_put_drawable(__DRIdrawable *pdp) { __DRIscreenPrivate *psp; - pdp->refcount--; - if (pdp->refcount) - return; - if (pdp) { + pdp->refcount--; + if (pdp->refcount) + return; + psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects) { diff --git a/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.c b/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.c index 15af99136..4e7e92c82 100644 --- a/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -1,5 +1,6 @@ #include "main/mtypes.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/imports.h" @@ -53,7 +54,7 @@ driDeleteRenderbuffer(struct gl_renderbuffer *rb) * \param pitch pixels per row */ driRenderbuffer * -driNewRenderbuffer(GLenum format, GLvoid *addr, +driNewRenderbuffer(gl_format format, GLvoid *addr, GLint cpp, GLint offset, GLint pitch, __DRIdrawablePrivate *dPriv) { @@ -79,56 +80,47 @@ driNewRenderbuffer(GLenum format, GLvoid *addr, /* Make sure we're using a null-valued GetPointer routine */ assert(drb->Base.GetPointer(NULL, &drb->Base, 0, 0) == NULL); - drb->Base.InternalFormat = format; - - if (format == GL_RGBA || format == GL_RGB5 || format == GL_RGBA8) { - /* Color */ - drb->Base._BaseFormat = GL_RGBA; - drb->Base.DataType = GL_UNSIGNED_BYTE; - if (format == GL_RGB5) { - drb->Base.RedBits = 5; - drb->Base.GreenBits = 6; - drb->Base.BlueBits = 5; + switch (format) { + case MESA_FORMAT_ARGB8888: + if (cpp == 2) { + /* override format */ + format = MESA_FORMAT_RGB565; } - else { - drb->Base.RedBits = - drb->Base.GreenBits = - drb->Base.BlueBits = - drb->Base.AlphaBits = 8; - } - } - else if (format == GL_DEPTH_COMPONENT16) { - /* Depth */ - drb->Base._BaseFormat = GL_DEPTH_COMPONENT; - /* we always Get/Put 32-bit Z values */ - drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.DepthBits = 16; - } - else if (format == GL_DEPTH_COMPONENT24) { + drb->Base.DataType = GL_UNSIGNED_BYTE; + break; + case MESA_FORMAT_Z16: /* Depth */ - drb->Base._BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.DepthBits = 24; - } - else if (format == GL_DEPTH_COMPONENT32) { + assert(cpp == 2); + break; + case MESA_FORMAT_Z32: /* Depth */ - drb->Base._BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.DepthBits = 32; - } - else { + assert(cpp == 4); + break; + case MESA_FORMAT_Z24_S8: + drb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + assert(cpp == 4); + break; + case MESA_FORMAT_S8_Z24: + drb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + assert(cpp == 4); + break; + case MESA_FORMAT_S8: /* Stencil */ - ASSERT(format == GL_STENCIL_INDEX8_EXT); - drb->Base._BaseFormat = GL_STENCIL_INDEX; drb->Base.DataType = GL_UNSIGNED_BYTE; - drb->Base.StencilBits = 8; + break; + default: + _mesa_problem(NULL, "Bad format 0x%x in driNewRenderbuffer", format); + return NULL; } - /* XXX if we were allocating a user-created renderbuffer, we'd have - * to fill in the Red/Green/Blue/.../Bits values too. - */ + drb->Base.Format = format; + + drb->Base.InternalFormat = + drb->Base._BaseFormat = _mesa_get_format_base_format(format); drb->Base.AllocStorage = driRenderbufferStorage; drb->Base.Delete = driDeleteRenderbuffer; diff --git a/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h b/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h index cf55286b3..3a5cbcdaa 100644 --- a/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/mesalib/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -11,6 +11,7 @@ #define DRIRENDERBUFFER_H #include "main/mtypes.h" +#include "main/formats.h" #include "dri_util.h" @@ -56,14 +57,14 @@ typedef struct { * A handy flag to know if this is the back color buffer. * * \note - * This is currently only used by s3v and tdfx. + * This is currently only used by tdfx. */ GLboolean backBuffer; } driRenderbuffer; extern driRenderbuffer * -driNewRenderbuffer(GLenum format, GLvoid *addr, +driNewRenderbuffer(gl_format format, GLvoid *addr, GLint cpp, GLint offset, GLint pitch, __DRIdrawablePrivate *dPriv); diff --git a/mesalib/src/mesa/drivers/dri/common/extension_helper.h b/mesalib/src/mesa/drivers/dri/common/extension_helper.h deleted file mode 100644 index 40a030ce0..000000000 --- a/mesalib/src/mesa/drivers/dri/common/extension_helper.h +++ /dev/null @@ -1,6609 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by extension_helper.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. - */ - -#include "utils.h" -#include "glapi/dispatch.h" - -#ifndef NULL -# define NULL 0 -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UniformMatrix3fvARB_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix3fv\0" - "glUniformMatrix3fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_multisample) -static const char SampleCoverageARB_names[] = - "fi\0" /* Parameter signature */ - "glSampleCoverage\0" - "glSampleCoverageARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionFilter1D_names[] = - "iiiiip\0" /* Parameter signature */ - "glConvolutionFilter1D\0" - "glConvolutionFilter1DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char BeginQueryARB_names[] = - "ii\0" /* Parameter signature */ - "glBeginQuery\0" - "glBeginQueryARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_NV_point_sprite) -static const char PointParameteriNV_names[] = - "ii\0" /* Parameter signature */ - "glPointParameteri\0" - "glPointParameteriNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetProgramiv_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramiv\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3sARB_names[] = - "iiii\0" /* Parameter signature */ - "glMultiTexCoord3s\0" - "glMultiTexCoord3sARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3iEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3i\0" - "glSecondaryColor3iEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3fMESA_names[] = - "fff\0" /* Parameter signature */ - "glWindowPos3f\0" - "glWindowPos3fARB\0" - "glWindowPos3fMESA\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameterfvSGIS_names[] = - "ip\0" /* Parameter signature */ - "glPixelTexGenParameterfvSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char ActiveTextureARB_names[] = - "i\0" /* Parameter signature */ - "glActiveTexture\0" - "glActiveTextureARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_blit) -static const char BlitFramebufferEXT_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glBlitFramebuffer\0" - "glBlitFramebufferEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4ubvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4ubvNV\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char GetProgramNamedParameterdvNV_names[] = - "iipp\0" /* Parameter signature */ - "glGetProgramNamedParameterdvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char Histogram_names[] = - "iiii\0" /* Parameter signature */ - "glHistogram\0" - "glHistogramEXT\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture4D) -static const char TexImage4DSGIS_names[] = - "iiiiiiiiiip\0" /* Parameter signature */ - "glTexImage4DSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2dvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2dv\0" - "glWindowPos2dvARB\0" - "glWindowPos2dvMESA\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiColor3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_EXT_blend_equation_separate) || defined(need_GL_ATI_blend_equation_separate) -static const char BlendEquationSeparateEXT_names[] = - "ii\0" /* Parameter signature */ - "glBlendEquationSeparate\0" - "glBlendEquationSeparateEXT\0" - "glBlendEquationSeparateATI\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameterfSGIX_names[] = - "iif\0" /* Parameter signature */ - "glListParameterfSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3bEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3b\0" - "glSecondaryColor3bEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fColor4fNormal3fVertex4fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4svNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GetBufferSubDataARB_names[] = - "iiip\0" /* Parameter signature */ - "glGetBufferSubData\0" - "glGetBufferSubDataARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char BufferSubDataARB_names[] = - "iiip\0" /* Parameter signature */ - "glBufferSubData\0" - "glBufferSubDataARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4ubVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glTexCoord2fColor4ubVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char AttachShader_names[] = - "ii\0" /* Parameter signature */ - "glAttachShader\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2fARB_names[] = - "iff\0" /* Parameter signature */ - "glVertexAttrib2f\0" - "glVertexAttrib2fARB\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char GetDebugLogLengthMESA_names[] = - "iii\0" /* Parameter signature */ - "glGetDebugLogLengthMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glVertexAttrib3f\0" - "glVertexAttrib3fARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GetQueryivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryiv\0" - "glGetQueryivARB\0" - ""; -#endif - -#if defined(need_GL_EXT_texture3D) -static const char TexImage3D_names[] = - "iiiiiiiiip\0" /* Parameter signature */ - "glTexImage3D\0" - "glTexImage3DEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glReplacementCodeuiVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GetQueryObjectivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjectiv\0" - "glGetQueryObjectivARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexSubImage2DARB_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glCompressedTexSubImage2D\0" - "glCompressedTexSubImage2DARB\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerOutputNV_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glCombinerOutputNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2fARB_names[] = - "iff\0" /* Parameter signature */ - "glUniform2f\0" - "glUniform2fARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1sv\0" - "glVertexAttrib1svARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs1dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs1dvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform2iv\0" - "glUniform2ivARB\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char GetImageTransformParameterfvHP_names[] = - "iip\0" /* Parameter signature */ - "glGetImageTransformParameterfvHP\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightubvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightubvARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1fvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char CopyConvolutionFilter1D_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyConvolutionFilter1D\0" - "glCopyConvolutionFilter1DEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiNormal3fVertex3fSUN_names[] = - "iffffff\0" /* Parameter signature */ - "glReplacementCodeuiNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char DeleteSync_names[] = - "i\0" /* Parameter signature */ - "glDeleteSync\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentMaterialfvSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_blend_color) -static const char BlendColor_names[] = - "ffff\0" /* Parameter signature */ - "glBlendColor\0" - "glBlendColorEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UniformMatrix4fvARB_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix4fv\0" - "glUniformMatrix4fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) || defined(need_GL_APPLE_vertex_array_object) -static const char DeleteVertexArraysAPPLE_names[] = - "ip\0" /* Parameter signature */ - "glDeleteVertexArrays\0" - "glDeleteVertexArraysAPPLE\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char ReadInstrumentsSGIX_names[] = - "i\0" /* Parameter signature */ - "glReadInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix2x4fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix2x4fv\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glColor4ubVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_texture_array) -static const char FramebufferTextureLayerEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTextureLayer\0" - "glFramebufferTextureLayerEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char GetListParameterfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetListParameterfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NusvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nusv\0" - "glVertexAttrib4NusvARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4svMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4svMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char CreateProgramObjectARB_names[] = - "\0" /* Parameter signature */ - "glCreateProgramObjectARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModelivSGIX_names[] = - "ip\0" /* Parameter signature */ - "glFragmentLightModelivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix4x3fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix4x3fv\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char PrioritizeTextures_names[] = - "ipp\0" /* Parameter signature */ - "glPrioritizeTextures\0" - "glPrioritizeTexturesEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char AsyncMarkerSGIX_names[] = - "i\0" /* Parameter signature */ - "glAsyncMarkerSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorubSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorubSUN\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char ClearDebugLogMESA_names[] = - "iii\0" /* Parameter signature */ - "glClearDebugLogMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char ResetHistogram_names[] = - "i\0" /* Parameter signature */ - "glResetHistogram\0" - "glResetHistogramEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char GetProgramNamedParameterfvNV_names[] = - "iipp\0" /* Parameter signature */ - "glGetProgramNamedParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_point_parameters) || defined(need_GL_EXT_point_parameters) || defined(need_GL_SGIS_point_parameters) -static const char PointParameterfEXT_names[] = - "if\0" /* Parameter signature */ - "glPointParameterf\0" - "glPointParameterfARB\0" - "glPointParameterfEXT\0" - "glPointParameterfSGIS\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char LoadIdentityDeformationMapSGIX_names[] = - "i\0" /* Parameter signature */ - "glLoadIdentityDeformationMapSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char GenFencesNV_names[] = - "ip\0" /* Parameter signature */ - "glGenFencesNV\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameterfHP_names[] = - "iif\0" /* Parameter signature */ - "glImageTransformParameterfHP\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexusvARB_names[] = - "ip\0" /* Parameter signature */ - "glMatrixIndexusvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char DisableVertexAttribArrayARB_names[] = - "i\0" /* Parameter signature */ - "glDisableVertexAttribArray\0" - "glDisableVertexAttribArrayARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char StencilMaskSeparate_names[] = - "ii\0" /* Parameter signature */ - "glStencilMaskSeparate\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4dARB_names[] = - "iidddd\0" /* Parameter signature */ - "glProgramLocalParameter4dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexImage3DARB_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glCompressedTexImage3D\0" - "glCompressedTexImage3DARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetConvolutionParameteriv\0" - "glGetConvolutionParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1fARB_names[] = - "if\0" /* Parameter signature */ - "glVertexAttrib1f\0" - "glVertexAttrib1fARB\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char TestFenceNV_names[] = - "i\0" /* Parameter signature */ - "glTestFenceNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1fv\0" - "glMultiTexCoord1fvARB\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp2ATI_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glColorFragmentOp2ATI\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char SecondaryColorPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glSecondaryColorPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char GetPixelTexGenParameterivSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetPixelTexGenParameterivSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4fNV_names[] = - "iffff\0" /* Parameter signature */ - "glVertexAttrib4fNV\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeubSUN_names[] = - "i\0" /* Parameter signature */ - "glReplacementCodeubSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char FinishAsyncSGIX_names[] = - "p\0" /* Parameter signature */ - "glFinishAsyncSGIX\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char GetDebugLogMESA_names[] = - "iiiipp\0" /* Parameter signature */ - "glGetDebugLogMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoorddEXT_names[] = - "d\0" /* Parameter signature */ - "glFogCoordd\0" - "glFogCoorddEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex3fSUN_names[] = - "iiiifff\0" /* Parameter signature */ - "glColor4ubVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoordfEXT_names[] = - "f\0" /* Parameter signature */ - "glFogCoordf\0" - "glFogCoordfEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fVertex3fSUN_names[] = - "fffff\0" /* Parameter signature */ - "glTexCoord2fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactoriSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactoriSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2dNV_names[] = - "idd\0" /* Parameter signature */ - "glVertexAttrib2dNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetProgramInfoLog_names[] = - "iipp\0" /* Parameter signature */ - "glGetProgramInfoLog\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NbvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nbv\0" - "glVertexAttrib4NbvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) -static const char GetActiveAttribARB_names[] = - "iiipppp\0" /* Parameter signature */ - "glGetActiveAttrib\0" - "glGetActiveAttribARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4ubNV_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4ubNV\0" - ""; -#endif - -#if defined(need_GL_APPLE_texture_range) -static const char TextureRangeAPPLE_names[] = - "iip\0" /* Parameter signature */ - "glTextureRangeAPPLE\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4fNormal3fVertex3fSUN_names[] = - "ffffffffffff\0" /* Parameter signature */ - "glTexCoord2fColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameterfvNV_names[] = - "ip\0" /* Parameter signature */ - "glCombinerParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs3dvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4fvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_array_range) -static const char VertexArrayRangeNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexArrayRangeNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightiSGIX_names[] = - "iii\0" /* Parameter signature */ - "glFragmentLightiSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_polygon_offset) -static const char PolygonOffsetEXT_names[] = - "ff\0" /* Parameter signature */ - "glPolygonOffsetEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char PollAsyncSGIX_names[] = - "p\0" /* Parameter signature */ - "glPollAsyncSGIX\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char DeleteFragmentShaderATI_names[] = - "i\0" /* Parameter signature */ - "glDeleteFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glTexCoord2fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char MultTransposeMatrixdARB_names[] = - "p\0" /* Parameter signature */ - "glMultTransposeMatrixd\0" - "glMultTransposeMatrixdARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2svMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2sv\0" - "glWindowPos2svARB\0" - "glWindowPos2svMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexImage1DARB_names[] = - "iiiiiip\0" /* Parameter signature */ - "glCompressedTexImage1D\0" - "glCompressedTexImage1DARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2sNV_names[] = - "iii\0" /* Parameter signature */ - "glVertexAttrib2sNV\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char NormalPointerListIBM_names[] = - "iipi\0" /* Parameter signature */ - "glNormalPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char IndexPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glIndexPointerEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char NormalPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glNormalPointerEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3dARB_names[] = - "iddd\0" /* Parameter signature */ - "glMultiTexCoord3d\0" - "glMultiTexCoord3dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2iARB_names[] = - "iii\0" /* Parameter signature */ - "glMultiTexCoord2i\0" - "glMultiTexCoord2iARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names[] = - "iffffffff\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2sv\0" - "glMultiTexCoord2svARB\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeubvSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeubvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3iARB_names[] = - "iiii\0" /* Parameter signature */ - "glUniform3i\0" - "glUniform3iARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentMaterialfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentMaterialfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetShaderInfoLog_names[] = - "iipp\0" /* Parameter signature */ - "glGetShaderInfoLog\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightivARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightivARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char PollInstrumentsSGIX_names[] = - "p\0" /* Parameter signature */ - "glPollInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactordSUN_names[] = - "d\0" /* Parameter signature */ - "glGlobalAlphaFactordSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs3fvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GenerateMipmapEXT_names[] = - "i\0" /* Parameter signature */ - "glGenerateMipmap\0" - "glGenerateMipmapEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char SetFragmentShaderConstantATI_names[] = - "ip\0" /* Parameter signature */ - "glSetFragmentShaderConstantATI\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapAttribParameterivNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetMapAttribParameterivNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char CreateShaderObjectARB_names[] = - "i\0" /* Parameter signature */ - "glCreateShaderObjectARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_sharpen_texture) -static const char GetSharpenTexFuncSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetSharpenTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char BufferDataARB_names[] = - "iipi\0" /* Parameter signature */ - "glBufferData\0" - "glBufferDataARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_array_range) -static const char FlushVertexArrayRangeNV_names[] = - "\0" /* Parameter signature */ - "glFlushVertexArrayRangeNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char SampleMapATI_names[] = - "iii\0" /* Parameter signature */ - "glSampleMapATI\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char VertexPointerEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glVertexPointerEXT\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture_filter4) -static const char GetTexFilterFuncSGIS_names[] = - "iip\0" /* Parameter signature */ - "glGetTexFilterFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerOutputParameterfvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetCombinerOutputParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_subtexture) -static const char TexSubImage1D_names[] = - "iiiiiip\0" /* Parameter signature */ - "glTexSubImage1D\0" - "glTexSubImage1DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1sARB_names[] = - "ii\0" /* Parameter signature */ - "glVertexAttrib1s\0" - "glVertexAttrib1sARB\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char FenceSync_names[] = - "ii\0" /* Parameter signature */ - "glFenceSync\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char FinalCombinerInputNV_names[] = - "iiii\0" /* Parameter signature */ - "glFinalCombinerInputNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_flush_raster) -static const char FlushRasterSGIX_names[] = - "\0" /* Parameter signature */ - "glFlushRasterSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fVertex3fSUN_names[] = - "ifffff\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1fARB_names[] = - "if\0" /* Parameter signature */ - "glUniform1f\0" - "glUniform1fARB\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char AreTexturesResident_names[] = - "ipp\0" /* Parameter signature */ - "glAreTexturesResident\0" - "glAreTexturesResidentEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ATI_separate_stencil) -static const char StencilOpSeparate_names[] = - "iiii\0" /* Parameter signature */ - "glStencilOpSeparate\0" - "glStencilOpSeparateATI\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) -static const char ColorTableParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glColorTableParameteriv\0" - "glColorTableParameterivSGI\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char FogCoordPointerListIBM_names[] = - "iipi\0" /* Parameter signature */ - "glFogCoordPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3dMESA_names[] = - "ddd\0" /* Parameter signature */ - "glWindowPos3d\0" - "glWindowPos3dARB\0" - "glWindowPos3dMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_point_parameters) || defined(need_GL_EXT_point_parameters) || defined(need_GL_SGIS_point_parameters) -static const char PointParameterfvEXT_names[] = - "ip\0" /* Parameter signature */ - "glPointParameterfv\0" - "glPointParameterfvARB\0" - "glPointParameterfvEXT\0" - "glPointParameterfvSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2fvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2fv\0" - "glWindowPos2fvARB\0" - "glWindowPos2fvMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3bvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3bv\0" - "glSecondaryColor3bvEXT\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char VertexPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glVertexPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramLocalParameterfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramLocalParameterfvARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialfSGIX_names[] = - "iif\0" /* Parameter signature */ - "glFragmentMaterialfSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fNormal3fVertex3fSUN_names[] = - "ffffffff\0" /* Parameter signature */ - "glTexCoord2fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char RenderbufferStorageEXT_names[] = - "iiii\0" /* Parameter signature */ - "glRenderbufferStorage\0" - "glRenderbufferStorageEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char IsFenceNV_names[] = - "i\0" /* Parameter signature */ - "glIsFenceNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char AttachObjectARB_names[] = - "ii\0" /* Parameter signature */ - "glAttachObjectARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentLightivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentLightivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UniformMatrix2fvARB_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix2fv\0" - "glUniformMatrix2fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2fARB_names[] = - "iff\0" /* Parameter signature */ - "glMultiTexCoord2f\0" - "glMultiTexCoord2fARB\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char ColorTable_names[] = - "iiiiip\0" /* Parameter signature */ - "glColorTable\0" - "glColorTableSGI\0" - "glColorTableEXT\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char MapControlPointsNV_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glMapControlPointsNV\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionFilter2D_names[] = - "iiiiiip\0" /* Parameter signature */ - "glConvolutionFilter2D\0" - "glConvolutionFilter2DEXT\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char MapParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glMapParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3dv\0" - "glVertexAttrib3dvARB\0" - ""; -#endif - -#if defined(need_GL_PGI_misc_hints) -static const char HintPGI_names[] = - "ii\0" /* Parameter signature */ - "glHintPGI\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glConvolutionParameteriv\0" - "glConvolutionParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_cull_vertex) -static const char CullParameterdvEXT_names[] = - "ip\0" /* Parameter signature */ - "glCullParameterdvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4fNV_names[] = - "iipffff\0" /* Parameter signature */ - "glProgramNamedParameter4fNV\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color3fVertex3fSUN_names[] = - "ffffff\0" /* Parameter signature */ - "glColor3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4fvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramEnvParameter4fvARB\0" - "glProgramParameter4fvNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModeliSGIX_names[] = - "ii\0" /* Parameter signature */ - "glFragmentLightModeliSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glConvolutionParameterfv\0" - "glConvolutionParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_3DFX_tbuffer) -static const char TbufferMask3DFX_names[] = - "i\0" /* Parameter signature */ - "glTbufferMask3DFX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char LoadProgramNV_names[] = - "iiip\0" /* Parameter signature */ - "glLoadProgramNV\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char WaitSync_names[] = - "iii\0" /* Parameter signature */ - "glWaitSync\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4fvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetAttachedObjectsARB_names[] = - "iipp\0" /* Parameter signature */ - "glGetAttachedObjectsARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform3fv\0" - "glUniform3fvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_draw_range_elements) -static const char DrawRangeElements_names[] = - "iiiiip\0" /* Parameter signature */ - "glDrawRangeElements\0" - "glDrawRangeElementsEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameterfvSGIX_names[] = - "ip\0" /* Parameter signature */ - "glSpriteParameterfvSGIX\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char CheckFramebufferStatusEXT_names[] = - "i\0" /* Parameter signature */ - "glCheckFramebufferStatus\0" - "glCheckFramebufferStatusEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactoruiSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactoruiSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetHandleARB_names[] = - "i\0" /* Parameter signature */ - "glGetHandleARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char GetVertexAttribivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribiv\0" - "glGetVertexAttribivARB\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerInputParameterfvNV_names[] = - "iiiip\0" /* Parameter signature */ - "glGetCombinerInputParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char CreateProgram_names[] = - "\0" /* Parameter signature */ - "glCreateProgram\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char LoadTransposeMatrixdARB_names[] = - "p\0" /* Parameter signature */ - "glLoadTransposeMatrixd\0" - "glLoadTransposeMatrixdARB\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmax_names[] = - "iiiip\0" /* Parameter signature */ - "glGetMinmax\0" - "glGetMinmaxEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char StencilFuncSeparate_names[] = - "iiii\0" /* Parameter signature */ - "glStencilFuncSeparate\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3sEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3s\0" - "glSecondaryColor3sEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color3fVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glColor3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorbSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorbSUN\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameterfvHP_names[] = - "iip\0" /* Parameter signature */ - "glImageTransformParameterfvHP\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4ivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4iv\0" - "glVertexAttrib4ivARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3fNV_names[] = - "ifff\0" /* Parameter signature */ - "glVertexAttrib3fNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs2dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs2dvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_timer_query) -static const char GetQueryObjectui64vEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjectui64vEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3fv\0" - "glMultiTexCoord3fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3dEXT_names[] = - "ddd\0" /* Parameter signature */ - "glSecondaryColor3d\0" - "glSecondaryColor3dEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramParameterfvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetProgramParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char TangentPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glTangentPointerEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4fNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char GetInstrumentsSGIX_names[] = - "\0" /* Parameter signature */ - "glGetInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char EvalMapsNV_names[] = - "ii\0" /* Parameter signature */ - "glEvalMapsNV\0" - ""; -#endif - -#if defined(need_GL_EXT_subtexture) -static const char TexSubImage2D_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glTexSubImage2D\0" - "glTexSubImage2DEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentLightivSGIX\0" - ""; -#endif - -#if defined(need_GL_APPLE_texture_range) -static const char GetTexParameterPointervAPPLE_names[] = - "iip\0" /* Parameter signature */ - "glGetTexParameterPointervAPPLE\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterfvEXT_names[] = - "iip\0" /* Parameter signature */ - "glPixelTransformParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4bvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4bv\0" - "glVertexAttrib4bvARB\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char AlphaFragmentOp2ATI_names[] = - "iiiiiiiii\0" /* Parameter signature */ - "glAlphaFragmentOp2ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4sARB_names[] = - "iiiii\0" /* Parameter signature */ - "glMultiTexCoord4s\0" - "glMultiTexCoord4sARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentMaterialivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentMaterialivSGIX\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4dMESA_names[] = - "dddd\0" /* Parameter signature */ - "glWindowPos4dMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightPointerARB_names[] = - "iiip\0" /* Parameter signature */ - "glWeightPointerARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2dMESA_names[] = - "dd\0" /* Parameter signature */ - "glWindowPos2d\0" - "glWindowPos2dARB\0" - "glWindowPos2dMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture3DEXT_names[] = - "iiiiii\0" /* Parameter signature */ - "glFramebufferTexture3D\0" - "glFramebufferTexture3DEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_blend_minmax) -static const char BlendEquation_names[] = - "i\0" /* Parameter signature */ - "glBlendEquation\0" - "glBlendEquationEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3dNV_names[] = - "iddd\0" /* Parameter signature */ - "glVertexAttrib3dNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3dARB_names[] = - "iddd\0" /* Parameter signature */ - "glVertexAttrib3d\0" - "glVertexAttrib3dARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names[] = - "ppppp\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4fARB_names[] = - "iffff\0" /* Parameter signature */ - "glVertexAttrib4f\0" - "glVertexAttrib4fARB\0" - ""; -#endif - -#if defined(need_GL_EXT_index_func) -static const char IndexFuncEXT_names[] = - "if\0" /* Parameter signature */ - "glIndexFuncEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture2DEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTexture2D\0" - "glFramebufferTexture2DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2dv\0" - "glMultiTexCoord2dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_cull_vertex) -static const char CullParameterfvEXT_names[] = - "ip\0" /* Parameter signature */ - "glCullParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4fvNV_names[] = - "iipp\0" /* Parameter signature */ - "glProgramNamedParameter4fvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColorPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glSecondaryColorPointer\0" - "glSecondaryColorPointerEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4fv\0" - "glVertexAttrib4fvARB\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char ColorPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glColorPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetActiveUniformARB_names[] = - "iiipppp\0" /* Parameter signature */ - "glGetActiveUniform\0" - "glGetActiveUniformARB\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameteriHP_names[] = - "iii\0" /* Parameter signature */ - "glImageTransformParameteriHP\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1sv\0" - "glMultiTexCoord1svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char EndQueryARB_names[] = - "i\0" /* Parameter signature */ - "glEndQuery\0" - "glEndQueryARB\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char DeleteFencesNV_names[] = - "ip\0" /* Parameter signature */ - "glDeleteFencesNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformationMap3dSGIX_names[] = - "iddiiddiiddiip\0" /* Parameter signature */ - "glDeformationMap3dSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char IsShader_names[] = - "i\0" /* Parameter signature */ - "glIsShader\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char GetImageTransformParameterivHP_names[] = - "iip\0" /* Parameter signature */ - "glGetImageTransformParameterivHP\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4ivMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4ivMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3sv\0" - "glMultiTexCoord3svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4iARB_names[] = - "iiiii\0" /* Parameter signature */ - "glMultiTexCoord4i\0" - "glMultiTexCoord4iARB\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3ivEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3ivEXT\0" - ""; -#endif - -#if defined(need_GL_MESA_resize_buffers) -static const char ResizeBuffersMESA_names[] = - "\0" /* Parameter signature */ - "glResizeBuffersMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetUniformivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetUniformiv\0" - "glGetUniformivARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameteriSGIS_names[] = - "ii\0" /* Parameter signature */ - "glPixelTexGenParameteriSGIS\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char VertexPointervINTEL_names[] = - "iip\0" /* Parameter signature */ - "glVertexPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3uiEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3ui\0" - "glSecondaryColor3uiEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char StartInstrumentsSGIX_names[] = - "\0" /* Parameter signature */ - "glStartInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3usvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3usv\0" - "glSecondaryColor3usvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2fvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4dvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramLocalParameter4dvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexuivARB_names[] = - "ip\0" /* Parameter signature */ - "glMatrixIndexuivARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) -static const char RenderbufferStorageMultisample_names[] = - "iiiii\0" /* Parameter signature */ - "glRenderbufferStorageMultisample\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3sEXT_names[] = - "iii\0" /* Parameter signature */ - "glTangent3sEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorfSUN_names[] = - "f\0" /* Parameter signature */ - "glGlobalAlphaFactorfSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3iARB_names[] = - "iiii\0" /* Parameter signature */ - "glMultiTexCoord3i\0" - "glMultiTexCoord3iARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char IsProgram_names[] = - "i\0" /* Parameter signature */ - "glIsProgram\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char TexCoordPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glTexCoordPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorusSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorusSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2dvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferRenderbufferEXT_names[] = - "iiii\0" /* Parameter signature */ - "glFramebufferRenderbuffer\0" - "glFramebufferRenderbufferEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1dvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char GenTextures_names[] = - "ip\0" /* Parameter signature */ - "glGenTextures\0" - "glGenTexturesEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char SetFenceNV_names[] = - "ii\0" /* Parameter signature */ - "glSetFenceNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture1DEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTexture1D\0" - "glFramebufferTexture1DEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerOutputParameterivNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetCombinerOutputParameterivNV\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameterivSGIS_names[] = - "ip\0" /* Parameter signature */ - "glPixelTexGenParameterivSGIS\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_perturb_normal) -static const char TextureNormalEXT_names[] = - "i\0" /* Parameter signature */ - "glTextureNormalEXT\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char IndexPointerListIBM_names[] = - "iipi\0" /* Parameter signature */ - "glIndexPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightfvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightfvARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4fMESA_names[] = - "ffff\0" /* Parameter signature */ - "glWindowPos4fMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3dvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3dv\0" - "glWindowPos3dvARB\0" - "glWindowPos3dvMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_timer_query) -static const char GetQueryObjecti64vEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjecti64vEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1dARB_names[] = - "id\0" /* Parameter signature */ - "glMultiTexCoord1d\0" - "glMultiTexCoord1dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_NV_point_sprite) -static const char PointParameterivNV_names[] = - "ip\0" /* Parameter signature */ - "glPointParameteriv\0" - "glPointParameterivNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform2fv\0" - "glUniform2fvARB\0" - ""; -#endif - -#if defined(need_GL_APPLE_flush_buffer_range) -static const char BufferParameteriAPPLE_names[] = - "iii\0" /* Parameter signature */ - "glBufferParameteriAPPLE\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3dv\0" - "glMultiTexCoord3dvARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char DeleteObjectARB_names[] = - "i\0" /* Parameter signature */ - "glDeleteObjectARB\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexPointerARB_names[] = - "iiip\0" /* Parameter signature */ - "glMatrixIndexPointerARB\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4dvNV_names[] = - "iipp\0" /* Parameter signature */ - "glProgramNamedParameter4dvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3fvEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) -static const char GenVertexArrays_names[] = - "ip\0" /* Parameter signature */ - "glGenVertexArrays\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char BindFramebufferEXT_names[] = - "ii\0" /* Parameter signature */ - "glBindFramebuffer\0" - "glBindFramebufferEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_reference_plane) -static const char ReferencePlaneSGIX_names[] = - "p\0" /* Parameter signature */ - "glReferencePlaneSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char ValidateProgramARB_names[] = - "i\0" /* Parameter signature */ - "glValidateProgram\0" - "glValidateProgramARB\0" - ""; -#endif - -#if defined(need_GL_EXT_compiled_vertex_array) -static const char UnlockArraysEXT_names[] = - "\0" /* Parameter signature */ - "glUnlockArraysEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor3fVertex3fSUN_names[] = - "ffffffff\0" /* Parameter signature */ - "glTexCoord2fColor3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3fvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3fv\0" - "glWindowPos3fvARB\0" - "glWindowPos3fvMESA\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1svNV\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexSubImage3D_names[] = - "iiiiiiiii\0" /* Parameter signature */ - "glCopyTexSubImage3D\0" - "glCopyTexSubImage3DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2dARB_names[] = - "idd\0" /* Parameter signature */ - "glVertexAttrib2d\0" - "glVertexAttrib2dARB\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char GetInteger64v_names[] = - "ip\0" /* Parameter signature */ - "glGetInteger64v\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture_color_mask) -static const char TextureColorMaskSGIS_names[] = - "iiii\0" /* Parameter signature */ - "glTextureColorMaskSGIS\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTable_names[] = - "iiip\0" /* Parameter signature */ - "glGetColorTable\0" - "glGetColorTableSGI\0" - "glGetColorTableEXT\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) -static const char CopyColorTable_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyColorTable\0" - "glCopyColorTableSGI\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetHistogramParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetHistogramParameterfv\0" - "glGetHistogramParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char ColorPointervINTEL_names[] = - "iip\0" /* Parameter signature */ - "glColorPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char AlphaFragmentOp1ATI_names[] = - "iiiiii\0" /* Parameter signature */ - "glAlphaFragmentOp1ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3iv\0" - "glMultiTexCoord3ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2sARB_names[] = - "iii\0" /* Parameter signature */ - "glMultiTexCoord2s\0" - "glMultiTexCoord2sARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1dv\0" - "glVertexAttrib1dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char DeleteTextures_names[] = - "ip\0" /* Parameter signature */ - "glDeleteTextures\0" - "glDeleteTexturesEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char TexCoordPointerEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glTexCoordPointerEXT\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture4D) -static const char TexSubImage4DSGIS_names[] = - "iiiiiiiiiiiip\0" /* Parameter signature */ - "glTexSubImage4DSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners2) -static const char CombinerStageParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glCombinerStageParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char StopInstrumentsSGIX_names[] = - "i\0" /* Parameter signature */ - "glStopInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fColor4fNormal3fVertex4fSUN_names[] = - "fffffffffffffff\0" /* Parameter signature */ - "glTexCoord4fColor4fNormal3fVertex4fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformSGIX_names[] = - "i\0" /* Parameter signature */ - "glDeformSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char GetVertexAttribfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribfv\0" - "glGetVertexAttribfvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3ivEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3iv\0" - "glSecondaryColor3ivEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix4x2fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix4x2fv\0" - ""; -#endif - -#if defined(need_GL_SGIS_detail_texture) -static const char GetDetailTexFuncSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetDetailTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners2) -static const char GetCombinerStageParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetCombinerStageParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) -static const char BindVertexArray_names[] = - "i\0" /* Parameter signature */ - "glBindVertexArray\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex2fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glColor4ubVertex2fvSUN\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture_filter4) -static const char TexFilterFuncSGIS_names[] = - "iiip\0" /* Parameter signature */ - "glTexFilterFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) -static const char SampleMaskSGIS_names[] = - "fi\0" /* Parameter signature */ - "glSampleMaskSGIS\0" - "glSampleMaskEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) -static const char GetAttribLocationARB_names[] = - "ip\0" /* Parameter signature */ - "glGetAttribLocation\0" - "glGetAttribLocationARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4ubvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4ubv\0" - "glVertexAttrib4ubvARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_detail_texture) -static const char DetailTexFuncSGIS_names[] = - "iip\0" /* Parameter signature */ - "glDetailTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Normal3fVertex3fSUN_names[] = - "ffffff\0" /* Parameter signature */ - "glNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexImage2D_names[] = - "iiiiiiii\0" /* Parameter signature */ - "glCopyTexImage2D\0" - "glCopyTexImage2DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GetBufferPointervARB_names[] = - "iip\0" /* Parameter signature */ - "glGetBufferPointerv\0" - "glGetBufferPointervARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4fARB_names[] = - "iiffff\0" /* Parameter signature */ - "glProgramEnvParameter4fARB\0" - "glProgramParameter4fNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform3iv\0" - "glUniform3ivARB\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char GetFenceivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFenceivNV\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4dvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4dvMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_color_subtable) -static const char ColorSubTable_names[] = - "iiiiip\0" /* Parameter signature */ - "glColorSubTable\0" - "glColorSubTableEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4iv\0" - "glMultiTexCoord4ivARB\0" - ""; -#endif - -#if defined(need_GL_EXT_gpu_program_parameters) -static const char ProgramLocalParameters4fvEXT_names[] = - "iiip\0" /* Parameter signature */ - "glProgramLocalParameters4fvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapAttribParameterfvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetMapAttribParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4sARB_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4s\0" - "glVertexAttrib4sARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GetQueryObjectuivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjectuiv\0" - "glGetQueryObjectuivARB\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char MapParameterivNV_names[] = - "iip\0" /* Parameter signature */ - "glMapParameterivNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GenRenderbuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glGenRenderbuffers\0" - "glGenRenderbuffersEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2dv\0" - "glVertexAttrib2dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char EdgeFlagPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glEdgeFlagPointerEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs2svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs2svNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightbvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightbvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2fv\0" - "glVertexAttrib2fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GetBufferParameterivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetBufferParameteriv\0" - "glGetBufferParameterivARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameteriSGIX_names[] = - "iii\0" /* Parameter signature */ - "glListParameteriSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4fNormal3fVertex3fSUN_names[] = - "iffffffffff\0" /* Parameter signature */ - "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char InstrumentsBufferSGIX_names[] = - "ip\0" /* Parameter signature */ - "glInstrumentsBufferSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Niv\0" - "glVertexAttrib4NivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetAttachedShaders_names[] = - "iipp\0" /* Parameter signature */ - "glGetAttachedShaders\0" - ""; -#endif - -#if defined(need_GL_APPLE_vertex_array_object) -static const char GenVertexArraysAPPLE_names[] = - "ip\0" /* Parameter signature */ - "glGenVertexArraysAPPLE\0" - ""; -#endif - -#if defined(need_GL_EXT_gpu_program_parameters) -static const char ProgramEnvParameters4fvEXT_names[] = - "iiip\0" /* Parameter signature */ - "glProgramEnvParameters4fvEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2iMESA_names[] = - "ii\0" /* Parameter signature */ - "glWindowPos2i\0" - "glWindowPos2iARB\0" - "glWindowPos2iMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3fv\0" - "glSecondaryColor3fvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexSubImage1DARB_names[] = - "iiiiiip\0" /* Parameter signature */ - "glCompressedTexSubImage1D\0" - "glCompressedTexSubImage1DARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetVertexAttribivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribivNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramStringARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramStringARB\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char TexBumpParameterfvATI_names[] = - "ip\0" /* Parameter signature */ - "glTexBumpParameterfvATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char CompileShaderARB_names[] = - "i\0" /* Parameter signature */ - "glCompileShader\0" - "glCompileShaderARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char DeleteShader_names[] = - "i\0" /* Parameter signature */ - "glDeleteShader\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glUniform3f\0" - "glUniform3fARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameterfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glListParameterfvSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3dvEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3dvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetVertexAttribfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3sMESA_names[] = - "iii\0" /* Parameter signature */ - "glWindowPos3s\0" - "glWindowPos3sARB\0" - "glWindowPos3sMESA\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2svNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs1fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs1fvNV\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glTexCoord2fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4sMESA_names[] = - "iiii\0" /* Parameter signature */ - "glWindowPos4sMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NuivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nuiv\0" - "glVertexAttrib4NuivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char ClientActiveTextureARB_names[] = - "i\0" /* Parameter signature */ - "glClientActiveTexture\0" - "glClientActiveTextureARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_pixel_texture) -static const char PixelTexGenSGIX_names[] = - "i\0" /* Parameter signature */ - "glPixelTexGenSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeusvSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeusvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4fARB_names[] = - "iffff\0" /* Parameter signature */ - "glUniform4f\0" - "glUniform4fARB\0" - ""; -#endif - -#if defined(need_GL_ARB_map_buffer_range) -static const char FlushMappedBufferRange_names[] = - "iii\0" /* Parameter signature */ - "glFlushMappedBufferRange\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char IsProgramNV_names[] = - "i\0" /* Parameter signature */ - "glIsProgramARB\0" - "glIsProgramNV\0" - ""; -#endif - -#if defined(need_GL_APPLE_flush_buffer_range) -static const char FlushMappedBufferRangeAPPLE_names[] = - "iii\0" /* Parameter signature */ - "glFlushMappedBufferRangeAPPLE\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodePointerSUN_names[] = - "iip\0" /* Parameter signature */ - "glReplacementCodePointerSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4dARB_names[] = - "iidddd\0" /* Parameter signature */ - "glProgramEnvParameter4dARB\0" - "glProgramParameter4dNV\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) -static const char ColorTableParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glColorTableParameterfv\0" - "glColorTableParameterfvSGI\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModelfSGIX_names[] = - "if\0" /* Parameter signature */ - "glFragmentLightModelfSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3bvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3bvEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char IsTexture_names[] = - "i\0" /* Parameter signature */ - "glIsTexture\0" - "glIsTextureEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const char VertexWeightfvEXT_names[] = - "p\0" /* Parameter signature */ - "glVertexWeightfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1dARB_names[] = - "id\0" /* Parameter signature */ - "glVertexAttrib1d\0" - "glVertexAttrib1dARB\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameterivHP_names[] = - "iip\0" /* Parameter signature */ - "glImageTransformParameterivHP\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char DeleteQueriesARB_names[] = - "ip\0" /* Parameter signature */ - "glDeleteQueries\0" - "glDeleteQueriesARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex2fSUN_names[] = - "iiiiff\0" /* Parameter signature */ - "glColor4ubVertex2fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentColorMaterialSGIX_names[] = - "ii\0" /* Parameter signature */ - "glFragmentColorMaterialSGIX\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char CurrentPaletteMatrixARB_names[] = - "i\0" /* Parameter signature */ - "glCurrentPaletteMatrixARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) -static const char SamplePatternSGIS_names[] = - "i\0" /* Parameter signature */ - "glSamplePatternSGIS\0" - "glSamplePatternEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char IsQueryARB_names[] = - "i\0" /* Parameter signature */ - "glIsQuery\0" - "glIsQueryARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] = - "iiiiifff\0" /* Parameter signature */ - "glReplacementCodeuiColor4ubVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4usvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4usv\0" - "glVertexAttrib4usvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char LinkProgramARB_names[] = - "i\0" /* Parameter signature */ - "glLinkProgram\0" - "glLinkProgramARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2fNV_names[] = - "iff\0" /* Parameter signature */ - "glVertexAttrib2fNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char ShaderSourceARB_names[] = - "iipp\0" /* Parameter signature */ - "glShaderSource\0" - "glShaderSourceARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialiSGIX_names[] = - "iii\0" /* Parameter signature */ - "glFragmentMaterialiSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3sv\0" - "glVertexAttrib3svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexSubImage3DARB_names[] = - "iiiiiiiiiip\0" /* Parameter signature */ - "glCompressedTexSubImage3D\0" - "glCompressedTexSubImage3DARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2ivMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2iv\0" - "glWindowPos2ivARB\0" - "glWindowPos2ivMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char IsFramebufferEXT_names[] = - "i\0" /* Parameter signature */ - "glIsFramebuffer\0" - "glIsFramebufferEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform4iv\0" - "glUniform4ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char GetVertexAttribdvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribdv\0" - "glGetVertexAttribdvARB\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char TexBumpParameterivATI_names[] = - "ip\0" /* Parameter signature */ - "glTexBumpParameterivATI\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetSeparableFilter_names[] = - "iiippp\0" /* Parameter signature */ - "glGetSeparableFilter\0" - "glGetSeparableFilterEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3dEXT_names[] = - "ddd\0" /* Parameter signature */ - "glBinormal3dEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameteriSGIX_names[] = - "ii\0" /* Parameter signature */ - "glSpriteParameteriSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char RequestResidentProgramsNV_names[] = - "ip\0" /* Parameter signature */ - "glRequestResidentProgramsNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_tag_sample_buffer) -static const char TagSampleBufferSGIX_names[] = - "\0" /* Parameter signature */ - "glTagSampleBufferSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeusSUN_names[] = - "i\0" /* Parameter signature */ - "glReplacementCodeusSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameterivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glListParameterivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_multi_draw_arrays) -static const char MultiDrawElementsEXT_names[] = - "ipipi\0" /* Parameter signature */ - "glMultiDrawElements\0" - "glMultiDrawElementsEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform1iv\0" - "glUniform1ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2sMESA_names[] = - "ii\0" /* Parameter signature */ - "glWindowPos2s\0" - "glWindowPos2sARB\0" - "glWindowPos2sMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightusvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightusvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoordPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glFogCoordPointer\0" - "glFogCoordPointerEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_index_material) -static const char IndexMaterialEXT_names[] = - "ii\0" /* Parameter signature */ - "glIndexMaterialEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3ubvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3ubv\0" - "glSecondaryColor3ubvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4dv\0" - "glVertexAttrib4dvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) -static const char BindAttribLocationARB_names[] = - "iip\0" /* Parameter signature */ - "glBindAttribLocation\0" - "glBindAttribLocationARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2dARB_names[] = - "idd\0" /* Parameter signature */ - "glMultiTexCoord2d\0" - "glMultiTexCoord2dARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char ExecuteProgramNV_names[] = - "iip\0" /* Parameter signature */ - "glExecuteProgramNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char LightEnviSGIX_names[] = - "ii\0" /* Parameter signature */ - "glLightEnviSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeuiSUN_names[] = - "i\0" /* Parameter signature */ - "glReplacementCodeuiSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribPointerNV_names[] = - "iiiip\0" /* Parameter signature */ - "glVertexAttribPointerNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GetFramebufferAttachmentParameterivEXT_names[] = - "iiip\0" /* Parameter signature */ - "glGetFramebufferAttachmentParameteriv\0" - "glGetFramebufferAttachmentParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterfEXT_names[] = - "iif\0" /* Parameter signature */ - "glPixelTransformParameterfEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4dv\0" - "glMultiTexCoord4dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameteriEXT_names[] = - "iii\0" /* Parameter signature */ - "glPixelTransformParameteriEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4ubVertex3fSUN_names[] = - "ffiiiifff\0" /* Parameter signature */ - "glTexCoord2fColor4ubVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1iARB_names[] = - "ii\0" /* Parameter signature */ - "glUniform1i\0" - "glUniform1iARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttribPointerARB_names[] = - "iiiiip\0" /* Parameter signature */ - "glVertexAttribPointer\0" - "glVertexAttribPointerARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_sharpen_texture) -static const char SharpenTexFuncSGIS_names[] = - "iip\0" /* Parameter signature */ - "glSharpenTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4fv\0" - "glMultiTexCoord4fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix2x3fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix2x3fv\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char TrackMatrixNV_names[] = - "iiii\0" /* Parameter signature */ - "glTrackMatrixNV\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameteriNV_names[] = - "ii\0" /* Parameter signature */ - "glCombinerParameteriNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char DeleteAsyncMarkersSGIX_names[] = - "ii\0" /* Parameter signature */ - "glDeleteAsyncMarkersSGIX\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char IsAsyncMarkerSGIX_names[] = - "i\0" /* Parameter signature */ - "glIsAsyncMarkerSGIX\0" - ""; -#endif - -#if defined(need_GL_SGIX_framezoom) -static const char FrameZoomSGIX_names[] = - "i\0" /* Parameter signature */ - "glFrameZoomSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Normal3fVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NsvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nsv\0" - "glVertexAttrib4NsvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3fv\0" - "glVertexAttrib3fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char GetSynciv_names[] = - "iiipp\0" /* Parameter signature */ - "glGetSynciv\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char DeleteFramebuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glDeleteFramebuffers\0" - "glDeleteFramebuffersEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorsSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorsSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_texture3D) -static const char TexSubImage3D_names[] = - "iiiiiiiiiip\0" /* Parameter signature */ - "glTexSubImage3D\0" - "glTexSubImage3DEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glTangent3fEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3uivEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3uiv\0" - "glSecondaryColor3uivEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexubvARB_names[] = - "ip\0" /* Parameter signature */ - "glMatrixIndexubvARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4fNormal3fVertex3fSUN_names[] = - "ffffffffff\0" /* Parameter signature */ - "glColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameterfSGIS_names[] = - "if\0" /* Parameter signature */ - "glPixelTexGenParameterfSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char CreateShader_names[] = - "i\0" /* Parameter signature */ - "glCreateShader\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetColorTableParameterfv\0" - "glGetColorTableParameterfvSGI\0" - "glGetColorTableParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModelfvSGIX_names[] = - "ip\0" /* Parameter signature */ - "glFragmentLightModelfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glMultiTexCoord3f\0" - "glMultiTexCoord3fARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char GetPixelTexGenParameterfvSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetPixelTexGenParameterfvSGIS\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GenFramebuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glGenFramebuffers\0" - "glGenFramebuffersEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramParameterdvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetProgramParameterdvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) || defined(need_GL_APPLE_vertex_array_object) -static const char IsVertexArrayAPPLE_names[] = - "i\0" /* Parameter signature */ - "glIsVertexArray\0" - "glIsVertexArrayAPPLE\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentLightfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char DetachShader_names[] = - "ii\0" /* Parameter signature */ - "glDetachShader\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NubARB_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4Nub\0" - "glVertexAttrib4NubARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramEnvParameterfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramEnvParameterfvARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetTrackMatrixivNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetTrackMatrixivNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3svNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform4fv\0" - "glUniform4fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char MultTransposeMatrixfARB_names[] = - "p\0" /* Parameter signature */ - "glMultTransposeMatrixf\0" - "glMultTransposeMatrixfARB\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp1ATI_names[] = - "iiiiiii\0" /* Parameter signature */ - "glColorFragmentOp1ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetUniformfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetUniformfv\0" - "glGetUniformfvARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names[] = - "iffffffffffff\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char DetachObjectARB_names[] = - "ii\0" /* Parameter signature */ - "glDetachObjectARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char VertexBlendARB_names[] = - "i\0" /* Parameter signature */ - "glVertexBlendARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3iMESA_names[] = - "iii\0" /* Parameter signature */ - "glWindowPos3i\0" - "glWindowPos3iARB\0" - "glWindowPos3iMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char SeparableFilter2D_names[] = - "iiiiiipp\0" /* Parameter signature */ - "glSeparableFilter2D\0" - "glSeparableFilter2DEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4ubVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiColor4ubVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexImage2DARB_names[] = - "iiiiiiip\0" /* Parameter signature */ - "glCompressedTexImage2D\0" - "glCompressedTexImage2DARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char ArrayElement_names[] = - "i\0" /* Parameter signature */ - "glArrayElement\0" - "glArrayElementEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_depth_bounds_test) -static const char DepthBoundsEXT_names[] = - "dd\0" /* Parameter signature */ - "glDepthBoundsEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char ProgramParameters4fvNV_names[] = - "iiip\0" /* Parameter signature */ - "glProgramParameters4fvNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformationMap3fSGIX_names[] = - "iffiiffiiffiip\0" /* Parameter signature */ - "glDeformationMap3fSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramivNV\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetMinmaxParameteriv\0" - "glGetMinmaxParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexImage1D_names[] = - "iiiiiii\0" /* Parameter signature */ - "glCopyTexImage1D\0" - "glCopyTexImage1DEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char AlphaFragmentOp3ATI_names[] = - "iiiiiiiiiiii\0" /* Parameter signature */ - "glAlphaFragmentOp3ATI\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetVertexAttribdvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribdvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3fvNV\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetFinalCombinerInputParameterivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFinalCombinerInputParameterivNV\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapParameterivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetMapParameterivNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4iARB_names[] = - "iiiii\0" /* Parameter signature */ - "glUniform4i\0" - "glUniform4iARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameteri_names[] = - "iii\0" /* Parameter signature */ - "glConvolutionParameteri\0" - "glConvolutionParameteriEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3sEXT_names[] = - "iii\0" /* Parameter signature */ - "glBinormal3sEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameterf_names[] = - "iif\0" /* Parameter signature */ - "glConvolutionParameterf\0" - "glConvolutionParameterfEXT\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetColorTableParameteriv\0" - "glGetColorTableParameterivSGI\0" - "glGetColorTableParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4dvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramEnvParameter4dvARB\0" - "glProgramParameter4dvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs2fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs2fvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UseProgramObjectARB_names[] = - "i\0" /* Parameter signature */ - "glUseProgram\0" - "glUseProgramObjectARB\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetMapParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char PassTexCoordATI_names[] = - "iii\0" /* Parameter signature */ - "glPassTexCoordATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char DeleteProgram_names[] = - "i\0" /* Parameter signature */ - "glDeleteProgram\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3ivEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3ivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3dEXT_names[] = - "ddd\0" /* Parameter signature */ - "glTangent3dEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3dvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3dv\0" - "glSecondaryColor3dvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_multi_draw_arrays) -static const char MultiDrawArraysEXT_names[] = - "ippi\0" /* Parameter signature */ - "glMultiDrawArrays\0" - "glMultiDrawArraysEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char BindRenderbufferEXT_names[] = - "ii\0" /* Parameter signature */ - "glBindRenderbuffer\0" - "glBindRenderbufferEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4dARB_names[] = - "idddd\0" /* Parameter signature */ - "glMultiTexCoord4d\0" - "glMultiTexCoord4dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3usEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3us\0" - "glSecondaryColor3usEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4fvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramLocalParameter4fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char DeleteProgramsNV_names[] = - "ip\0" /* Parameter signature */ - "glDeleteProgramsARB\0" - "glDeleteProgramsNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1sARB_names[] = - "ii\0" /* Parameter signature */ - "glMultiTexCoord1s\0" - "glMultiTexCoord1sARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor3fVertex3fSUN_names[] = - "iffffff\0" /* Parameter signature */ - "glReplacementCodeuiColor3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char GetVertexAttribPointervNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribPointerv\0" - "glGetVertexAttribPointervARB\0" - "glGetVertexAttribPointervNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1dv\0" - "glMultiTexCoord1dvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2iARB_names[] = - "iii\0" /* Parameter signature */ - "glUniform2i\0" - "glUniform2iARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramStringNV_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramStringNV\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char ColorPointerEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glColorPointerEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char MapBufferARB_names[] = - "ii\0" /* Parameter signature */ - "glMapBuffer\0" - "glMapBufferARB\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3svEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3svEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_light_texture) -static const char ApplyTextureEXT_names[] = - "i\0" /* Parameter signature */ - "glApplyTextureEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_light_texture) -static const char TextureMaterialEXT_names[] = - "ii\0" /* Parameter signature */ - "glTextureMaterialEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_light_texture) -static const char TextureLightEXT_names[] = - "i\0" /* Parameter signature */ - "glTextureLightEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char ResetMinmax_names[] = - "i\0" /* Parameter signature */ - "glResetMinmax\0" - "glResetMinmaxEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameterfSGIX_names[] = - "if\0" /* Parameter signature */ - "glSpriteParameterfSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4sNV_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4sNV\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetConvolutionParameterfv\0" - "glGetConvolutionParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4dvNV\0" - ""; -#endif - -#if defined(need_GL_IBM_multimode_draw_arrays) -static const char MultiModeDrawArraysIBM_names[] = - "pppii\0" /* Parameter signature */ - "glMultiModeDrawArraysIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4dARB_names[] = - "idddd\0" /* Parameter signature */ - "glVertexAttrib4d\0" - "glVertexAttrib4dARB\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char GetTexBumpParameterfvATI_names[] = - "ip\0" /* Parameter signature */ - "glGetTexBumpParameterfvATI\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4dNV_names[] = - "iipdddd\0" /* Parameter signature */ - "glProgramNamedParameter4dNV\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const char VertexWeightfEXT_names[] = - "f\0" /* Parameter signature */ - "glVertexWeightfEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glBinormal3fEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoordfvEXT_names[] = - "p\0" /* Parameter signature */ - "glFogCoordfv\0" - "glFogCoordfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1iv\0" - "glMultiTexCoord1ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3ubEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3ub\0" - "glSecondaryColor3ubEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2iv\0" - "glMultiTexCoord2ivARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_fog_function) -static const char FogFuncSGIS_names[] = - "ip\0" /* Parameter signature */ - "glFogFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexSubImage2D_names[] = - "iiiiiiii\0" /* Parameter signature */ - "glCopyTexSubImage2D\0" - "glCopyTexSubImage2DEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetObjectParameterivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetObjectParameterivARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fVertex4fSUN_names[] = - "ffffffff\0" /* Parameter signature */ - "glTexCoord4fVertex4fSUN\0" - ""; -#endif - -#if defined(need_GL_APPLE_vertex_array_object) -static const char BindVertexArrayAPPLE_names[] = - "i\0" /* Parameter signature */ - "glBindVertexArrayAPPLE\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramLocalParameterdvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramLocalParameterdvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetHistogramParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetHistogramParameteriv\0" - "glGetHistogramParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1iARB_names[] = - "ii\0" /* Parameter signature */ - "glMultiTexCoord1i\0" - "glMultiTexCoord1iARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionFilter_names[] = - "iiip\0" /* Parameter signature */ - "glGetConvolutionFilter\0" - "glGetConvolutionFilterEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_blend_func_separate) || defined(need_GL_INGR_blend_func_separate) -static const char BlendFuncSeparateEXT_names[] = - "iiii\0" /* Parameter signature */ - "glBlendFuncSeparate\0" - "glBlendFuncSeparateEXT\0" - "glBlendFuncSeparateINGR\0" - ""; -#endif - -#if defined(need_GL_ARB_map_buffer_range) -static const char MapBufferRange_names[] = - "iiii\0" /* Parameter signature */ - "glMapBufferRange\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char ProgramParameters4dvNV_names[] = - "iiip\0" /* Parameter signature */ - "glProgramParameters4dvNV\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glTexCoord2fColor3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3dvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3dvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char FinishFenceNV_names[] = - "i\0" /* Parameter signature */ - "glFinishFenceNV\0" - ""; -#endif - -#if defined(need_GL_SGIS_fog_function) -static const char GetFogFuncSGIS_names[] = - "p\0" /* Parameter signature */ - "glGetFogFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetUniformLocationARB_names[] = - "ip\0" /* Parameter signature */ - "glGetUniformLocation\0" - "glGetUniformLocationARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glSecondaryColor3f\0" - "glSecondaryColor3fEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerInputNV_names[] = - "iiiiii\0" /* Parameter signature */ - "glCombinerInputNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3sARB_names[] = - "iiii\0" /* Parameter signature */ - "glVertexAttrib3s\0" - "glVertexAttrib3sARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramStringARB_names[] = - "iiip\0" /* Parameter signature */ - "glProgramStringARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fVertex4fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glTexCoord4fVertex4fvSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3sNV_names[] = - "iiii\0" /* Parameter signature */ - "glVertexAttrib3sNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1fNV_names[] = - "if\0" /* Parameter signature */ - "glVertexAttrib1fNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightfSGIX_names[] = - "iif\0" /* Parameter signature */ - "glFragmentLightfSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char GetCompressedTexImageARB_names[] = - "iip\0" /* Parameter signature */ - "glGetCompressedTexImage\0" - "glGetCompressedTexImageARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const char VertexWeightPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glVertexWeightPointerEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetHistogram_names[] = - "iiiip\0" /* Parameter signature */ - "glGetHistogram\0" - "glGetHistogramEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_stencil_two_side) -static const char ActiveStencilFaceEXT_names[] = - "i\0" /* Parameter signature */ - "glActiveStencilFaceEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_separate_stencil) -static const char StencilFuncSeparateATI_names[] = - "iiii\0" /* Parameter signature */ - "glStencilFuncSeparateATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetShaderSourceARB_names[] = - "iipp\0" /* Parameter signature */ - "glGetShaderSource\0" - "glGetShaderSourceARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_igloo_interface) -static const char IglooInterfaceSGIX_names[] = - "ip\0" /* Parameter signature */ - "glIglooInterfaceSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4dNV_names[] = - "idddd\0" /* Parameter signature */ - "glVertexAttrib4dNV\0" - ""; -#endif - -#if defined(need_GL_IBM_multimode_draw_arrays) -static const char MultiModeDrawElementsIBM_names[] = - "ppipii\0" /* Parameter signature */ - "glMultiModeDrawElementsIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4sv\0" - "glMultiTexCoord4svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GenQueriesARB_names[] = - "ip\0" /* Parameter signature */ - "glGenQueries\0" - "glGenQueriesARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiVertex3fSUN_names[] = - "ifff\0" /* Parameter signature */ - "glReplacementCodeuiVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3iEXT_names[] = - "iii\0" /* Parameter signature */ - "glTangent3iEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_mesh_array) -static const char DrawMeshArraysSUN_names[] = - "iiii\0" /* Parameter signature */ - "glDrawMeshArraysSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char IsSync_names[] = - "i\0" /* Parameter signature */ - "glIsSync\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapControlPointsNV_names[] = - "iiiiiip\0" /* Parameter signature */ - "glGetMapControlPointsNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_draw_buffers) || defined(need_GL_ATI_draw_buffers) -static const char DrawBuffersARB_names[] = - "ip\0" /* Parameter signature */ - "glDrawBuffers\0" - "glDrawBuffersARB\0" - "glDrawBuffersATI\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4fARB_names[] = - "iiffff\0" /* Parameter signature */ - "glProgramLocalParameter4fARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameterivSGIX_names[] = - "ip\0" /* Parameter signature */ - "glSpriteParameterivSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_provoking_vertex) -static const char ProvokingVertexEXT_names[] = - "i\0" /* Parameter signature */ - "glProvokingVertexEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1fARB_names[] = - "if\0" /* Parameter signature */ - "glMultiTexCoord1f\0" - "glMultiTexCoord1fARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4ubvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4ubvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightsvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightsvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform1fv\0" - "glUniform1fvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexSubImage1D_names[] = - "iiiiii\0" /* Parameter signature */ - "glCopyTexSubImage1D\0" - "glCopyTexSubImage1DEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char BindTexture_names[] = - "ii\0" /* Parameter signature */ - "glBindTexture\0" - "glBindTextureEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char BeginFragmentShaderATI_names[] = - "\0" /* Parameter signature */ - "glBeginFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4fARB_names[] = - "iffff\0" /* Parameter signature */ - "glMultiTexCoord4f\0" - "glMultiTexCoord4fARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs3svNV\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeuivSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeuivSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char EnableVertexAttribArrayARB_names[] = - "i\0" /* Parameter signature */ - "glEnableVertexAttribArray\0" - "glEnableVertexAttribArrayARB\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char NormalPointervINTEL_names[] = - "ip\0" /* Parameter signature */ - "glNormalPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char CopyConvolutionFilter2D_names[] = - "iiiiii\0" /* Parameter signature */ - "glCopyConvolutionFilter2D\0" - "glCopyConvolutionFilter2DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3ivMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3iv\0" - "glWindowPos3ivARB\0" - "glWindowPos3ivMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_copy_buffer) -static const char CopyBufferSubData_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyBufferSubData\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char IsBufferARB_names[] = - "i\0" /* Parameter signature */ - "glIsBuffer\0" - "glIsBufferARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4iMESA_names[] = - "iiii\0" /* Parameter signature */ - "glWindowPos4iMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4uivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4uiv\0" - "glVertexAttrib4uivARB\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3bvEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3bvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix3x4fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix3x4fv\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3fvEXT\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char TexCoordPointervINTEL_names[] = - "iip\0" /* Parameter signature */ - "glTexCoordPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char DeleteBuffersARB_names[] = - "ip\0" /* Parameter signature */ - "glDeleteBuffers\0" - "glDeleteBuffersARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4fvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4fvMESA\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1sNV_names[] = - "ii\0" /* Parameter signature */ - "glVertexAttrib1sNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3svEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3sv\0" - "glSecondaryColor3svEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char LoadTransposeMatrixfARB_names[] = - "p\0" /* Parameter signature */ - "glLoadTransposeMatrixf\0" - "glLoadTransposeMatrixfARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char GetPointerv_names[] = - "ip\0" /* Parameter signature */ - "glGetPointerv\0" - "glGetPointervEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3bEXT_names[] = - "iii\0" /* Parameter signature */ - "glTangent3bEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameterfNV_names[] = - "if\0" /* Parameter signature */ - "glCombinerParameterfNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char BindProgramNV_names[] = - "ii\0" /* Parameter signature */ - "glBindProgramARB\0" - "glBindProgramNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4sv\0" - "glVertexAttrib4svARB\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char CreateDebugObjectMESA_names[] = - "\0" /* Parameter signature */ - "glCreateDebugObjectMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetShaderiv_names[] = - "iip\0" /* Parameter signature */ - "glGetShaderiv\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char ClientWaitSync_names[] = - "iii\0" /* Parameter signature */ - "glClientWaitSync\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char BindFragmentShaderATI_names[] = - "i\0" /* Parameter signature */ - "glBindFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char UnmapBufferARB_names[] = - "i\0" /* Parameter signature */ - "glUnmapBuffer\0" - "glUnmapBufferARB\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char Minmax_names[] = - "iii\0" /* Parameter signature */ - "glMinmax\0" - "glMinmaxEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoorddvEXT_names[] = - "p\0" /* Parameter signature */ - "glFogCoorddv\0" - "glFogCoorddvEXT\0" - ""; -#endif - -#if defined(need_GL_SUNX_constant_data) -static const char FinishTextureSUNX_names[] = - "\0" /* Parameter signature */ - "glFinishTextureSUNX\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentLightfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentLightfvSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetFinalCombinerInputParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFinalCombinerInputParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp3ATI_names[] = - "iiiiiiiiiiiii\0" /* Parameter signature */ - "glColorFragmentOp3ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2sv\0" - "glVertexAttrib2svARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char AreProgramsResidentNV_names[] = - "ipp\0" /* Parameter signature */ - "glAreProgramsResidentNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3svMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3sv\0" - "glWindowPos3svARB\0" - "glWindowPos3svMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_color_subtable) -static const char CopyColorSubTable_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyColorSubTable\0" - "glCopyColorSubTableEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightdvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightdvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char DeleteRenderbuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glDeleteRenderbuffers\0" - "glDeleteRenderbuffersEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NubvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nubv\0" - "glVertexAttrib4NubvARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3dvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetObjectParameterfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetObjectParameterfvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramEnvParameterdvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramEnvParameterdvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_compiled_vertex_array) -static const char LockArraysEXT_names[] = - "ii\0" /* Parameter signature */ - "glLockArraysEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterivEXT_names[] = - "iip\0" /* Parameter signature */ - "glPixelTransformParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char BinormalPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glBinormalPointerEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1dNV_names[] = - "id\0" /* Parameter signature */ - "glVertexAttrib1dNV\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerInputParameterivNV_names[] = - "iiiip\0" /* Parameter signature */ - "glGetCombinerInputParameterivNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2fv\0" - "glMultiTexCoord2fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GetRenderbufferParameterivEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetRenderbufferParameteriv\0" - "glGetRenderbufferParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameterivNV_names[] = - "ip\0" /* Parameter signature */ - "glCombinerParameterivNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char GenFragmentShadersATI_names[] = - "i\0" /* Parameter signature */ - "glGenFragmentShadersATI\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char DrawArrays_names[] = - "iii\0" /* Parameter signature */ - "glDrawArrays\0" - "glDrawArraysEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightuivARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightuivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2sARB_names[] = - "iii\0" /* Parameter signature */ - "glVertexAttrib2s\0" - "glVertexAttrib2sARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char GenAsyncMarkersSGIX_names[] = - "i\0" /* Parameter signature */ - "glGenAsyncMarkersSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3svEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3svEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char GetListParameterivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetListParameterivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char BindBufferARB_names[] = - "ii\0" /* Parameter signature */ - "glBindBuffer\0" - "glBindBufferARB\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetInfoLogARB_names[] = - "iipp\0" /* Parameter signature */ - "glGetInfoLogARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4svNV\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char EdgeFlagPointerListIBM_names[] = - "ipi\0" /* Parameter signature */ - "glEdgeFlagPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix3x2fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix3x2fv\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetMinmaxParameterfv\0" - "glGetMinmaxParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1fv\0" - "glVertexAttrib1fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GenBuffersARB_names[] = - "ip\0" /* Parameter signature */ - "glGenBuffers\0" - "glGenBuffersARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs1svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs1svNV\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char GetTexBumpParameterivATI_names[] = - "ip\0" /* Parameter signature */ - "glGetTexBumpParameterivATI\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3bEXT_names[] = - "iii\0" /* Parameter signature */ - "glBinormal3bEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentMaterialivSGIX\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char IsRenderbufferEXT_names[] = - "i\0" /* Parameter signature */ - "glIsRenderbuffer\0" - "glIsRenderbufferEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char GenProgramsNV_names[] = - "ip\0" /* Parameter signature */ - "glGenProgramsARB\0" - "glGenProgramsNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4dvNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char EndFragmentShaderATI_names[] = - "\0" /* Parameter signature */ - "glEndFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3iEXT_names[] = - "iii\0" /* Parameter signature */ - "glBinormal3iEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2fMESA_names[] = - "ff\0" /* Parameter signature */ - "glWindowPos2f\0" - "glWindowPos2fARB\0" - "glWindowPos2fMESA\0" - ""; -#endif - -#if defined(need_GL_3DFX_tbuffer) -static const struct dri_extension_function GL_3DFX_tbuffer_functions[] = { - { TbufferMask3DFX_names, TbufferMask3DFX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_APPLE_flush_buffer_range) -static const struct dri_extension_function GL_APPLE_flush_buffer_range_functions[] = { - { BufferParameteriAPPLE_names, BufferParameteriAPPLE_remap_index, -1 }, - { FlushMappedBufferRangeAPPLE_names, FlushMappedBufferRangeAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_APPLE_texture_range) -static const struct dri_extension_function GL_APPLE_texture_range_functions[] = { - { TextureRangeAPPLE_names, TextureRangeAPPLE_remap_index, -1 }, - { GetTexParameterPointervAPPLE_names, GetTexParameterPointervAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_APPLE_vertex_array_object) -static const struct dri_extension_function GL_APPLE_vertex_array_object_functions[] = { - { DeleteVertexArraysAPPLE_names, DeleteVertexArraysAPPLE_remap_index, -1 }, - { GenVertexArraysAPPLE_names, GenVertexArraysAPPLE_remap_index, -1 }, - { IsVertexArrayAPPLE_names, IsVertexArrayAPPLE_remap_index, -1 }, - { BindVertexArrayAPPLE_names, BindVertexArrayAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_copy_buffer) -static const struct dri_extension_function GL_ARB_copy_buffer_functions[] = { - { CopyBufferSubData_names, CopyBufferSubData_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_draw_buffers) -static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { - { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_framebuffer_object) -static const struct dri_extension_function GL_ARB_framebuffer_object_functions[] = { - { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 }, - { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 }, - { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 }, - { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 }, - { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 }, - { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 }, - { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 }, - { RenderbufferStorageMultisample_names, RenderbufferStorageMultisample_remap_index, -1 }, - { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 }, - { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 }, - { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 }, - { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 }, - { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 }, - { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 }, - { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 }, - { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 }, - { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 }, - { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 }, - { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 }, - { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_map_buffer_range) -static const struct dri_extension_function GL_ARB_map_buffer_range_functions[] = { - { FlushMappedBufferRange_names, FlushMappedBufferRange_remap_index, -1 }, - { MapBufferRange_names, MapBufferRange_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = { - { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, - { MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 }, - { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 }, - { CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 }, - { MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_multisample) -static const struct dri_extension_function GL_ARB_multisample_functions[] = { - { SampleCoverageARB_names, SampleCoverageARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_occlusion_query) -static const struct dri_extension_function GL_ARB_occlusion_query_functions[] = { - { BeginQueryARB_names, BeginQueryARB_remap_index, -1 }, - { GetQueryivARB_names, GetQueryivARB_remap_index, -1 }, - { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, -1 }, - { EndQueryARB_names, EndQueryARB_remap_index, -1 }, - { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, -1 }, - { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, -1 }, - { IsQueryARB_names, IsQueryARB_remap_index, -1 }, - { GenQueriesARB_names, GenQueriesARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_point_parameters) -static const struct dri_extension_function GL_ARB_point_parameters_functions[] = { - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { - { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, - { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, - { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, - { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, - { CreateProgramObjectARB_names, CreateProgramObjectARB_remap_index, -1 }, - { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, - { CreateShaderObjectARB_names, CreateShaderObjectARB_remap_index, -1 }, - { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, - { AttachObjectARB_names, AttachObjectARB_remap_index, -1 }, - { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, - { GetAttachedObjectsARB_names, GetAttachedObjectsARB_remap_index, -1 }, - { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, - { GetHandleARB_names, GetHandleARB_remap_index, -1 }, - { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, - { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, - { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, - { DeleteObjectARB_names, DeleteObjectARB_remap_index, -1 }, - { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, - { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, - { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, - { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, - { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, - { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, - { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, - { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, - { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, - { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, - { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, - { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, - { DetachObjectARB_names, DetachObjectARB_remap_index, -1 }, - { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, - { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, - { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, - { GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, -1 }, - { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, - { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, - { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, - { GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, -1 }, - { GetInfoLogARB_names, GetInfoLogARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_sync) -static const struct dri_extension_function GL_ARB_sync_functions[] = { - { DeleteSync_names, DeleteSync_remap_index, -1 }, - { FenceSync_names, FenceSync_remap_index, -1 }, - { WaitSync_names, WaitSync_remap_index, -1 }, - { GetInteger64v_names, GetInteger64v_remap_index, -1 }, - { GetSynciv_names, GetSynciv_remap_index, -1 }, - { IsSync_names, IsSync_remap_index, -1 }, - { ClientWaitSync_names, ClientWaitSync_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_texture_compression) -static const struct dri_extension_function GL_ARB_texture_compression_functions[] = { - { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, -1 }, - { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, -1 }, - { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, -1 }, - { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, -1 }, - { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, -1 }, - { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, -1 }, - { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_transpose_matrix) -static const struct dri_extension_function GL_ARB_transpose_matrix_functions[] = { - { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, -1 }, - { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, -1 }, - { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, -1 }, - { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_array_object) -static const struct dri_extension_function GL_ARB_vertex_array_object_functions[] = { - { DeleteVertexArraysAPPLE_names, DeleteVertexArraysAPPLE_remap_index, -1 }, - { GenVertexArrays_names, GenVertexArrays_remap_index, -1 }, - { BindVertexArray_names, BindVertexArray_remap_index, -1 }, - { IsVertexArrayAPPLE_names, IsVertexArrayAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const struct dri_extension_function GL_ARB_vertex_blend_functions[] = { - { WeightubvARB_names, WeightubvARB_remap_index, -1 }, - { WeightivARB_names, WeightivARB_remap_index, -1 }, - { WeightPointerARB_names, WeightPointerARB_remap_index, -1 }, - { WeightfvARB_names, WeightfvARB_remap_index, -1 }, - { WeightbvARB_names, WeightbvARB_remap_index, -1 }, - { WeightusvARB_names, WeightusvARB_remap_index, -1 }, - { VertexBlendARB_names, VertexBlendARB_remap_index, -1 }, - { WeightsvARB_names, WeightsvARB_remap_index, -1 }, - { WeightdvARB_names, WeightdvARB_remap_index, -1 }, - { WeightuivARB_names, WeightuivARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_buffer_object) -static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions[] = { - { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, -1 }, - { BufferSubDataARB_names, BufferSubDataARB_remap_index, -1 }, - { BufferDataARB_names, BufferDataARB_remap_index, -1 }, - { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, -1 }, - { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, -1 }, - { MapBufferARB_names, MapBufferARB_remap_index, -1 }, - { IsBufferARB_names, IsBufferARB_remap_index, -1 }, - { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, -1 }, - { UnmapBufferARB_names, UnmapBufferARB_remap_index, -1 }, - { BindBufferARB_names, BindBufferARB_remap_index, -1 }, - { GenBuffersARB_names, GenBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { - { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, - { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, - { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, - { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, - { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, - { ProgramLocalParameter4dARB_names, ProgramLocalParameter4dARB_remap_index, -1 }, - { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, - { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, - { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, - { GetProgramLocalParameterfvARB_names, GetProgramLocalParameterfvARB_remap_index, -1 }, - { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, - { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, - { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, - { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, - { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, - { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, - { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, - { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, - { ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, -1 }, - { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, - { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, - { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, - { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, - { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 }, - { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, - { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, - { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, - { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, - { GetProgramStringARB_names, GetProgramStringARB_remap_index, -1 }, - { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, - { IsProgramNV_names, IsProgramNV_remap_index, -1 }, - { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, - { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, - { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, - { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, - { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, - { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, - { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, - { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, - { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, - { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, - { GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, -1 }, - { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, - { ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, -1 }, - { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, - { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, - { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, - { GetProgramLocalParameterdvARB_names, GetProgramLocalParameterdvARB_remap_index, -1 }, - { GetProgramivARB_names, GetProgramivARB_remap_index, -1 }, - { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, - { ProgramStringARB_names, ProgramStringARB_remap_index, -1 }, - { ProgramLocalParameter4fARB_names, ProgramLocalParameter4fARB_remap_index, -1 }, - { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, - { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, - { BindProgramNV_names, BindProgramNV_remap_index, -1 }, - { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, - { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, - { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, - { GetProgramEnvParameterdvARB_names, GetProgramEnvParameterdvARB_remap_index, -1 }, - { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, - { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, - { GenProgramsNV_names, GenProgramsNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_shader) -static const struct dri_extension_function GL_ARB_vertex_shader_functions[] = { - { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, - { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, - { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_window_pos) -static const struct dri_extension_function GL_ARB_window_pos_functions[] = { - { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, - { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, - { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, - { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, - { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, - { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, - { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, - { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, - { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, - { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, - { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, - { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, - { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, - { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, - { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, - { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_blend_equation_separate) -static const struct dri_extension_function GL_ATI_blend_equation_separate_functions[] = { - { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_draw_buffers) -static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = { - { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const struct dri_extension_function GL_ATI_envmap_bumpmap_functions[] = { - { TexBumpParameterfvATI_names, TexBumpParameterfvATI_remap_index, -1 }, - { TexBumpParameterivATI_names, TexBumpParameterivATI_remap_index, -1 }, - { GetTexBumpParameterfvATI_names, GetTexBumpParameterfvATI_remap_index, -1 }, - { GetTexBumpParameterivATI_names, GetTexBumpParameterivATI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { - { ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, -1 }, - { DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, -1 }, - { SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, -1 }, - { SampleMapATI_names, SampleMapATI_remap_index, -1 }, - { AlphaFragmentOp2ATI_names, AlphaFragmentOp2ATI_remap_index, -1 }, - { AlphaFragmentOp1ATI_names, AlphaFragmentOp1ATI_remap_index, -1 }, - { ColorFragmentOp1ATI_names, ColorFragmentOp1ATI_remap_index, -1 }, - { AlphaFragmentOp3ATI_names, AlphaFragmentOp3ATI_remap_index, -1 }, - { PassTexCoordATI_names, PassTexCoordATI_remap_index, -1 }, - { BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, -1 }, - { BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, -1 }, - { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 }, - { GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, -1 }, - { EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_separate_stencil) -static const struct dri_extension_function GL_ATI_separate_stencil_functions[] = { - { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, - { StencilFuncSeparateATI_names, StencilFuncSeparateATI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_color) -static const struct dri_extension_function GL_EXT_blend_color_functions[] = { - { BlendColor_names, -1, 336 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_equation_separate) -static const struct dri_extension_function GL_EXT_blend_equation_separate_functions[] = { - { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_func_separate) -static const struct dri_extension_function GL_EXT_blend_func_separate_functions[] = { - { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_minmax) -static const struct dri_extension_function GL_EXT_blend_minmax_functions[] = { - { BlendEquation_names, -1, 337 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_color_subtable) -static const struct dri_extension_function GL_EXT_color_subtable_functions[] = { - { ColorSubTable_names, -1, 346 }, - { CopyColorSubTable_names, -1, 347 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_compiled_vertex_array) -static const struct dri_extension_function GL_EXT_compiled_vertex_array_functions[] = { - { UnlockArraysEXT_names, UnlockArraysEXT_remap_index, -1 }, - { LockArraysEXT_names, LockArraysEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_convolution) -static const struct dri_extension_function GL_EXT_convolution_functions[] = { - { ConvolutionFilter1D_names, -1, 348 }, - { CopyConvolutionFilter1D_names, -1, 354 }, - { GetConvolutionParameteriv_names, -1, 358 }, - { ConvolutionFilter2D_names, -1, 349 }, - { ConvolutionParameteriv_names, -1, 353 }, - { ConvolutionParameterfv_names, -1, 351 }, - { GetSeparableFilter_names, -1, 359 }, - { SeparableFilter2D_names, -1, 360 }, - { ConvolutionParameteri_names, -1, 352 }, - { ConvolutionParameterf_names, -1, 350 }, - { GetConvolutionParameterfv_names, -1, 357 }, - { GetConvolutionFilter_names, -1, 356 }, - { CopyConvolutionFilter2D_names, -1, 355 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = { - { TangentPointerEXT_names, TangentPointerEXT_remap_index, -1 }, - { Binormal3ivEXT_names, Binormal3ivEXT_remap_index, -1 }, - { Tangent3sEXT_names, Tangent3sEXT_remap_index, -1 }, - { Tangent3fvEXT_names, Tangent3fvEXT_remap_index, -1 }, - { Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 }, - { Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 }, - { Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 }, - { Tangent3fEXT_names, Tangent3fEXT_remap_index, -1 }, - { Binormal3sEXT_names, Binormal3sEXT_remap_index, -1 }, - { Tangent3ivEXT_names, Tangent3ivEXT_remap_index, -1 }, - { Tangent3dEXT_names, Tangent3dEXT_remap_index, -1 }, - { Binormal3svEXT_names, Binormal3svEXT_remap_index, -1 }, - { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, - { Binormal3dvEXT_names, Binormal3dvEXT_remap_index, -1 }, - { Tangent3iEXT_names, Tangent3iEXT_remap_index, -1 }, - { Tangent3bvEXT_names, Tangent3bvEXT_remap_index, -1 }, - { Binormal3fvEXT_names, Binormal3fvEXT_remap_index, -1 }, - { Tangent3bEXT_names, Tangent3bEXT_remap_index, -1 }, - { BinormalPointerEXT_names, BinormalPointerEXT_remap_index, -1 }, - { Tangent3svEXT_names, Tangent3svEXT_remap_index, -1 }, - { Binormal3bEXT_names, Binormal3bEXT_remap_index, -1 }, - { Binormal3iEXT_names, Binormal3iEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const struct dri_extension_function GL_EXT_copy_texture_functions[] = { - { CopyTexSubImage3D_names, -1, 373 }, - { CopyTexImage2D_names, -1, 324 }, - { CopyTexImage1D_names, -1, 323 }, - { CopyTexSubImage2D_names, -1, 326 }, - { CopyTexSubImage1D_names, -1, 325 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_cull_vertex) -static const struct dri_extension_function GL_EXT_cull_vertex_functions[] = { - { CullParameterdvEXT_names, CullParameterdvEXT_remap_index, -1 }, - { CullParameterfvEXT_names, CullParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_depth_bounds_test) -static const struct dri_extension_function GL_EXT_depth_bounds_test_functions[] = { - { DepthBoundsEXT_names, DepthBoundsEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_draw_range_elements) -static const struct dri_extension_function GL_EXT_draw_range_elements_functions[] = { - { DrawRangeElements_names, -1, 338 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_fog_coord) -static const struct dri_extension_function GL_EXT_fog_coord_functions[] = { - { FogCoorddEXT_names, FogCoorddEXT_remap_index, -1 }, - { FogCoordfEXT_names, FogCoordfEXT_remap_index, -1 }, - { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, -1 }, - { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, -1 }, - { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_framebuffer_blit) -static const struct dri_extension_function GL_EXT_framebuffer_blit_functions[] = { - { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_framebuffer_object) -static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] = { - { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 }, - { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 }, - { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 }, - { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 }, - { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 }, - { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 }, - { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 }, - { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 }, - { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 }, - { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 }, - { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 }, - { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 }, - { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 }, - { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 }, - { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 }, - { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 }, - { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_gpu_program_parameters) -static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = { - { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 }, - { ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_histogram) -static const struct dri_extension_function GL_EXT_histogram_functions[] = { - { Histogram_names, -1, 367 }, - { ResetHistogram_names, -1, 369 }, - { GetMinmax_names, -1, 364 }, - { GetHistogramParameterfv_names, -1, 362 }, - { GetMinmaxParameteriv_names, -1, 366 }, - { ResetMinmax_names, -1, 370 }, - { GetHistogramParameteriv_names, -1, 363 }, - { GetHistogram_names, -1, 361 }, - { Minmax_names, -1, 368 }, - { GetMinmaxParameterfv_names, -1, 365 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_index_func) -static const struct dri_extension_function GL_EXT_index_func_functions[] = { - { IndexFuncEXT_names, IndexFuncEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_index_material) -static const struct dri_extension_function GL_EXT_index_material_functions[] = { - { IndexMaterialEXT_names, IndexMaterialEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_light_texture) -static const struct dri_extension_function GL_EXT_light_texture_functions[] = { - { ApplyTextureEXT_names, ApplyTextureEXT_remap_index, -1 }, - { TextureMaterialEXT_names, TextureMaterialEXT_remap_index, -1 }, - { TextureLightEXT_names, TextureLightEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_multi_draw_arrays) -static const struct dri_extension_function GL_EXT_multi_draw_arrays_functions[] = { - { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, -1 }, - { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_multisample) -static const struct dri_extension_function GL_EXT_multisample_functions[] = { - { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, -1 }, - { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_paletted_texture) -static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = { - { ColorTable_names, -1, 339 }, - { GetColorTable_names, -1, 343 }, - { GetColorTableParameterfv_names, -1, 344 }, - { GetColorTableParameteriv_names, -1, 345 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const struct dri_extension_function GL_EXT_pixel_transform_functions[] = { - { PixelTransformParameterfvEXT_names, PixelTransformParameterfvEXT_remap_index, -1 }, - { PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_remap_index, -1 }, - { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, - { PixelTransformParameterivEXT_names, PixelTransformParameterivEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_point_parameters) -static const struct dri_extension_function GL_EXT_point_parameters_functions[] = { - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_polygon_offset) -static const struct dri_extension_function GL_EXT_polygon_offset_functions[] = { - { PolygonOffsetEXT_names, PolygonOffsetEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_provoking_vertex) -static const struct dri_extension_function GL_EXT_provoking_vertex_functions[] = { - { ProvokingVertexEXT_names, ProvokingVertexEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_secondary_color) -static const struct dri_extension_function GL_EXT_secondary_color_functions[] = { - { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, - { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, -1 }, - { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, -1 }, - { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, -1 }, - { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, -1 }, - { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, -1 }, - { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, -1 }, - { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, -1 }, - { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, -1 }, - { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, -1 }, - { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, -1 }, - { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, -1 }, - { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, -1 }, - { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, -1 }, - { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, -1 }, - { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, -1 }, - { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_stencil_two_side) -static const struct dri_extension_function GL_EXT_stencil_two_side_functions[] = { - { ActiveStencilFaceEXT_names, ActiveStencilFaceEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_subtexture) -static const struct dri_extension_function GL_EXT_subtexture_functions[] = { - { TexSubImage1D_names, -1, 332 }, - { TexSubImage2D_names, -1, 333 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture3D) -static const struct dri_extension_function GL_EXT_texture3D_functions[] = { - { TexImage3D_names, -1, 371 }, - { TexSubImage3D_names, -1, 372 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture_array) -static const struct dri_extension_function GL_EXT_texture_array_functions[] = { - { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture_object) -static const struct dri_extension_function GL_EXT_texture_object_functions[] = { - { PrioritizeTextures_names, -1, 331 }, - { AreTexturesResident_names, -1, 322 }, - { GenTextures_names, -1, 328 }, - { DeleteTextures_names, -1, 327 }, - { IsTexture_names, -1, 330 }, - { BindTexture_names, -1, 307 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture_perturb_normal) -static const struct dri_extension_function GL_EXT_texture_perturb_normal_functions[] = { - { TextureNormalEXT_names, TextureNormalEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_timer_query) -static const struct dri_extension_function GL_EXT_timer_query_functions[] = { - { GetQueryObjectui64vEXT_names, GetQueryObjectui64vEXT_remap_index, -1 }, - { GetQueryObjecti64vEXT_names, GetQueryObjecti64vEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const struct dri_extension_function GL_EXT_vertex_array_functions[] = { - { IndexPointerEXT_names, IndexPointerEXT_remap_index, -1 }, - { NormalPointerEXT_names, NormalPointerEXT_remap_index, -1 }, - { VertexPointerEXT_names, VertexPointerEXT_remap_index, -1 }, - { TexCoordPointerEXT_names, TexCoordPointerEXT_remap_index, -1 }, - { EdgeFlagPointerEXT_names, EdgeFlagPointerEXT_remap_index, -1 }, - { ArrayElement_names, -1, 306 }, - { ColorPointerEXT_names, ColorPointerEXT_remap_index, -1 }, - { GetPointerv_names, -1, 329 }, - { DrawArrays_names, -1, 310 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const struct dri_extension_function GL_EXT_vertex_weighting_functions[] = { - { VertexWeightfvEXT_names, VertexWeightfvEXT_remap_index, -1 }, - { VertexWeightfEXT_names, VertexWeightfEXT_remap_index, -1 }, - { VertexWeightPointerEXT_names, VertexWeightPointerEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_HP_image_transform) -static const struct dri_extension_function GL_HP_image_transform_functions[] = { - { GetImageTransformParameterfvHP_names, GetImageTransformParameterfvHP_remap_index, -1 }, - { ImageTransformParameterfHP_names, ImageTransformParameterfHP_remap_index, -1 }, - { ImageTransformParameterfvHP_names, ImageTransformParameterfvHP_remap_index, -1 }, - { ImageTransformParameteriHP_names, ImageTransformParameteriHP_remap_index, -1 }, - { GetImageTransformParameterivHP_names, GetImageTransformParameterivHP_remap_index, -1 }, - { ImageTransformParameterivHP_names, ImageTransformParameterivHP_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_IBM_multimode_draw_arrays) -static const struct dri_extension_function GL_IBM_multimode_draw_arrays_functions[] = { - { MultiModeDrawArraysIBM_names, MultiModeDrawArraysIBM_remap_index, -1 }, - { MultiModeDrawElementsIBM_names, MultiModeDrawElementsIBM_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const struct dri_extension_function GL_IBM_vertex_array_lists_functions[] = { - { SecondaryColorPointerListIBM_names, SecondaryColorPointerListIBM_remap_index, -1 }, - { NormalPointerListIBM_names, NormalPointerListIBM_remap_index, -1 }, - { FogCoordPointerListIBM_names, FogCoordPointerListIBM_remap_index, -1 }, - { VertexPointerListIBM_names, VertexPointerListIBM_remap_index, -1 }, - { ColorPointerListIBM_names, ColorPointerListIBM_remap_index, -1 }, - { TexCoordPointerListIBM_names, TexCoordPointerListIBM_remap_index, -1 }, - { IndexPointerListIBM_names, IndexPointerListIBM_remap_index, -1 }, - { EdgeFlagPointerListIBM_names, EdgeFlagPointerListIBM_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_INGR_blend_func_separate) -static const struct dri_extension_function GL_INGR_blend_func_separate_functions[] = { - { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const struct dri_extension_function GL_INTEL_parallel_arrays_functions[] = { - { VertexPointervINTEL_names, VertexPointervINTEL_remap_index, -1 }, - { ColorPointervINTEL_names, ColorPointervINTEL_remap_index, -1 }, - { NormalPointervINTEL_names, NormalPointervINTEL_remap_index, -1 }, - { TexCoordPointervINTEL_names, TexCoordPointervINTEL_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_MESA_resize_buffers) -static const struct dri_extension_function GL_MESA_resize_buffers_functions[] = { - { ResizeBuffersMESA_names, ResizeBuffersMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const struct dri_extension_function GL_MESA_shader_debug_functions[] = { - { GetDebugLogLengthMESA_names, GetDebugLogLengthMESA_remap_index, -1 }, - { ClearDebugLogMESA_names, ClearDebugLogMESA_remap_index, -1 }, - { GetDebugLogMESA_names, GetDebugLogMESA_remap_index, -1 }, - { CreateDebugObjectMESA_names, CreateDebugObjectMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_MESA_window_pos) -static const struct dri_extension_function GL_MESA_window_pos_functions[] = { - { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, - { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, - { WindowPos4svMESA_names, WindowPos4svMESA_remap_index, -1 }, - { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, - { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, - { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, - { WindowPos4dMESA_names, WindowPos4dMESA_remap_index, -1 }, - { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, - { WindowPos4ivMESA_names, WindowPos4ivMESA_remap_index, -1 }, - { WindowPos4fMESA_names, WindowPos4fMESA_remap_index, -1 }, - { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, - { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, - { WindowPos4dvMESA_names, WindowPos4dvMESA_remap_index, -1 }, - { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, - { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, - { WindowPos4sMESA_names, WindowPos4sMESA_remap_index, -1 }, - { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, - { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, - { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, - { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, - { WindowPos4iMESA_names, WindowPos4iMESA_remap_index, -1 }, - { WindowPos4fvMESA_names, WindowPos4fvMESA_remap_index, -1 }, - { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, - { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_evaluators) -static const struct dri_extension_function GL_NV_evaluators_functions[] = { - { GetMapAttribParameterivNV_names, GetMapAttribParameterivNV_remap_index, -1 }, - { MapControlPointsNV_names, MapControlPointsNV_remap_index, -1 }, - { MapParameterfvNV_names, MapParameterfvNV_remap_index, -1 }, - { EvalMapsNV_names, EvalMapsNV_remap_index, -1 }, - { GetMapAttribParameterfvNV_names, GetMapAttribParameterfvNV_remap_index, -1 }, - { MapParameterivNV_names, MapParameterivNV_remap_index, -1 }, - { GetMapParameterivNV_names, GetMapParameterivNV_remap_index, -1 }, - { GetMapParameterfvNV_names, GetMapParameterfvNV_remap_index, -1 }, - { GetMapControlPointsNV_names, GetMapControlPointsNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_fence) -static const struct dri_extension_function GL_NV_fence_functions[] = { - { GenFencesNV_names, GenFencesNV_remap_index, -1 }, - { TestFenceNV_names, TestFenceNV_remap_index, -1 }, - { IsFenceNV_names, IsFenceNV_remap_index, -1 }, - { DeleteFencesNV_names, DeleteFencesNV_remap_index, -1 }, - { SetFenceNV_names, SetFenceNV_remap_index, -1 }, - { GetFenceivNV_names, GetFenceivNV_remap_index, -1 }, - { FinishFenceNV_names, FinishFenceNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_fragment_program) -static const struct dri_extension_function GL_NV_fragment_program_functions[] = { - { GetProgramNamedParameterdvNV_names, GetProgramNamedParameterdvNV_remap_index, -1 }, - { GetProgramNamedParameterfvNV_names, GetProgramNamedParameterfvNV_remap_index, -1 }, - { ProgramNamedParameter4fNV_names, ProgramNamedParameter4fNV_remap_index, -1 }, - { ProgramNamedParameter4fvNV_names, ProgramNamedParameter4fvNV_remap_index, -1 }, - { ProgramNamedParameter4dvNV_names, ProgramNamedParameter4dvNV_remap_index, -1 }, - { ProgramNamedParameter4dNV_names, ProgramNamedParameter4dNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_point_sprite) -static const struct dri_extension_function GL_NV_point_sprite_functions[] = { - { PointParameteriNV_names, PointParameteriNV_remap_index, -1 }, - { PointParameterivNV_names, PointParameterivNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_register_combiners) -static const struct dri_extension_function GL_NV_register_combiners_functions[] = { - { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 }, - { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 }, - { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 }, - { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 }, - { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 }, - { GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, -1 }, - { CombinerParameteriNV_names, CombinerParameteriNV_remap_index, -1 }, - { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 }, - { CombinerInputNV_names, CombinerInputNV_remap_index, -1 }, - { CombinerParameterfNV_names, CombinerParameterfNV_remap_index, -1 }, - { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, -1 }, - { GetCombinerInputParameterivNV_names, GetCombinerInputParameterivNV_remap_index, -1 }, - { CombinerParameterivNV_names, CombinerParameterivNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_register_combiners2) -static const struct dri_extension_function GL_NV_register_combiners2_functions[] = { - { CombinerStageParameterfvNV_names, CombinerStageParameterfvNV_remap_index, -1 }, - { GetCombinerStageParameterfvNV_names, GetCombinerStageParameterfvNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_vertex_array_range) -static const struct dri_extension_function GL_NV_vertex_array_range_functions[] = { - { VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, -1 }, - { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_vertex_program) -static const struct dri_extension_function GL_NV_vertex_program_functions[] = { - { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 }, - { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 }, - { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 }, - { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 }, - { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 }, - { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 }, - { VertexAttrib4ubNV_names, VertexAttrib4ubNV_remap_index, -1 }, - { VertexAttribs3dvNV_names, VertexAttribs3dvNV_remap_index, -1 }, - { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, -1 }, - { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, -1 }, - { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, -1 }, - { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, - { LoadProgramNV_names, LoadProgramNV_remap_index, -1 }, - { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, -1 }, - { VertexAttrib3fNV_names, VertexAttrib3fNV_remap_index, -1 }, - { VertexAttribs2dvNV_names, VertexAttribs2dvNV_remap_index, -1 }, - { GetProgramParameterfvNV_names, GetProgramParameterfvNV_remap_index, -1 }, - { VertexAttrib3dNV_names, VertexAttrib3dNV_remap_index, -1 }, - { VertexAttrib2fvNV_names, VertexAttrib2fvNV_remap_index, -1 }, - { VertexAttrib2dvNV_names, VertexAttrib2dvNV_remap_index, -1 }, - { VertexAttrib1dvNV_names, VertexAttrib1dvNV_remap_index, -1 }, - { VertexAttrib1svNV_names, VertexAttrib1svNV_remap_index, -1 }, - { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 }, - { VertexAttribs2svNV_names, VertexAttribs2svNV_remap_index, -1 }, - { GetVertexAttribivNV_names, GetVertexAttribivNV_remap_index, -1 }, - { GetVertexAttribfvNV_names, GetVertexAttribfvNV_remap_index, -1 }, - { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, -1 }, - { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, -1 }, - { IsProgramNV_names, IsProgramNV_remap_index, -1 }, - { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, - { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, -1 }, - { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, -1 }, - { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, -1 }, - { VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, -1 }, - { TrackMatrixNV_names, TrackMatrixNV_remap_index, -1 }, - { GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, -1 }, - { GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, -1 }, - { VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, -1 }, - { ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, -1 }, - { GetProgramivNV_names, GetProgramivNV_remap_index, -1 }, - { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 }, - { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 }, - { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, - { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 }, - { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, - { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, - { GetProgramStringNV_names, GetProgramStringNV_remap_index, -1 }, - { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 }, - { VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, -1 }, - { ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, -1 }, - { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 }, - { VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, -1 }, - { VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, -1 }, - { VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, -1 }, - { VertexAttribs3svNV_names, VertexAttribs3svNV_remap_index, -1 }, - { VertexAttrib1sNV_names, VertexAttrib1sNV_remap_index, -1 }, - { BindProgramNV_names, BindProgramNV_remap_index, -1 }, - { AreProgramsResidentNV_names, AreProgramsResidentNV_remap_index, -1 }, - { VertexAttrib3dvNV_names, VertexAttrib3dvNV_remap_index, -1 }, - { VertexAttrib1dNV_names, VertexAttrib1dNV_remap_index, -1 }, - { VertexAttribs4svNV_names, VertexAttribs4svNV_remap_index, -1 }, - { VertexAttribs1svNV_names, VertexAttribs1svNV_remap_index, -1 }, - { GenProgramsNV_names, GenProgramsNV_remap_index, -1 }, - { VertexAttrib4dvNV_names, VertexAttrib4dvNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_PGI_misc_hints) -static const struct dri_extension_function GL_PGI_misc_hints_functions[] = { - { HintPGI_names, HintPGI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_detail_texture) -static const struct dri_extension_function GL_SGIS_detail_texture_functions[] = { - { GetDetailTexFuncSGIS_names, GetDetailTexFuncSGIS_remap_index, -1 }, - { DetailTexFuncSGIS_names, DetailTexFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_fog_function) -static const struct dri_extension_function GL_SGIS_fog_function_functions[] = { - { FogFuncSGIS_names, FogFuncSGIS_remap_index, -1 }, - { GetFogFuncSGIS_names, GetFogFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_multisample) -static const struct dri_extension_function GL_SGIS_multisample_functions[] = { - { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, -1 }, - { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const struct dri_extension_function GL_SGIS_pixel_texture_functions[] = { - { PixelTexGenParameterfvSGIS_names, PixelTexGenParameterfvSGIS_remap_index, -1 }, - { GetPixelTexGenParameterivSGIS_names, GetPixelTexGenParameterivSGIS_remap_index, -1 }, - { PixelTexGenParameteriSGIS_names, PixelTexGenParameteriSGIS_remap_index, -1 }, - { PixelTexGenParameterivSGIS_names, PixelTexGenParameterivSGIS_remap_index, -1 }, - { PixelTexGenParameterfSGIS_names, PixelTexGenParameterfSGIS_remap_index, -1 }, - { GetPixelTexGenParameterfvSGIS_names, GetPixelTexGenParameterfvSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_point_parameters) -static const struct dri_extension_function GL_SGIS_point_parameters_functions[] = { - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_sharpen_texture) -static const struct dri_extension_function GL_SGIS_sharpen_texture_functions[] = { - { GetSharpenTexFuncSGIS_names, GetSharpenTexFuncSGIS_remap_index, -1 }, - { SharpenTexFuncSGIS_names, SharpenTexFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_texture4D) -static const struct dri_extension_function GL_SGIS_texture4D_functions[] = { - { TexImage4DSGIS_names, TexImage4DSGIS_remap_index, -1 }, - { TexSubImage4DSGIS_names, TexSubImage4DSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_texture_color_mask) -static const struct dri_extension_function GL_SGIS_texture_color_mask_functions[] = { - { TextureColorMaskSGIS_names, TextureColorMaskSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_texture_filter4) -static const struct dri_extension_function GL_SGIS_texture_filter4_functions[] = { - { GetTexFilterFuncSGIS_names, GetTexFilterFuncSGIS_remap_index, -1 }, - { TexFilterFuncSGIS_names, TexFilterFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_async) -static const struct dri_extension_function GL_SGIX_async_functions[] = { - { AsyncMarkerSGIX_names, AsyncMarkerSGIX_remap_index, -1 }, - { FinishAsyncSGIX_names, FinishAsyncSGIX_remap_index, -1 }, - { PollAsyncSGIX_names, PollAsyncSGIX_remap_index, -1 }, - { DeleteAsyncMarkersSGIX_names, DeleteAsyncMarkersSGIX_remap_index, -1 }, - { IsAsyncMarkerSGIX_names, IsAsyncMarkerSGIX_remap_index, -1 }, - { GenAsyncMarkersSGIX_names, GenAsyncMarkersSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_flush_raster) -static const struct dri_extension_function GL_SGIX_flush_raster_functions[] = { - { FlushRasterSGIX_names, FlushRasterSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const struct dri_extension_function GL_SGIX_fragment_lighting_functions[] = { - { FragmentMaterialfvSGIX_names, FragmentMaterialfvSGIX_remap_index, -1 }, - { FragmentLightModelivSGIX_names, FragmentLightModelivSGIX_remap_index, -1 }, - { FragmentLightiSGIX_names, FragmentLightiSGIX_remap_index, -1 }, - { GetFragmentMaterialfvSGIX_names, GetFragmentMaterialfvSGIX_remap_index, -1 }, - { FragmentMaterialfSGIX_names, FragmentMaterialfSGIX_remap_index, -1 }, - { GetFragmentLightivSGIX_names, GetFragmentLightivSGIX_remap_index, -1 }, - { FragmentLightModeliSGIX_names, FragmentLightModeliSGIX_remap_index, -1 }, - { FragmentLightivSGIX_names, FragmentLightivSGIX_remap_index, -1 }, - { GetFragmentMaterialivSGIX_names, GetFragmentMaterialivSGIX_remap_index, -1 }, - { FragmentLightModelfSGIX_names, FragmentLightModelfSGIX_remap_index, -1 }, - { FragmentColorMaterialSGIX_names, FragmentColorMaterialSGIX_remap_index, -1 }, - { FragmentMaterialiSGIX_names, FragmentMaterialiSGIX_remap_index, -1 }, - { LightEnviSGIX_names, LightEnviSGIX_remap_index, -1 }, - { FragmentLightModelfvSGIX_names, FragmentLightModelfvSGIX_remap_index, -1 }, - { FragmentLightfvSGIX_names, FragmentLightfvSGIX_remap_index, -1 }, - { FragmentLightfSGIX_names, FragmentLightfSGIX_remap_index, -1 }, - { GetFragmentLightfvSGIX_names, GetFragmentLightfvSGIX_remap_index, -1 }, - { FragmentMaterialivSGIX_names, FragmentMaterialivSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_framezoom) -static const struct dri_extension_function GL_SGIX_framezoom_functions[] = { - { FrameZoomSGIX_names, FrameZoomSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_igloo_interface) -static const struct dri_extension_function GL_SGIX_igloo_interface_functions[] = { - { IglooInterfaceSGIX_names, IglooInterfaceSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_instruments) -static const struct dri_extension_function GL_SGIX_instruments_functions[] = { - { ReadInstrumentsSGIX_names, ReadInstrumentsSGIX_remap_index, -1 }, - { PollInstrumentsSGIX_names, PollInstrumentsSGIX_remap_index, -1 }, - { GetInstrumentsSGIX_names, GetInstrumentsSGIX_remap_index, -1 }, - { StartInstrumentsSGIX_names, StartInstrumentsSGIX_remap_index, -1 }, - { StopInstrumentsSGIX_names, StopInstrumentsSGIX_remap_index, -1 }, - { InstrumentsBufferSGIX_names, InstrumentsBufferSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const struct dri_extension_function GL_SGIX_list_priority_functions[] = { - { ListParameterfSGIX_names, ListParameterfSGIX_remap_index, -1 }, - { GetListParameterfvSGIX_names, GetListParameterfvSGIX_remap_index, -1 }, - { ListParameteriSGIX_names, ListParameteriSGIX_remap_index, -1 }, - { ListParameterfvSGIX_names, ListParameterfvSGIX_remap_index, -1 }, - { ListParameterivSGIX_names, ListParameterivSGIX_remap_index, -1 }, - { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_pixel_texture) -static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = { - { PixelTexGenSGIX_names, PixelTexGenSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const struct dri_extension_function GL_SGIX_polynomial_ffd_functions[] = { - { LoadIdentityDeformationMapSGIX_names, LoadIdentityDeformationMapSGIX_remap_index, -1 }, - { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 }, - { DeformSGIX_names, DeformSGIX_remap_index, -1 }, - { DeformationMap3fSGIX_names, DeformationMap3fSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_reference_plane) -static const struct dri_extension_function GL_SGIX_reference_plane_functions[] = { - { ReferencePlaneSGIX_names, ReferencePlaneSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_sprite) -static const struct dri_extension_function GL_SGIX_sprite_functions[] = { - { SpriteParameterfvSGIX_names, SpriteParameterfvSGIX_remap_index, -1 }, - { SpriteParameteriSGIX_names, SpriteParameteriSGIX_remap_index, -1 }, - { SpriteParameterfSGIX_names, SpriteParameterfSGIX_remap_index, -1 }, - { SpriteParameterivSGIX_names, SpriteParameterivSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_tag_sample_buffer) -static const struct dri_extension_function GL_SGIX_tag_sample_buffer_functions[] = { - { TagSampleBufferSGIX_names, TagSampleBufferSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGI_color_table) -static const struct dri_extension_function GL_SGI_color_table_functions[] = { - { ColorTableParameteriv_names, -1, 341 }, - { ColorTable_names, -1, 339 }, - { GetColorTable_names, -1, 343 }, - { CopyColorTable_names, -1, 342 }, - { ColorTableParameterfv_names, -1, 340 }, - { GetColorTableParameterfv_names, -1, 344 }, - { GetColorTableParameteriv_names, -1, 345 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUNX_constant_data) -static const struct dri_extension_function GL_SUNX_constant_data_functions[] = { - { FinishTextureSUNX_names, FinishTextureSUNX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const struct dri_extension_function GL_SUN_global_alpha_functions[] = { - { GlobalAlphaFactorubSUN_names, GlobalAlphaFactorubSUN_remap_index, -1 }, - { GlobalAlphaFactoriSUN_names, GlobalAlphaFactoriSUN_remap_index, -1 }, - { GlobalAlphaFactordSUN_names, GlobalAlphaFactordSUN_remap_index, -1 }, - { GlobalAlphaFactoruiSUN_names, GlobalAlphaFactoruiSUN_remap_index, -1 }, - { GlobalAlphaFactorbSUN_names, GlobalAlphaFactorbSUN_remap_index, -1 }, - { GlobalAlphaFactorfSUN_names, GlobalAlphaFactorfSUN_remap_index, -1 }, - { GlobalAlphaFactorusSUN_names, GlobalAlphaFactorusSUN_remap_index, -1 }, - { GlobalAlphaFactorsSUN_names, GlobalAlphaFactorsSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_mesh_array) -static const struct dri_extension_function GL_SUN_mesh_array_functions[] = { - { DrawMeshArraysSUN_names, DrawMeshArraysSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const struct dri_extension_function GL_SUN_triangle_list_functions[] = { - { ReplacementCodeubSUN_names, ReplacementCodeubSUN_remap_index, -1 }, - { ReplacementCodeubvSUN_names, ReplacementCodeubvSUN_remap_index, -1 }, - { ReplacementCodeusvSUN_names, ReplacementCodeusvSUN_remap_index, -1 }, - { ReplacementCodePointerSUN_names, ReplacementCodePointerSUN_remap_index, -1 }, - { ReplacementCodeusSUN_names, ReplacementCodeusSUN_remap_index, -1 }, - { ReplacementCodeuiSUN_names, ReplacementCodeuiSUN_remap_index, -1 }, - { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_vertex) -static const struct dri_extension_function GL_SUN_vertex_functions[] = { - { ReplacementCodeuiColor3fVertex3fvSUN_names, ReplacementCodeuiColor3fVertex3fvSUN_remap_index, -1 }, - { TexCoord4fColor4fNormal3fVertex4fvSUN_names, TexCoord4fColor4fNormal3fVertex4fvSUN_remap_index, -1 }, - { TexCoord2fColor4ubVertex3fvSUN_names, TexCoord2fColor4ubVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiVertex3fvSUN_names, ReplacementCodeuiVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiNormal3fVertex3fSUN_names, ReplacementCodeuiNormal3fVertex3fSUN_remap_index, -1 }, - { Color4ubVertex3fvSUN_names, Color4ubVertex3fvSUN_remap_index, -1 }, - { Color4ubVertex3fSUN_names, Color4ubVertex3fSUN_remap_index, -1 }, - { TexCoord2fVertex3fSUN_names, TexCoord2fVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4fNormal3fVertex3fSUN_names, TexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, - { TexCoord2fNormal3fVertex3fvSUN_names, TexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 }, - { TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, - { Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 }, - { Color3fVertex3fvSUN_names, Color3fVertex3fvSUN_remap_index, -1 }, - { Color4fNormal3fVertex3fvSUN_names, Color4fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, - { TexCoord2fColor3fVertex3fSUN_names, TexCoord2fColor3fVertex3fSUN_remap_index, -1 }, - { TexCoord4fColor4fNormal3fVertex4fSUN_names, TexCoord4fColor4fNormal3fVertex4fSUN_remap_index, -1 }, - { Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 }, - { Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, - { TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 }, - { Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 }, - { ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 }, - { Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 }, - { Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiColor4ubVertex3fvSUN_names, ReplacementCodeuiColor4ubVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiColor3fVertex3fSUN_names, ReplacementCodeuiColor3fVertex3fSUN_remap_index, -1 }, - { TexCoord4fVertex4fSUN_names, TexCoord4fVertex4fSUN_remap_index, -1 }, - { TexCoord2fColor3fVertex3fvSUN_names, TexCoord2fColor3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 }, - { TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 }, - { ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_1_3) -static const struct dri_extension_function GL_VERSION_1_3_functions[] = { - { SampleCoverageARB_names, SampleCoverageARB_remap_index, -1 }, - { MultiTexCoord3sARB_names, -1, 398 }, - { ActiveTextureARB_names, -1, 374 }, - { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, -1 }, - { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, -1 }, - { MultiTexCoord1fvARB_names, -1, 379 }, - { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, -1 }, - { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, -1 }, - { MultiTexCoord3dARB_names, -1, 392 }, - { MultiTexCoord2iARB_names, -1, 388 }, - { MultiTexCoord2svARB_names, -1, 391 }, - { MultiTexCoord2fARB_names, -1, 386 }, - { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, -1 }, - { MultiTexCoord3fvARB_names, -1, 395 }, - { MultiTexCoord4sARB_names, -1, 406 }, - { MultiTexCoord2dvARB_names, -1, 385 }, - { MultiTexCoord1svARB_names, -1, 383 }, - { MultiTexCoord3svARB_names, -1, 399 }, - { MultiTexCoord4iARB_names, -1, 404 }, - { MultiTexCoord3iARB_names, -1, 396 }, - { MultiTexCoord1dARB_names, -1, 376 }, - { MultiTexCoord3dvARB_names, -1, 393 }, - { MultiTexCoord3ivARB_names, -1, 397 }, - { MultiTexCoord2sARB_names, -1, 390 }, - { MultiTexCoord4ivARB_names, -1, 405 }, - { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, -1 }, - { ClientActiveTextureARB_names, -1, 375 }, - { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, -1 }, - { MultiTexCoord2dARB_names, -1, 384 }, - { MultiTexCoord4dvARB_names, -1, 401 }, - { MultiTexCoord4fvARB_names, -1, 403 }, - { MultiTexCoord3fARB_names, -1, 394 }, - { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, -1 }, - { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, -1 }, - { MultiTexCoord4dARB_names, -1, 400 }, - { MultiTexCoord1sARB_names, -1, 382 }, - { MultiTexCoord1dvARB_names, -1, 377 }, - { MultiTexCoord1ivARB_names, -1, 381 }, - { MultiTexCoord2ivARB_names, -1, 389 }, - { MultiTexCoord1iARB_names, -1, 380 }, - { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, -1 }, - { MultiTexCoord4svARB_names, -1, 407 }, - { MultiTexCoord1fARB_names, -1, 378 }, - { MultiTexCoord4fARB_names, -1, 402 }, - { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, -1 }, - { MultiTexCoord2fvARB_names, -1, 387 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_1_4) -static const struct dri_extension_function GL_VERSION_1_4_functions[] = { - { PointParameteriNV_names, PointParameteriNV_remap_index, -1 }, - { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, - { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, - { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, - { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, -1 }, - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { FogCoorddEXT_names, FogCoorddEXT_remap_index, -1 }, - { FogCoordfEXT_names, FogCoordfEXT_remap_index, -1 }, - { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, - { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, - { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, -1 }, - { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, -1 }, - { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, -1 }, - { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, - { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, -1 }, - { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, -1 }, - { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, -1 }, - { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, - { PointParameterivNV_names, PointParameterivNV_remap_index, -1 }, - { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, - { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, -1 }, - { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, - { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, -1 }, - { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, - { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, - { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, -1 }, - { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, - { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, -1 }, - { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, -1 }, - { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, -1 }, - { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, - { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, -1 }, - { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, -1 }, - { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, -1 }, - { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, -1 }, - { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, -1 }, - { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, - { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, -1 }, - { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, - { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, -1 }, - { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, -1 }, - { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, - { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_1_5) -static const struct dri_extension_function GL_VERSION_1_5_functions[] = { - { BeginQueryARB_names, BeginQueryARB_remap_index, -1 }, - { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, -1 }, - { BufferSubDataARB_names, BufferSubDataARB_remap_index, -1 }, - { GetQueryivARB_names, GetQueryivARB_remap_index, -1 }, - { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, -1 }, - { BufferDataARB_names, BufferDataARB_remap_index, -1 }, - { EndQueryARB_names, EndQueryARB_remap_index, -1 }, - { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, -1 }, - { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, -1 }, - { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, -1 }, - { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, -1 }, - { IsQueryARB_names, IsQueryARB_remap_index, -1 }, - { MapBufferARB_names, MapBufferARB_remap_index, -1 }, - { GenQueriesARB_names, GenQueriesARB_remap_index, -1 }, - { IsBufferARB_names, IsBufferARB_remap_index, -1 }, - { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, -1 }, - { UnmapBufferARB_names, UnmapBufferARB_remap_index, -1 }, - { BindBufferARB_names, BindBufferARB_remap_index, -1 }, - { GenBuffersARB_names, GenBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_2_0) -static const struct dri_extension_function GL_VERSION_2_0_functions[] = { - { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, - { GetProgramiv_names, GetProgramiv_remap_index, -1 }, - { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, - { AttachShader_names, AttachShader_remap_index, -1 }, - { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, - { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, - { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, - { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, - { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, - { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, - { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, - { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, - { StencilMaskSeparate_names, StencilMaskSeparate_remap_index, -1 }, - { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, - { GetProgramInfoLog_names, GetProgramInfoLog_remap_index, -1 }, - { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, - { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, - { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, - { GetShaderInfoLog_names, GetShaderInfoLog_remap_index, -1 }, - { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, - { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, - { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, - { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, - { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, - { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, - { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, - { CreateProgram_names, CreateProgram_remap_index, -1 }, - { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 }, - { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, - { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, - { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, - { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, - { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, - { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, - { IsShader_names, IsShader_remap_index, -1 }, - { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, - { IsProgram_names, IsProgram_remap_index, -1 }, - { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, - { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, - { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, - { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, - { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, - { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, - { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, - { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, - { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, - { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, - { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, - { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, - { GetAttachedShaders_names, GetAttachedShaders_remap_index, -1 }, - { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, - { DeleteShader_names, DeleteShader_remap_index, -1 }, - { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, - { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, - { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, - { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, - { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, - { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, - { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, - { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, - { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, - { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, - { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, - { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, - { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, - { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, - { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, - { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, - { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, - { CreateShader_names, CreateShader_remap_index, -1 }, - { DetachShader_names, DetachShader_remap_index, -1 }, - { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, - { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, - { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, - { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, - { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, - { DeleteProgram_names, DeleteProgram_remap_index, -1 }, - { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, - { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, - { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, - { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, - { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, - { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, - { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, - { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, - { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, - { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, - { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, - { GetShaderiv_names, GetShaderiv_remap_index, -1 }, - { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, - { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, - { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, - { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_2_1) -static const struct dri_extension_function GL_VERSION_2_1_functions[] = { - { UniformMatrix2x4fv_names, UniformMatrix2x4fv_remap_index, -1 }, - { UniformMatrix4x3fv_names, UniformMatrix4x3fv_remap_index, -1 }, - { UniformMatrix4x2fv_names, UniformMatrix4x2fv_remap_index, -1 }, - { UniformMatrix2x3fv_names, UniformMatrix2x3fv_remap_index, -1 }, - { UniformMatrix3x4fv_names, UniformMatrix3x4fv_remap_index, -1 }, - { UniformMatrix3x2fv_names, UniformMatrix3x2fv_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - diff --git a/mesalib/src/mesa/drivers/dri/common/spantmp2.h b/mesalib/src/mesa/drivers/dri/common/spantmp2.h index 89c815722..447f3d15b 100644 --- a/mesalib/src/mesa/drivers/dri/common/spantmp2.h +++ b/mesalib/src/mesa/drivers/dri/common/spantmp2.h @@ -82,6 +82,72 @@ 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) /** @@ -147,6 +213,39 @@ 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) /** @@ -202,6 +301,118 @@ } 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) = (t << 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 + #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif diff --git a/mesalib/src/mesa/drivers/dri/common/texmem.c b/mesalib/src/mesa/drivers/dri/common/texmem.c index b64618a03..895139b55 100644 --- a/mesalib/src/mesa/drivers/dri/common/texmem.c +++ b/mesalib/src/mesa/drivers/dri/common/texmem.c @@ -42,14 +42,10 @@ * application. */ -#include "texmem.h" -#include "main/simple_list.h" #include "main/imports.h" #include "main/macros.h" -#include "main/texformat.h" - -#include - +#include "main/simple_list.h" +#include "texmem.h" static unsigned dummy_swap_counter; @@ -1302,46 +1298,44 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) /** - * \name DRI texture formats. Pointers initialized to either the big- or - * little-endian Mesa formats. + * \name DRI texture formats. These vars are initialized to either the + * big- or little-endian Mesa formats. */ /*@{*/ -const struct gl_texture_format *_dri_texformat_rgba8888 = NULL; -const struct gl_texture_format *_dri_texformat_argb8888 = NULL; -const struct gl_texture_format *_dri_texformat_rgb565 = NULL; -const struct gl_texture_format *_dri_texformat_argb4444 = NULL; -const struct gl_texture_format *_dri_texformat_argb1555 = NULL; -const struct gl_texture_format *_dri_texformat_al88 = NULL; -const struct gl_texture_format *_dri_texformat_a8 = &_mesa_texformat_a8; -const struct gl_texture_format *_dri_texformat_ci8 = &_mesa_texformat_ci8; -const struct gl_texture_format *_dri_texformat_i8 = &_mesa_texformat_i8; -const struct gl_texture_format *_dri_texformat_l8 = &_mesa_texformat_l8; +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 little endian target, host byte order independent texture formats + * Initialize _dri_texformat_* vars according to whether we're on + * a big or little endian system. */ void driInitTextureFormats(void) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); - - if (littleEndian) { - _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888; - _dri_texformat_argb8888 = &_mesa_texformat_argb8888; - _dri_texformat_rgb565 = &_mesa_texformat_rgb565; - _dri_texformat_argb4444 = &_mesa_texformat_argb4444; - _dri_texformat_argb1555 = &_mesa_texformat_argb1555; - _dri_texformat_al88 = &_mesa_texformat_al88; + 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_texformat_rgba8888_rev; - _dri_texformat_argb8888 = &_mesa_texformat_argb8888_rev; - _dri_texformat_rgb565 = &_mesa_texformat_rgb565_rev; - _dri_texformat_argb4444 = &_mesa_texformat_argb4444_rev; - _dri_texformat_argb1555 = &_mesa_texformat_argb1555_rev; - _dri_texformat_al88 = &_mesa_texformat_al88_rev; + _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/texmem.h b/mesalib/src/mesa/drivers/dri/common/texmem.h index 9c065da8b..725ba2e11 100644 --- a/mesalib/src/mesa/drivers/dri/common/texmem.h +++ b/mesalib/src/mesa/drivers/dri/common/texmem.h @@ -39,6 +39,7 @@ #define DRI_TEXMEM_H #include "main/mtypes.h" +#include "main/formats.h" #include "main/mm.h" #include "xf86drm.h" @@ -317,16 +318,16 @@ GLboolean driValidateTextureHeaps( driTexHeap * const * texture_heaps, extern void driCalculateTextureFirstLastLevel( driTextureObject * t ); -extern const struct gl_texture_format *_dri_texformat_rgba8888; -extern const struct gl_texture_format *_dri_texformat_argb8888; -extern const struct gl_texture_format *_dri_texformat_rgb565; -extern const struct gl_texture_format *_dri_texformat_argb4444; -extern const struct gl_texture_format *_dri_texformat_argb1555; -extern const struct gl_texture_format *_dri_texformat_al88; -extern const struct gl_texture_format *_dri_texformat_a8; -extern const struct gl_texture_format *_dri_texformat_ci8; -extern const struct gl_texture_format *_dri_texformat_i8; -extern const struct gl_texture_format *_dri_texformat_l8; +extern gl_format _dri_texformat_rgba8888; +extern gl_format _dri_texformat_argb8888; +extern gl_format _dri_texformat_rgb565; +extern gl_format _dri_texformat_argb4444; +extern gl_format _dri_texformat_argb1555; +extern gl_format _dri_texformat_al88; +extern gl_format _dri_texformat_a8; +extern gl_format _dri_texformat_ci8; +extern gl_format _dri_texformat_i8; +extern gl_format _dri_texformat_l8; extern void driInitTextureFormats( void ); diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c index 66f277c10..b272eb74e 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.c +++ b/mesalib/src/mesa/drivers/dri/common/utils.c @@ -38,9 +38,6 @@ #include "utils.h" -int driDispatchRemapTable[ driDispatchRemapTable_size ]; - - unsigned driParseDebugString( const char * debug, const struct dri_debug_control * control ) @@ -142,7 +139,7 @@ driGetRendererString( char * buffer, const char * hardware_name, #define need_GL_EXT_blend_func_separate #define need_GL_NV_vertex_program -#include "extension_helper.h" +#include "main/remap_helper.h" static const struct dri_extension all_mesa_extensions[] = { { "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions }, @@ -165,8 +162,12 @@ static const struct dri_extension all_mesa_extensions[] = { /** - * Enable extensions supported by the driver. + * Enable and map extensions supported by the driver. * + * When ctx is NULL, extensions are not enabled, but their functions + * are still mapped. When extensions_to_enable is NULL, all static + * functions known to mesa core are mapped. + * * \bug * ARB_imaging isn't handled properly. In Mesa, enabling ARB_imaging also * enables all the sub-extensions that are folded into it. This means that @@ -181,18 +182,23 @@ void driInitExtensions( GLcontext * ctx, unsigned i; if ( first_time ) { - for ( i = 0 ; i < driDispatchRemapTable_size ; i++ ) { - driDispatchRemapTable[i] = -1; - } - first_time = 0; - driInitExtensions( ctx, all_mesa_extensions, GL_FALSE ); + driInitExtensions( NULL, all_mesa_extensions, GL_FALSE ); } if ( (ctx != NULL) && enable_imaging ) { _mesa_enable_imaging_extensions( ctx ); } + /* The caller is too lazy to list any extension */ + if ( extensions_to_enable == NULL ) { + /* Map the static functions. Together with those mapped by remap + * table, this should cover everything mesa core knows. + */ + _mesa_map_static_functions(); + return; + } + for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) { driInitSingleExtension( ctx, & extensions_to_enable[i] ); } @@ -202,80 +208,18 @@ void driInitExtensions( GLcontext * ctx, /** - * Enable and add dispatch functions for a single extension + * Enable and map functions for a single extension * * \param ctx Context where extension is to be enabled. * \param ext Extension that is to be enabled. * - * \sa driInitExtensions, _mesa_enable_extension, _glapi_add_entrypoint - * - * \todo - * Determine if it would be better to use \c strlen instead of the hardcoded - * for-loops. + * \sa driInitExtensions, _mesa_enable_extension, _mesa_map_function_array */ void driInitSingleExtension( GLcontext * ctx, const struct dri_extension * ext ) { - unsigned i; - - if ( ext->functions != NULL ) { - for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) { - const char * functions[16]; - const char * parameter_signature; - const char * str = ext->functions[i].strings; - unsigned j; - unsigned offset; - - - /* Separate the parameter signature from the rest of the string. - * If the parameter signature is empty (i.e., the string starts - * with a NUL character), then the function has a void parameter - * list. - */ - parameter_signature = str; - while ( str[0] != '\0' ) { - str++; - } - str++; - - - /* Divide the string into the substrings that name each - * entry-point for the function. - */ - for ( j = 0 ; j < 16 ; j++ ) { - if ( str[0] == '\0' ) { - functions[j] = NULL; - break; - } - - functions[j] = str; - - while ( str[0] != '\0' ) { - str++; - } - str++; - } - - - /* Add each entry-point to the dispatch table. - */ - offset = _glapi_add_dispatch( functions, parameter_signature ); - if (offset == -1) { -#if 0 /* this causes noise with egl */ - fprintf(stderr, "DISPATCH ERROR! _glapi_add_dispatch failed " - "to add %s!\n", functions[0]); -#endif - } - else if (ext->functions[i].remap_index != -1) { - driDispatchRemapTable[ ext->functions[i].remap_index ] = - offset; - } - else if (ext->functions[i].offset != offset) { - fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n", - functions[0], offset, ext->functions[i].offset); - } - } + _mesa_map_function_array(ext->functions); } if ( ctx != NULL ) { diff --git a/mesalib/src/mesa/drivers/dri/common/utils.h b/mesalib/src/mesa/drivers/dri/common/utils.h index 9e9e5bc22..2aa6de66c 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.h +++ b/mesalib/src/mesa/drivers/dri/common/utils.h @@ -31,6 +31,7 @@ #include #include #include "main/context.h" +#include "main/remap.h" typedef struct __DRIutilversionRec2 __DRIutilversion2; @@ -39,35 +40,6 @@ struct dri_debug_control { unsigned flag; }; -/** - * Description of the entry-points and parameters for an OpenGL function. - */ -struct dri_extension_function { - /** - * \brief - * Packed string describing the parameter signature and the entry-point - * names. - * - * The parameter signature and the names of the entry-points for this - * function are packed into a single string. The substrings are - * separated by NUL characters. The whole string is terminated by - * two consecutive NUL characters. - */ - const char * strings; - - - /** - * Location in the remap table where the dispatch offset should be - * stored. - */ - int remap_index; - - /** - * Offset of the function in the dispatch table. - */ - int offset; -}; - /** * Description of the API for an extension to OpenGL. */ @@ -83,7 +55,7 @@ struct dri_extension { * is terminated by a structure with a \c NULL * \c dri_extension_function::strings pointer. */ - const struct dri_extension_function * functions; + const struct gl_function_remap * functions; }; /** diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py b/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py deleted file mode 100644 index 7398c4cd0..000000000 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/python - -import sys -import gettext -import re - -# List of supported languages -languages = sys.argv[1:] - -# Escape special characters in C strings -def escapeCString (s): - escapeSeqs = {'\a' : '\\a', '\b' : '\\b', '\f' : '\\f', '\n' : '\\n', - '\r' : '\\r', '\t' : '\\t', '\v' : '\\v', '\\' : '\\\\'} - # " -> '' is a hack. Quotes (") aren't possible in XML attributes. - # Better use Unicode characters for typographic quotes in option - # descriptions and translations. - i = 0 - r = '' - while i < len(s): - # Special case: escape double quote with \u201c or \u201d, depending - # on whether it's an open or close quote. This is needed because plain - # double quotes are not possible in XML attributes. - if s[i] == '"': - if i == len(s)-1 or s[i+1].isspace(): - # close quote - q = u'\u201c' - else: - # open quote - q = u'\u201d' - r = r + q - elif escapeSeqs.has_key(s[i]): - r = r + escapeSeqs[s[i]] - else: - r = r + s[i] - i = i + 1 - return r - -# Expand escape sequences in C strings (needed for gettext lookup) -def expandCString (s): - escapeSeqs = {'a' : '\a', 'b' : '\b', 'f' : '\f', 'n' : '\n', - 'r' : '\r', 't' : '\t', 'v' : '\v', - '"' : '"', '\\' : '\\'} - i = 0 - escape = False - hexa = False - octa = False - num = 0 - digits = 0 - r = '' - while i < len(s): - if not escape: - if s[i] == '\\': - escape = True - else: - r = r + s[i] - elif hexa: - if (s[i] >= '0' and s[i] <= '9') or \ - (s[i] >= 'a' and s[i] <= 'f') or \ - (s[i] >= 'A' and s[i] <= 'F'): - num = num * 16 + int(s[i],16) - digits = digits + 1 - else: - digits = 2 - if digits >= 2: - hexa = False - escape = False - r = r + chr(num) - elif octa: - if s[i] >= '0' and s[i] <= '7': - num = num * 8 + int(s[i],8) - digits = digits + 1 - else: - digits = 3 - if digits >= 3: - octa = False - escape = False - r = r + chr(num) - else: - if escapeSeqs.has_key(s[i]): - r = r + escapeSeqs[s[i]] - escape = False - elif s[i] >= '0' and s[i] <= '7': - octa = True - num = int(s[i],8) - if num <= 3: - digits = 1 - else: - digits = 2 - elif s[i] == 'x' or s[i] == 'X': - hexa = True - num = 0 - digits = 0 - else: - r = r + s[i] - escape = False - i = i + 1 - return r - -# Expand matches. The first match is always a DESC or DESC_BEGIN match. -# Subsequent matches are ENUM matches. -# -# DESC, DESC_BEGIN format: \1 \2= \3 \4=gettext(" \5= \6=") \7 -# ENUM format: \1 \2=gettext(" \3= \4=") \5 -def expandMatches (matches, translations, end=None): - assert len(matches) > 0 - nTranslations = len(translations) - i = 0 - # Expand the description+enums for all translations - for lang,trans in translations: - i = i + 1 - # Make sure that all but the last line of a simple description - # are extended with a backslash. - suffix = '' - if len(matches) == 1 and i < len(translations) and \ - not matches[0].expand (r'\7').endswith('\\'): - suffix = ' \\' - # Expand the description line. Need to use ugettext in order to allow - # non-ascii unicode chars in the original English descriptions. - text = escapeCString (trans.ugettext (unicode (expandCString ( - matches[0].expand (r'\5')), "utf-8"))).encode("utf-8") - print matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix - # Expand any subsequent enum lines - for match in matches[1:]: - text = escapeCString (trans.ugettext (unicode (expandCString ( - match.expand (r'\3')), "utf-8"))).encode("utf-8") - print match.expand (r'\1"' + text + r'"\5') - - # Expand description end - if end: - print end, - -# Compile a list of translation classes to all supported languages. -# The first translation is always a NullTranslations. -translations = [("en", gettext.NullTranslations())] -for lang in languages: - try: - trans = gettext.translation ("options", ".", [lang]) - except IOError: - sys.stderr.write ("Warning: language '%s' not found.\n" % lang) - continue - translations.append ((lang, trans)) - -# Regular expressions: -reLibintl_h = re.compile (r'#\s*include\s*') -reDESC = re.compile (r'(\s*DRI_CONF_DESC\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') -reDESC_BEGIN = re.compile (r'(\s*DRI_CONF_DESC_BEGIN\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') -reENUM = re.compile (r'(\s*DRI_CONF_ENUM\s*\([^,]+,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') -reDESC_END = re.compile (r'\s*DRI_CONF_DESC_END') - -# Print a header -print \ -"/***********************************************************************\n" \ -" *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! ***\n" \ -" ***********************************************************************/" - -# Process the options template and generate options.h with all -# translations. -template = file ("t_options.h", "r") -descMatches = [] -for line in template: - if len(descMatches) > 0: - matchENUM = reENUM .match (line) - matchDESC_END = reDESC_END.match (line) - if matchENUM: - descMatches.append (matchENUM) - elif matchDESC_END: - expandMatches (descMatches, translations, line) - descMatches = [] - else: - sys.stderr.write ( - "Warning: unexpected line inside description dropped:\n%s\n" \ - % line) - continue - if reLibintl_h.search (line): - # Ignore (comment out) #include - print "/* %s * commented out by gen_xmlpool.py */" % line - continue - matchDESC = reDESC .match (line) - matchDESC_BEGIN = reDESC_BEGIN.match (line) - if matchDESC: - assert len(descMatches) == 0 - expandMatches ([matchDESC], translations) - elif matchDESC_BEGIN: - assert len(descMatches) == 0 - descMatches = [matchDESC_BEGIN] - else: - print line, - -if len(descMatches) > 0: - sys.stderr.write ("Warning: unterminated description at end of file.\n") - expandMatches (descMatches, translations) diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile b/mesalib/src/mesa/drivers/dri/swrast/Makefile index 5f3a4f219..771169c1f 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile +++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile @@ -21,4 +21,3 @@ SWRAST_COMMON_SOURCES = \ include ../Makefile.template -symlinks: diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index a858af30c..8340861af 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -33,6 +33,7 @@ #include "main/context.h" #include "main/extensions.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/imports.h" #include "main/renderbuffer.h" @@ -43,78 +44,12 @@ #include "tnl/t_pipeline.h" #include "vbo/vbo.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "utils.h" #include "swrast_priv.h" -#define need_GL_VERSION_1_3 -#define need_GL_VERSION_1_4 -#define need_GL_VERSION_1_5 -#define need_GL_VERSION_2_0 -#define need_GL_VERSION_2_1 - -/* sw extensions for imaging */ -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_minmax -#define need_GL_EXT_convolution -#define need_GL_EXT_histogram -#define need_GL_SGI_color_table - -/* sw extensions not associated with some GL version */ -#define need_GL_ARB_shader_objects -#define need_GL_ARB_vertex_array_object -#define need_GL_ARB_vertex_program -#define need_GL_ARB_sync -#define need_GL_APPLE_vertex_array_object -#define need_GL_ATI_fragment_shader -#define need_GL_ATI_separate_stencil -#define need_GL_EXT_depth_bounds_test -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_framebuffer_blit -#define need_GL_EXT_gpu_program_parameters -#define need_GL_EXT_paletted_texture -#define need_GL_EXT_stencil_two_side -#define need_GL_MESA_resize_buffers -#define need_GL_NV_vertex_program -#define need_GL_NV_fragment_program - -#include "extension_helper.h" - -const struct dri_extension card_extensions[] = -{ - { "GL_VERSION_1_3", GL_VERSION_1_3_functions }, - { "GL_VERSION_1_4", GL_VERSION_1_4_functions }, - { "GL_VERSION_1_5", GL_VERSION_1_5_functions }, - { "GL_VERSION_2_0", GL_VERSION_2_0_functions }, - { "GL_VERSION_2_1", GL_VERSION_2_1_functions }, - - { "GL_EXT_blend_color", GL_EXT_blend_color_functions }, - { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, - { "GL_EXT_convolution", GL_EXT_convolution_functions }, - { "GL_EXT_histogram", GL_EXT_histogram_functions }, - { "GL_SGI_color_table", GL_SGI_color_table_functions }, - - { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, - { "GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions }, - { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, - { "GL_ARB_sync", GL_ARB_sync_functions }, - { "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions }, - { "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions }, - { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, - { "GL_EXT_depth_bounds_test", GL_EXT_depth_bounds_test_functions }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, - { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, - { "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions }, - { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions }, - { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, - { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, - { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, - { "GL_NV_fragment_program", GL_NV_fragment_program_functions }, - { NULL, NULL } -}; - - /** * Screen and config-related functions */ @@ -238,7 +173,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, *driver_configs = (const __DRIconfig **) driConcatConfigs(configs24, configs32); - driInitExtensions( NULL, card_extensions, GL_FALSE ); + driInitExtensions( NULL, NULL, GL_FALSE ); return psp; } @@ -372,50 +307,38 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) 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->Base.RedBits = 8 * sizeof(GLubyte); - xrb->Base.GreenBits = 8 * sizeof(GLubyte); - xrb->Base.BlueBits = 8 * sizeof(GLubyte); - xrb->Base.AlphaBits = 8 * sizeof(GLubyte); 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->Base.RedBits = 8 * sizeof(GLubyte); - xrb->Base.GreenBits = 8 * sizeof(GLubyte); - xrb->Base.BlueBits = 8 * sizeof(GLubyte); - xrb->Base.AlphaBits = 0; 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->Base.RedBits = 5 * sizeof(GLubyte); - xrb->Base.GreenBits = 6 * sizeof(GLubyte); - xrb->Base.BlueBits = 5 * sizeof(GLubyte); - xrb->Base.AlphaBits = 0; 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->Base.RedBits = 3 * sizeof(GLubyte); - xrb->Base.GreenBits = 3 * sizeof(GLubyte); - xrb->Base.BlueBits = 2 * sizeof(GLubyte); - xrb->Base.AlphaBits = 0; xrb->bpp = 8; break; case PF_CI8: + xrb->Base.Format = MESA_FORMAT_CI8; xrb->Base.InternalFormat = GL_COLOR_INDEX8_EXT; xrb->Base._BaseFormat = GL_COLOR_INDEX; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.IndexBits = 8 * sizeof(GLubyte); xrb->bpp = 8; break; default: @@ -645,6 +568,8 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, _mesa_enable_2_0_extensions(mesaCtx); _mesa_enable_2_1_extensions(mesaCtx); + _mesa_meta_init(mesaCtx); + return ctx; } @@ -656,6 +581,7 @@ driDestroyContext(__DRIcontext *ctx) if (ctx) { mesaCtx = &ctx->Base; + _mesa_meta_free(mesaCtx); _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c b/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c index 2d3c25dcb..f8e503463 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c @@ -63,56 +63,42 @@ static const GLubyte kernel[16] = { /* 32-bit BGRA */ #define STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = VALUE[ACOMP]; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = VALUE[ACOMP] << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define STORE_PIXEL_RGB_A8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define FETCH_PIXEL_A8R8G8B8(DST, SRC) \ - DST[ACOMP] = SRC[3]; \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0] + DST[ACOMP] = *SRC >> 24; \ + DST[RCOMP] = (*SRC >> 16) & 0xff; \ + DST[GCOMP] = (*SRC >> 8) & 0xff; \ + DST[BCOMP] = *SRC & 0xff /* 32-bit BGRX */ #define STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define FETCH_PIXEL_X8R8G8B8(DST, SRC) \ - DST[ACOMP] = 0xff; \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0] + DST[ACOMP] = 0xff; \ + DST[RCOMP] = (*SRC >> 16) & 0xff; \ + DST[GCOMP] = (*SRC >> 8) & 0xff; \ + DST[BCOMP] = *SRC & 0xff /* 16-bit BGR */ #define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \ do { \ int d = DITHER_COMP(X, Y) >> 6; \ - GLushort *p = (GLushort *)DST; \ - *p = ( ((DITHER_CLAMP((VALUE[RCOMP]) + d) & 0xf8) << 8) | \ - ((DITHER_CLAMP((VALUE[GCOMP]) + d) & 0xfc) << 3) | \ - ((DITHER_CLAMP((VALUE[BCOMP]) + d) & 0xf8) >> 3) ); \ + *DST = ( ((DITHER_CLAMP((VALUE[RCOMP]) + d) & 0xf8) << 8) | \ + ((DITHER_CLAMP((VALUE[GCOMP]) + d) & 0xfc) << 3) | \ + ((DITHER_CLAMP((VALUE[BCOMP]) + d) & 0xf8) >> 3) ); \ } while(0) #define FETCH_PIXEL_R5G6B5(DST, SRC) \ do { \ - GLushort p = *(GLushort *)SRC; \ DST[ACOMP] = 0xff; \ - DST[RCOMP] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ - DST[GCOMP] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ - DST[BCOMP] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + DST[RCOMP] = ((*SRC >> 8) & 0xf8) * 255 / 0xf8; \ + DST[GCOMP] = ((*SRC >> 3) & 0xfc) * 255 / 0xfc; \ + DST[BCOMP] = ((*SRC << 3) & 0xf8) * 255 / 0xf8; \ } while(0) @@ -145,8 +131,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 4 + (X) +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -163,8 +149,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 4 + (X); +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -181,8 +167,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 2; -#define INC_PIXEL_PTR(P) P += 2 + GLushort *P = (GLushort *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 2 + (X); +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) #define FETCH_PIXEL(DST, SRC) \ @@ -234,8 +220,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)row; +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -252,8 +238,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)row; +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -270,7 +256,7 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; + GLushort *P = (GLushort *)row; #define INC_PIXEL_PTR(P) P += 2 #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) diff --git a/mesalib/src/mesa/drivers/windows/fx/fx.rc b/mesalib/src/mesa/drivers/windows/fx/fx.rc deleted file mode 100644 index f920b8768..000000000 --- a/mesalib/src/mesa/drivers/windows/fx/fx.rc +++ /dev/null @@ -1,39 +0,0 @@ -#include - -#define PRODNAME "Mesa 6.x" -#define CONTACTSTR "http://www.mesa3d.org" -#define HWSTR "3dfx Voodoo Graphics, Voodoo Rush, Voodoo^2, Voodoo Banshee, Velocity 100/200, Voodoo3, Voodoo4, Voodoo5" -#define COPYRIGHTSTR "Copyright \251 Brian E. Paul" - -#define VERSIONSTR "6.3.0.1" -#define MANVERSION 6 -#define MANREVISION 3 -#define BUILD_NUMBER 1 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER - PRODUCTVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER - FILEFLAGSMASK 0x0030003FL - - FILEOS VOS_DOS_WINDOWS32 - FILETYPE VFT_DRV - FILESUBTYPE VFT2_DRV_INSTALLABLE -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "FileDescription", PRODNAME - VALUE "FileVersion", VERSIONSTR - VALUE "LegalCopyright", COPYRIGHTSTR - VALUE "ProductName", PRODNAME - VALUE "Graphics Subsystem", HWSTR - VALUE "Contact", CONTACTSTR - END - END - BLOCK "VarFileInfo" - BEGIN - /* the following line should be extended for localized versions */ - VALUE "Translation", 0x409, 1252 - END -END diff --git a/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp b/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp deleted file mode 100644 index 7145bffa5..000000000 --- a/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "glapi.h" -#include "glThread.h" - -#ifdef WIN32_THREADS -extern "C" _glthread_Mutex OneTimeLock; -extern "C" _glthread_Mutex GenTexturesLock; - -extern "C" void FreeAllTSD(void); - -class _CriticalSectionInit -{ -public: - static _CriticalSectionInit m_inst; - - _CriticalSectionInit() - { - _glthread_INIT_MUTEX(OneTimeLock); - _glthread_INIT_MUTEX(GenTexturesLock); - } - - ~_CriticalSectionInit() - { - _glthread_DESTROY_MUTEX(OneTimeLock); - _glthread_DESTROY_MUTEX(GenTexturesLock); - FreeAllTSD(); - } -}; - -_CriticalSectionInit _CriticalSectionInit::m_inst; - - -#endif diff --git a/mesalib/src/mesa/drivers/windows/gdi/mesa.def b/mesalib/src/mesa/drivers/windows/gdi/mesa.def index 05817fde1..62f75d954 100644 --- a/mesalib/src/mesa/drivers/windows/gdi/mesa.def +++ b/mesalib/src/mesa/drivers/windows/gdi/mesa.def @@ -932,6 +932,16 @@ EXPORTS _mesa_update_framebuffer_visual _mesa_use_program _mesa_Viewport + _mesa_meta_CopyColorSubTable + _mesa_meta_CopyColorTable + _mesa_meta_CopyConvolutionFilter1D + _mesa_meta_CopyConvolutionFilter2D + _mesa_meta_CopyTexImage1D + _mesa_meta_CopyTexImage2D + _mesa_meta_CopyTexSubImage1D + _mesa_meta_CopyTexSubImage2D + _mesa_meta_CopyTexSubImage3D + _mesa_wait_query _swrast_Accum _swrast_Bitmap _swrast_BlitFramebuffer @@ -941,15 +951,6 @@ EXPORTS _swrast_Clear _swrast_choose_line _swrast_choose_triangle - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_CopyConvolutionFilter1D - _swrast_CopyConvolutionFilter2D - _swrast_copy_teximage1d - _swrast_copy_teximage2d - _swrast_copy_texsubimage1d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext _swrast_exec_fragment_program diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c index e1971db69..8929b22af 100644 --- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c +++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c @@ -12,6 +12,7 @@ #include "framebuffer.h" #include "renderbuffer.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" @@ -1515,6 +1516,8 @@ WMesaContext WMesaCreateContext(HDC hDC, _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) || @@ -1558,6 +1561,8 @@ void WMesaDestroyContext( WMesaContext pwc ) DeleteObject(pwc->clearPen); DeleteObject(pwc->clearBrush); + _mesa_meta_free(ctx); + _swsetup_DestroyContext(ctx); _tnl_DestroyContext(ctx); _vbo_DestroyContext(ctx); diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c deleted file mode 100644 index d5fa64280..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c +++ /dev/null @@ -1,1196 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Driver interface code to Mesa -* -****************************************************************************/ - -//#include -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx7.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -extern BOOL dglSwapBuffers(HDC hDC); - -// HACK: Hack the _33 member of the OpenGL perspective projection matrix -const float _fPersp_33 = 1.6f; - -//--------------------------------------------------------------------------- -// Internal functions -//--------------------------------------------------------------------------- - -void _gld_mesa_warning( - __GLcontext *gc, - char *str) -{ - // Intercept Mesa's internal warning mechanism - gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str); -} - -//--------------------------------------------------------------------------- - -void _gld_mesa_fatal( - __GLcontext *gc, - char *str) -{ - // Intercept Mesa's internal fatal-message mechanism - gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str); - - // Mesa calls abort(0) here. - ddlogClose(); - exit(0); -} - -//--------------------------------------------------------------------------- - -D3DSTENCILOP _gldConvertStencilOp( - GLenum StencilOp) -{ - // Used by Stencil: pass, fail and zfail - - switch (StencilOp) { - case GL_KEEP: - return D3DSTENCILOP_KEEP; - case GL_ZERO: - return D3DSTENCILOP_ZERO; - case GL_REPLACE: - return D3DSTENCILOP_REPLACE; - case GL_INCR: - return D3DSTENCILOP_INCRSAT; - case GL_DECR: - return D3DSTENCILOP_DECRSAT; - case GL_INVERT: - return D3DSTENCILOP_INVERT; - case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap - return D3DSTENCILOP_INCR; - case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap - return D3DSTENCILOP_DECR; - } - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n"); -#endif - - return D3DSTENCILOP_KEEP; -} - -//--------------------------------------------------------------------------- - -D3DCMPFUNC _gldConvertCompareFunc( - GLenum CmpFunc) -{ - // Used for Alpha func, depth func and stencil func. - - switch (CmpFunc) { - case GL_NEVER: - return D3DCMP_NEVER; - case GL_LESS: - return D3DCMP_LESS; - case GL_EQUAL: - return D3DCMP_EQUAL; - case GL_LEQUAL: - return D3DCMP_LESSEQUAL; - case GL_GREATER: - return D3DCMP_GREATER; - case GL_NOTEQUAL: - return D3DCMP_NOTEQUAL; - case GL_GEQUAL: - return D3DCMP_GREATEREQUAL; - case GL_ALWAYS: - return D3DCMP_ALWAYS; - }; - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n"); -#endif - - return D3DCMP_ALWAYS; -} - -//--------------------------------------------------------------------------- - -D3DBLEND _gldConvertBlendFunc( - GLenum blend, - GLenum DefaultBlend) -{ - switch (blend) { - case GL_ZERO: - return D3DBLEND_ZERO; - case GL_ONE: - return D3DBLEND_ONE; - case GL_DST_COLOR: - return D3DBLEND_DESTCOLOR; - case GL_SRC_COLOR: - return D3DBLEND_SRCCOLOR; - case GL_ONE_MINUS_DST_COLOR: - return D3DBLEND_INVDESTCOLOR; - case GL_ONE_MINUS_SRC_COLOR: - return D3DBLEND_INVSRCCOLOR; - case GL_SRC_ALPHA: - return D3DBLEND_SRCALPHA; - case GL_ONE_MINUS_SRC_ALPHA: - return D3DBLEND_INVSRCALPHA; - case GL_DST_ALPHA: - return D3DBLEND_DESTALPHA; - case GL_ONE_MINUS_DST_ALPHA: - return D3DBLEND_INVDESTALPHA; - case GL_SRC_ALPHA_SATURATE: - return D3DBLEND_SRCALPHASAT; - } - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n"); -#endif - - return DefaultBlend; -} - -//--------------------------------------------------------------------------- -// Misc. functions -//--------------------------------------------------------------------------- - -void gld_Noop_DX7( - GLcontext *ctx) -{ -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n"); -#endif -} - -//--------------------------------------------------------------------------- - -void gld_Error_DX7( - GLcontext *ctx) -{ -#ifdef _DEBUG - // Quite useless. -// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n"); -#endif -} - -//--------------------------------------------------------------------------- -// Required Mesa functions -//--------------------------------------------------------------------------- - -static GLboolean gld_set_draw_buffer_DX7( - GLcontext *ctx, - GLenum mode) -{ - (void) ctx; - if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - -//--------------------------------------------------------------------------- - -static void gld_set_read_buffer_DX7( - GLcontext *ctx, - GLframebuffer *buffer, - GLenum mode) -{ - /* separate read buffer not supported */ -/* - ASSERT(buffer == ctx->DrawBuffer); - ASSERT(mode == GL_FRONT_LEFT); -*/ -} - -//--------------------------------------------------------------------------- - -void gld_Clear_DX7( - GLcontext *ctx, - GLbitfield mask, - GLboolean all, - GLint x, - GLint y, - GLint width, - GLint height) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - DWORD dwFlags = 0; - D3DCOLOR Color = 0; - float Z = 0.0f; - DWORD Stencil = 0; - D3DRECT d3dClearRect; - - // TODO: Colourmask - const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; - - if (!gld->pDev) - return; - - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { - GLubyte col[4]; - CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]); - CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]); - dwFlags |= D3DCLEAR_TARGET; - Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]); -// ctx->Color.ClearColor[1], -// ctx->Color.ClearColor[2], -// ctx->Color.ClearColor[3]); - } - - if (mask & DD_DEPTH_BIT) { - // D3D7 will fail the Clear call if we try and clear a - // depth buffer and we haven't created one. - // Also, some apps try and clear a depth buffer, - // when a depth buffer hasn't been requested by the app. - if (ctx->Visual.depthBits == 0) { - mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask - } else { - dwFlags |= D3DCLEAR_ZBUFFER; - Z = ctx->Depth.Clear; - } - } - - if (mask & DD_STENCIL_BIT) { - if (ctx->Visual.stencilBits == 0) { - // No stencil bits in depth buffer - mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask - } else { - dwFlags |= D3DCLEAR_STENCIL; - Stencil = ctx->Stencil.Clear; - } - } - - // Some apps do really weird things with the rect, such as Quake3. - if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) { - all = GL_TRUE; - } - - if (!all) { - // Calculate clear subrect - d3dClearRect.x1 = x; - d3dClearRect.y1 = gldCtx->dwHeight - (y + height); - d3dClearRect.x2 = x + width; - d3dClearRect.y2 = d3dClearRect.y1 + height; - } - - // dwFlags will be zero if there's nothing to clear - if (dwFlags) { - _GLD_DX7_DEV(Clear( - gld->pDev, - all ? 0 : 1, - all ? NULL : &d3dClearRect, - dwFlags, - Color, Z, Stencil)); - } - - if (mask & DD_ACCUM_BIT) { - // Clear accumulation buffer - } -} - -//--------------------------------------------------------------------------- - -// Mesa 5: Parameter change -static void gld_buffer_size_DX7( -// GLcontext *ctx, - GLframebuffer *fb, - GLuint *width, - GLuint *height) -{ -// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - - *width = fb->Width; // gldCtx->dwWidth; - *height = fb->Height; // gldCtx->dwHeight; -} - -//--------------------------------------------------------------------------- - -static void gld_Finish_DX7( - GLcontext *ctx) -{ -} - -//--------------------------------------------------------------------------- - -static void gld_Flush_DX7( - GLcontext *ctx) -{ - GLD_context *gld = GLD_GET_CONTEXT(ctx); - - // TODO: Detect apps that glFlush() then SwapBuffers() ? - - if (gld->EmulateSingle) { - // Emulating a single-buffered context. - // [Direct3D doesn't allow rendering to front buffer] - dglSwapBuffers(gld->hDC); - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_STENCIL( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - // Two-sided stencil. New for Mesa 5 - const GLuint uiFace = 0UL; - - struct gl_stencil_attrib *pStencil = &ctx->Stencil; - - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE)); - if (pStencil->Enabled) { - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace]))); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILREF, pStencil->Ref[uiFace])); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILMASK, pStencil->ValueMask[uiFace])); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILWRITEMASK, pStencil->WriteMask[uiFace])); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace]))); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace]))); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace]))); - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_COLOR( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - DWORD dwFlags = 0; - D3DBLEND src; - D3DBLEND dest; - - // Alpha func - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc))); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAREF, (DWORD)ctx->Color.AlphaRef)); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHATESTENABLE, ctx->Color.AlphaEnabled)); - - // Blend func - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHABLENDENABLE, ctx->Color.BlendEnabled)); - src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE); - dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SRCBLEND, src)); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_DESTBLEND, dest)); - -/* - // Color mask - unsupported by DX7 - if (ctx->Color.ColorMask[0]) dwFlags |= D3DCOLORWRITEENABLE_RED; - if (ctx->Color.ColorMask[1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN; - if (ctx->Color.ColorMask[2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE; - if (ctx->Color.ColorMask[3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA; - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_COLORWRITEENABLE, dwFlags)); -*/ -} - -//--------------------------------------------------------------------------- - -void gld_NEW_DEPTH( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE)); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func))); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_POLYGON( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DFILLMODE d3dFillMode = D3DFILL_SOLID; - D3DCULL d3dCullMode = D3DCULL_NONE; - int iOffset = 0; - - // Fillmode - switch (ctx->Polygon.FrontMode) { - case GL_POINT: - d3dFillMode = D3DFILL_POINT; - break; - case GL_LINE: - d3dFillMode = D3DFILL_WIREFRAME; - break; - case GL_FILL: - d3dFillMode = D3DFILL_SOLID; - break; - } - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FILLMODE, d3dFillMode)); - - if (ctx->Polygon.CullFlag) { - switch (ctx->Polygon.CullFaceMode) { - case GL_BACK: - if (ctx->Polygon.FrontFace == GL_CCW) - d3dCullMode = D3DCULL_CW; - else - d3dCullMode = D3DCULL_CCW; - break; - case GL_FRONT: - if (ctx->Polygon.FrontFace == GL_CCW) - d3dCullMode = D3DCULL_CCW; - else - d3dCullMode = D3DCULL_CW; - break; - case GL_FRONT_AND_BACK: - d3dCullMode = D3DCULL_NONE; - break; - default: - break; - } - } else { - d3dCullMode = D3DCULL_NONE; - } -// d3dCullMode = D3DCULL_NONE; // TODO: DEBUGGING - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CULLMODE, d3dCullMode)); - - // Polygon offset - // ZBIAS ranges from 0 to 16 and can only move towards the viewer - // Mesa5: ctx->Polygon._OffsetAny removed - if (ctx->Polygon.OffsetFill) { - iOffset = (int)ctx->Polygon.OffsetUnits; - if (iOffset < 0) - iOffset = -iOffset; - else - iOffset = 0; // D3D can't push away - } - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_ZBIAS, iOffset)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_FOG( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DCOLOR d3dFogColour; - D3DFOGMODE d3dFogMode = D3DFOG_LINEAR; - - // TODO: Fog is calculated seperately in the Mesa pipeline - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGENABLE, FALSE)); - return; - - // Fog enable - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGENABLE, ctx->Fog.Enabled)); - if (!ctx->Fog.Enabled) { - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE)); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE)); - return; // If disabled, don't bother setting any fog state - } - - // Fog colour - d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0], - ctx->Fog.Color[1], - ctx->Fog.Color[2], - ctx->Fog.Color[3]); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGCOLOR, d3dFogColour)); - - // Fog density - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density)))); - - // Fog start - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGSTART, *((DWORD*) (&ctx->Fog.Start)))); - - // Fog end - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGEND, *((DWORD*) (&ctx->Fog.End)))); - - // Fog mode - switch (ctx->Fog.Mode) { - case GL_LINEAR: - d3dFogMode = D3DFOG_LINEAR; - break; - case GL_EXP: - d3dFogMode = D3DFOG_EXP; - break; - case GL_EXP2: - d3dFogMode = D3DFOG_EXP2; - break; - } - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGTABLEMODE, d3dFogMode)); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_LIGHT( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - DWORD dwSpecularEnable; - - // Shademode - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT)); - - // Separate specular colour - if (ctx->Light.Enabled) - dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE; - else - dwSpecularEnable = FALSE; - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SPECULARENABLE, dwSpecularEnable)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_MODELVIEW( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DMATRIX m; - //GLfloat *pM = ctx->ModelView.m; - // Mesa5: Model-view is now a stack - GLfloat *pM = ctx->ModelviewMatrixStack.Top->m; - m._11 = pM[0]; - m._12 = pM[1]; - m._13 = pM[2]; - m._14 = pM[3]; - m._21 = pM[4]; - m._22 = pM[5]; - m._23 = pM[6]; - m._24 = pM[7]; - m._31 = pM[8]; - m._32 = pM[9]; - m._33 = pM[10]; - m._34 = pM[11]; - m._41 = pM[12]; - m._42 = pM[13]; - m._43 = pM[14]; - m._44 = pM[15]; -/* m[0][0] = pM[0]; - m[0][1] = pM[1]; - m[0][2] = pM[2]; - m[0][3] = pM[3]; - m[1][0] = pM[4]; - m[1][1] = pM[5]; - m[1][2] = pM[6]; - m[1][3] = pM[7]; - m[2][0] = pM[8]; - m[2][1] = pM[9]; - m[2][2] = pM[10]; - m[2][3] = pM[11]; - m[3][0] = pM[12]; - m[3][1] = pM[13]; - m[3][2] = pM[14]; - m[3][3] = pM[15];*/ - - gld->matModelView = m; -} - -//--------------------------------------------------------------------------- - -void gld_NEW_PROJECTION( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DMATRIX m; - //GLfloat *pM = ctx->ProjectionMatrix.m; - // Mesa 5: Now a stack - GLfloat *pM = ctx->ProjectionMatrixStack.Top->m; - m._11 = pM[0]; - m._12 = pM[1]; - m._13 = pM[2]; - m._14 = pM[3]; - - m._21 = pM[4]; - m._22 = pM[5]; - m._23 = pM[6]; - m._24 = pM[7]; - - m._31 = pM[8]; - m._32 = pM[9]; - m._33 = pM[10] / _fPersp_33; // / 1.6f; - m._34 = pM[11]; - - m._41 = pM[12]; - m._42 = pM[13]; - m._43 = pM[14] / 2.0f; - m._44 = pM[15]; - - gld->matProjection = m; -} - -//--------------------------------------------------------------------------- -/* -void gldFrustumHook_DX7( - GLdouble left, - GLdouble right, - GLdouble bottom, - GLdouble top, - GLdouble nearval, - GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - // Pass values on to Mesa first (in case we mess with them) - _mesa_Frustum(left, right, bottom, top, nearval, farval); - - _fPersp_33 = farval / (nearval - farval); - -// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval); -} - -//--------------------------------------------------------------------------- - -void gldOrthoHook_DX7( - GLdouble left, - GLdouble right, - GLdouble bottom, - GLdouble top, - GLdouble nearval, - GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - // Pass values on to Mesa first (in case we mess with them) - _mesa_Ortho(left, right, bottom, top, nearval, farval); - - _fPersp_33 = 1.6f; - -// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval); -} -*/ -//--------------------------------------------------------------------------- - -void gld_NEW_VIEWPORT( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DVIEWPORT7 d3dvp; -// GLint x, y; -// GLsizei w, h; - - // Set depth range - _GLD_DX7_DEV(GetViewport(gld->pDev, &d3dvp)); - // D3D can't do Quake1/Quake2 z-trick - if (ctx->Viewport.Near <= ctx->Viewport.Far) { - d3dvp.dvMinZ = ctx->Viewport.Near; - d3dvp.dvMaxZ = ctx->Viewport.Far; - } else { - d3dvp.dvMinZ = ctx->Viewport.Far; - d3dvp.dvMaxZ = ctx->Viewport.Near; - } -/* x = ctx->Viewport.X; - y = ctx->Viewport.Y; - w = ctx->Viewport.Width; - h = ctx->Viewport.Height; - if (x < 0) x = 0; - if (y < 0) y = 0; - if (w > gldCtx->dwWidth) w = gldCtx->dwWidth; - if (h > gldCtx->dwHeight) h = gldCtx->dwHeight; - // Ditto for D3D viewport dimensions - if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x; - if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y; - d3dvp.X = x; - d3dvp.Y = gldCtx->dwHeight - (y + h); - d3dvp.Width = w; - d3dvp.Height = h;*/ - _GLD_DX7_DEV(SetViewport(gld->pDev, &d3dvp)); - -// gld->fFlipWindowY = (float)gldCtx->dwHeight; -} - -//--------------------------------------------------------------------------- - -__inline BOOL _gldAnyEvalEnabled( - GLcontext *ctx) -{ - struct gl_eval_attrib *eval = &ctx->Eval; - - if ((eval->AutoNormal) || - (eval->Map1Color4) || - (eval->Map1Index) || - (eval->Map1Normal) || - (eval->Map1TextureCoord1) || - (eval->Map1TextureCoord2) || - (eval->Map1TextureCoord3) || - (eval->Map1TextureCoord4) || - (eval->Map1Vertex3) || - (eval->Map1Vertex4) || - (eval->Map2Color4) || - (eval->Map2Index) || - (eval->Map2Normal) || - (eval->Map2TextureCoord1) || - (eval->Map2TextureCoord2) || - (eval->Map2TextureCoord3) || - (eval->Map2TextureCoord4) || - (eval->Map2Vertex3) || - (eval->Map2Vertex4) - ) - return TRUE; - - return FALSE; -} - -//--------------------------------------------------------------------------- - -BOOL _gldChooseInternalPipeline( - GLcontext *ctx, - GLD_driver_dx7 *gld) -{ -// return TRUE; // DEBUGGING: ALWAYS USE MESA -// return FALSE; // DEBUGGING: ALWAYS USE D3D - - if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE)) - { - gld->PipelineUsage.qwMesa.QuadPart++; - return TRUE; // Force Mesa TnL - } - - if ((ctx->Light.Enabled) || - (1) || - (ctx->Texture._TexGenEnabled) || - (ctx->Texture._TexMatEnabled) || -// (ctx->Transform._AnyClip) || - (ctx->Scissor.Enabled) || - _gldAnyEvalEnabled(ctx) // Put this last so we can early-out - ) - { - gld->PipelineUsage.qwMesa.QuadPart++; - return TRUE; - } - - gld->PipelineUsage.qwD3DFVF.QuadPart++; - return FALSE; - -/* // Force Mesa pipeline? - if (glb.dwTnL == GLDS_TNL_MESA) { - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - - // Test for functionality not exposed in the D3D pathways - if ((ctx->Texture._GenFlags)) { - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - - // Now decide if vertex shader can be used. - // If two sided lighting is enabled then we must either - // use Mesa TnL or the vertex shader - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { - if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) { - // Use Vertex Shader - gld->PipelineUsage.dwD3D2SVS.QuadPart++; - return GLD_PIPELINE_D3D_VS_TWOSIDE; - } else { - // Use Mesa TnL - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - } - - // Must be D3D fixed-function pipeline - gld->PipelineUsage.dwD3DFVF.QuadPart++; - return GLD_PIPELINE_D3D_FVF; -*/ -} - -//--------------------------------------------------------------------------- - -void gld_update_state_DX7( - GLcontext *ctx, - GLuint new_state) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLD_pb_dx7 *gldPB; - - if (!gld || !gld->pDev) - return; - - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - - // SetupIndex will be used in the pipelines for choosing setup function - if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) || - (ctx->Fog.Enabled)) - { - if (ctx->_TriangleCaps & DD_FLATSHADE) - gld->iSetupFunc = GLD_SI_FLAT_EXTRAS; - else - gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS; - } else { - if (ctx->_TriangleCaps & DD_FLATSHADE) - gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture - else - gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture - } - - gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld); - if (gld->bUseMesaTnL) { - gldPB = &gld->PB2d; - // DX7 Does not implement D3DRS_SOFTWAREVERTEXPROCESSING -// _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, TRUE)); - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, FALSE)); -// _GLD_DX7_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); - } else { - gldPB = &gld->PB3d; - _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, TRUE)); -// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) { -// _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware)); -// _GLD_DX7_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader)); -// } else { - // DX7 Does not implement D3DRS_SOFTWAREVERTEXPROCESSING -// _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL)); -// _GLD_DX7_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); -// } - } - -#define _GLD_TEST_STATE(a) \ - if (new_state & (a)) { \ - gld##a(ctx); \ - new_state &= ~(a); \ - } - -#define _GLD_TEST_STATE_DX7(a) \ - if (new_state & (a)) { \ - gld##a##_DX7(ctx); \ - new_state &= ~(a); \ - } - -#define _GLD_IGNORE_STATE(a) new_state &= ~(a); - -// if (!gld->bUseMesaTnL) { - // Not required if Mesa is doing the TnL. - // Problem: If gld->bUseMesaTnL is TRUE when these are signaled, - // then we'll miss updating the D3D TnL pipeline. - // Therefore, don't test for gld->bUseMesaTnL - _GLD_TEST_STATE(_NEW_MODELVIEW); - _GLD_TEST_STATE(_NEW_PROJECTION); -// } - - _GLD_TEST_STATE_DX7(_NEW_TEXTURE); // extern, so guard with _DX7 - _GLD_TEST_STATE(_NEW_COLOR); - _GLD_TEST_STATE(_NEW_DEPTH); - _GLD_TEST_STATE(_NEW_POLYGON); - _GLD_TEST_STATE(_NEW_STENCIL); - _GLD_TEST_STATE(_NEW_FOG); - _GLD_TEST_STATE(_NEW_LIGHT); - _GLD_TEST_STATE(_NEW_VIEWPORT); - - _GLD_IGNORE_STATE(_NEW_TRANSFORM); - - -// Stubs for future use. -/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX); - _GLD_TEST_STATE(_NEW_COLOR_MATRIX); - _GLD_TEST_STATE(_NEW_ACCUM); - _GLD_TEST_STATE(_NEW_EVAL); - _GLD_TEST_STATE(_NEW_HINT); - _GLD_TEST_STATE(_NEW_LINE); - _GLD_TEST_STATE(_NEW_PIXEL); - _GLD_TEST_STATE(_NEW_POINT); - _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE); - _GLD_TEST_STATE(_NEW_SCISSOR); - _GLD_TEST_STATE(_NEW_PACKUNPACK); - _GLD_TEST_STATE(_NEW_ARRAY); - _GLD_TEST_STATE(_NEW_RENDERMODE); - _GLD_TEST_STATE(_NEW_BUFFERS); - _GLD_TEST_STATE(_NEW_MULTISAMPLE); -*/ - -// For debugging. -#if 0 -#define _GLD_TEST_UNHANDLED_STATE(a) \ - if (new_state & (a)) { \ - gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \ - } - _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX); - _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX); - _GLD_TEST_UNHANDLED_STATE(_NEW_ACCUM); - _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL); - _GLD_TEST_UNHANDLED_STATE(_NEW_HINT); - _GLD_TEST_UNHANDLED_STATE(_NEW_LINE); - _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL); - _GLD_TEST_UNHANDLED_STATE(_NEW_POINT); - _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE); - _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR); - _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK); - _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY); - _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE); - _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS); - _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE); -#undef _GLD_UNHANDLED_STATE -#endif - -#undef _GLD_TEST_STATE -} - -//--------------------------------------------------------------------------- -// Viewport -//--------------------------------------------------------------------------- - -void gld_Viewport_DX7( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei w, - GLsizei h) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DVIEWPORT7 d3dvp; - - if (!gld || !gld->pDev) - return; - - // This is a hack. When the app is minimized, Mesa passes - // w=1 and h=1 for viewport dimensions. Without this test - // we get a GPF in gld_wgl_resize_buffers(). - if ((w==1) && (h==1)) - return; - - // Call ResizeBuffersMESA. This function will early-out - // if no resize is needed. - //ctx->Driver.ResizeBuffersMESA(ctx); - // Mesa 5: Changed parameters - ctx->Driver.ResizeBuffers(gldCtx->glBuffer); - -#if 0 - ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h); -#endif - - // ** D3D viewport must not be outside the render target surface ** - // Sanity check the GL viewport dimensions - if (x < 0) x = 0; - if (y < 0) y = 0; - if (w > gldCtx->dwWidth) w = gldCtx->dwWidth; - if (h > gldCtx->dwHeight) h = gldCtx->dwHeight; - // Ditto for D3D viewport dimensions - if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x; - if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y; - - d3dvp.dwX = x; - d3dvp.dwY = gldCtx->dwHeight - (y + h); - d3dvp.dwWidth = w; - d3dvp.dwHeight = h; - if (ctx->Viewport.Near <= ctx->Viewport.Far) { - d3dvp.dvMinZ = ctx->Viewport.Near; - d3dvp.dvMaxZ = ctx->Viewport.Far; - } else { - d3dvp.dvMinZ = ctx->Viewport.Far; - d3dvp.dvMaxZ = ctx->Viewport.Near; - } - - // TODO: DEBUGGING -// d3dvp.MinZ = 0.0f; -// d3dvp.MaxZ = 1.0f; - - _GLD_DX7_DEV(SetViewport(gld->pDev, &d3dvp)); - -} - -//--------------------------------------------------------------------------- - -extern BOOL dglWglResizeBuffers(GLcontext *ctx, BOOL bDefaultDriver); - -// Mesa 5: Parameter change -void gldResizeBuffers_DX7( -// GLcontext *ctx) - GLframebuffer *fb) -{ - GET_CURRENT_CONTEXT(ctx); - dglWglResizeBuffers(ctx, TRUE); -} - -//--------------------------------------------------------------------------- -#ifdef _DEBUG -// This is only for debugging. -// To use, plug into ctx->Driver.Enable pointer below. -void gld_Enable( - GLcontext *ctx, - GLenum e, - GLboolean b) -{ - char buf[1024]; - sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE"); - ddlogMessage(DDLOG_SYSTEM, buf); -} -#endif -//--------------------------------------------------------------------------- -// Driver pointer setup -//--------------------------------------------------------------------------- - -extern const GLubyte* _gldGetStringGeneric(GLcontext*, GLenum); - -void gldSetupDriverPointers_DX7( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - TNLcontext *tnl = TNL_CONTEXT(ctx); - - // Mandatory functions - ctx->Driver.GetString = _gldGetStringGeneric; - ctx->Driver.UpdateState = gld_update_state_DX7; - ctx->Driver.Clear = gld_Clear_DX7; - ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX7; - ctx->Driver.GetBufferSize = gld_buffer_size_DX7; - ctx->Driver.Finish = gld_Finish_DX7; - ctx->Driver.Flush = gld_Flush_DX7; - ctx->Driver.Error = gld_Error_DX7; - - // Hardware accumulation buffer - ctx->Driver.Accum = NULL; // TODO: gld_Accum; - - // Bitmap functions - ctx->Driver.CopyPixels = gld_CopyPixels_DX7; - ctx->Driver.DrawPixels = gld_DrawPixels_DX7; - ctx->Driver.ReadPixels = gld_ReadPixels_DX7; - ctx->Driver.Bitmap = gld_Bitmap_DX7; - - // Buffer resize - ctx->Driver.ResizeBuffers = gldResizeBuffers_DX7; - - // Texture image functions - ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX7; - ctx->Driver.TexImage1D = gld_TexImage1D_DX7; - ctx->Driver.TexImage2D = gld_TexImage2D_DX7; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX7; - ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX7; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - - ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX7; //NULL; - ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX7; //NULL; - ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX7; //NULL; - ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX7; //NULL; - ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX7; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - // Texture object functions - ctx->Driver.BindTexture = NULL; - ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!; - ctx->Driver.DeleteTexture = gld_DeleteTexture_DX7; - ctx->Driver.PrioritizeTexture = NULL; - - // Imaging functionality - ctx->Driver.CopyColorTable = NULL; - ctx->Driver.CopyColorSubTable = NULL; - ctx->Driver.CopyConvolutionFilter1D = NULL; - ctx->Driver.CopyConvolutionFilter2D = NULL; - - // State changing functions - ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc; - ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc; - ctx->Driver.ClearColor = NULL; //gld_ClearColor; - ctx->Driver.ClearDepth = NULL; //gld_ClearDepth; - ctx->Driver.ClearStencil = NULL; //gld_ClearStencil; - ctx->Driver.ColorMask = NULL; //gld_ColorMask; - ctx->Driver.CullFace = NULL; //gld_CullFace; - ctx->Driver.ClipPlane = NULL; //gld_ClipPlane; - ctx->Driver.FrontFace = NULL; //gld_FrontFace; - ctx->Driver.DepthFunc = NULL; //gld_DepthFunc; - ctx->Driver.DepthMask = NULL; //gld_DepthMask; - ctx->Driver.DepthRange = NULL; - ctx->Driver.Enable = NULL; //gld_Enable; - ctx->Driver.Fogfv = NULL; //gld_Fogfv; - ctx->Driver.Hint = NULL; //gld_Hint; - ctx->Driver.Lightfv = NULL; //gld_Lightfv; - ctx->Driver.LightModelfv = NULL; //gld_LightModelfv; - ctx->Driver.LineStipple = NULL; //gld_LineStipple; - ctx->Driver.LineWidth = NULL; //gld_LineWidth; - ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode; - ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv; - ctx->Driver.PointSize = NULL; //gld_PointSize; - ctx->Driver.PolygonMode = NULL; //gld_PolygonMode; - ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset; - ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple; - ctx->Driver.RenderMode = NULL; //gld_RenderMode; - ctx->Driver.Scissor = NULL; //gld_Scissor; - ctx->Driver.ShadeModel = NULL; //gld_ShadeModel; - ctx->Driver.StencilFunc = NULL; //gld_StencilFunc; - ctx->Driver.StencilMask = NULL; //gld_StencilMask; - ctx->Driver.StencilOp = NULL; //gld_StencilOp; - ctx->Driver.TexGen = NULL; //gld_TexGen; - ctx->Driver.TexEnv = NULL; - ctx->Driver.TexParameter = NULL; - ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix; - ctx->Driver.Viewport = gld_Viewport_DX7; - - _swsetup_Wakeup(ctx); - - tnl->Driver.RunPipeline = _tnl_run_pipeline; - tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX7; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; - - // Hook into glFrustum() and glOrtho() -// ctx->Exec->Frustum = gldFrustumHook_DX7; -// ctx->Exec->Ortho = gldOrthoHook_DX7; - -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h deleted file mode 100644 index b5a491e41..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dx7.h +++ /dev/null @@ -1,292 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect Direct3D 7.0a header file -* -****************************************************************************/ - -#ifndef _GLD_DX7_H -#define _GLD_DX7_H - -//--------------------------------------------------------------------------- -// Windows includes -//--------------------------------------------------------------------------- - -#define DIRECTDRAW_VERSION 0x0700 -#define DIRECT3D_VERSION 0x0700 -#include -#include - -// Typedef for obtaining function from d3d7.dll -//typedef IDirect3D7* (WINAPI *FNDIRECT3DCREATE7) (UINT); - - -//--------------------------------------------------------------------------- -// Defines -//--------------------------------------------------------------------------- - -#ifdef _DEBUG -// Debug build tests the return value of D3D calls -#define _GLD_TEST_HRESULT(h) \ -{ \ - HRESULT _hr = (h); \ - if (FAILED(_hr)) { \ - gldLogError(GLDLOG_ERROR, #h, _hr); \ - } \ -} -#define _GLD_DX7(func) _GLD_TEST_HRESULT(IDirect3D7_##func##) -#define _GLD_DX7_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice7_##func##) -#define _GLD_DX7_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer7_##func##) -#define _GLD_DX7_TEX(func) _GLD_TEST_HRESULT(IDirectDrawSurface7_##func##) -#else -#define _GLD_DX7(func) IDirect3D7_##func -#define _GLD_DX7_DEV(func) IDirect3DDevice7_##func -#define _GLD_DX7_VB(func) IDirect3DVertexBuffer7_##func -#define _GLD_DX7_TEX(func) IDirectDrawSurface7_##func -#endif - -#define SAFE_RELEASE(p) \ -{ \ - if (p) { \ - (p)->lpVtbl->Release(p); \ - (p) = NULL; \ - } \ -} - -#define SAFE_RELEASE_VB7(p) \ -{ \ - if (p) { \ - IDirect3DVertexBuffer7_Release((p)); \ - (p) = NULL; \ - } \ -} - -#define SAFE_RELEASE_SURFACE7(p) \ -{ \ - if (p) { \ - IDirectDrawSurface7_Release((p)); \ - (p) = NULL; \ - } \ -} - -// Emulate some DX8 defines -#define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) -#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) -#define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) - - -// Setup index. -enum { - GLD_SI_FLAT = 0, - GLD_SI_SMOOTH = 1, - GLD_SI_FLAT_EXTRAS = 2, - GLD_SI_SMOOTH_EXTRAS = 3, -}; - -//--------------------------------------------------------------------------- -// Vertex definitions for Fixed-Function pipeline -//--------------------------------------------------------------------------- - -// -// NOTE: If the number of texture units is altered then most of -// the texture code will need to be revised. -// - -#define GLD_MAX_TEXTURE_UNITS_DX7 2 - -// -// 2D vertex transformed by Mesa -// -#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \ - D3DFVF_DIFFUSE | \ - D3DFVF_SPECULAR | \ - D3DFVF_TEX2) -typedef struct { - FLOAT x, y; // 2D raster coords - FLOAT sz; // Screen Z (depth) - FLOAT rhw; // Reciprocal homogenous W - DWORD diffuse; // Diffuse colour - DWORD specular; // For separate-specular support - FLOAT t0_u, t0_v; // 1st set of texture coords - FLOAT t1_u, t1_v; // 2nd set of texture coords -} GLD_2D_VERTEX; - - -// -// 3D vertex transformed by Direct3D -// -#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \ - D3DFVF_DIFFUSE | \ - D3DFVF_TEX2) - -typedef struct { - D3DXVECTOR3 Position; // XYZ Vector in object space - D3DCOLOR Diffuse; // Diffuse colour - D3DXVECTOR2 TexUnit0; // Texture unit 0 - D3DXVECTOR2 TexUnit1; // Texture unit 1 -} GLD_3D_VERTEX; - -//--------------------------------------------------------------------------- -// Structs -//--------------------------------------------------------------------------- - -// This keeps a count of how many times we choose each individual internal -// pathway. Useful for seeing if a certain pathway was ever used by an app, and -// how much each pathway is biased. -// Zero the members at context creation and dump stats at context deletion. -typedef struct { - // Note: DWORD is probably too small - ULARGE_INTEGER qwMesa; // Mesa TnL pipeline - ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline -} GLD_pipeline_usage; - -// GLDirect Primitive Buffer (points, lines, triangles and quads) -typedef struct { - // Data for IDirect3D7::CreateVertexBuffer() - DWORD dwStride; // Stride of vertex - DWORD dwCreateFlags; // Create flags - DWORD dwFVF; // Direct3D Flexible Vertex Format - - IDirect3DVertexBuffer7 *pVB; // Holds points, lines, tris and quads. - - // Point list is assumed to be at start of buffer - DWORD iFirstLine; // Index of start of line list - DWORD iFirstTriangle; // Index of start of triangle list - - BYTE *pPoints; // Pointer to next free point - BYTE *pLines; // Pointer to next free line - BYTE *pTriangles; // Pointer to next free triangle - - DWORD nPoints; // Number of points ready to render - DWORD nLines; // Number of lines ready to render - DWORD nTriangles; // Number of triangles ready to render -} GLD_pb_dx7; - -// GLDirect DX7 driver data -typedef struct { - // GLDirect vars - BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered) - BOOL bDepthStencil; // Depth buffer needed (stencil optional) - D3DX_SURFACEFORMAT RenderFormat; // Format of back/front buffer - D3DX_SURFACEFORMAT DepthFormat; // Format of depth/stencil - - // Direct3D vars - DDCAPS ddCaps; - D3DDEVICEDESC7 d3dCaps; - BOOL bHasHWTnL; // Device has Hardware Transform/Light? - ID3DXContext *pD3DXContext; // Base D3DX context - IDirectDraw7 *pDD; // DirectDraw7 interface - IDirect3D7 *pD3D; // Base Direct3D7 interface - IDirect3DDevice7 *pDev; // Direct3D7 Device interface - GLD_pb_dx7 PB2d; // Vertices transformed by Mesa - GLD_pb_dx7 PB3d; // Vertices transformed by Direct3D - D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type - D3DMATRIX matProjection; // Projection matrix for D3D TnL - D3DMATRIX matModelView; // Model/View matrix for D3D TnL - int iSetupFunc; // Which setup functions to use - BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL - - GLD_pipeline_usage PipelineUsage; -} GLD_driver_dx7; - -#define GLD_GET_DX7_DRIVER(c) (GLD_driver_dx7*)(c)->glPriv - -//--------------------------------------------------------------------------- -// Function prototypes -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_DX7(LPCSTR a); -void gldEnableExtensions_DX7(GLcontext *ctx); -void gldInstallPipeline_DX7(GLcontext *ctx); -void gldSetupDriverPointers_DX7(GLcontext *ctx); -void gldResizeBuffers_DX7(GLframebuffer *fb); - - -// Texture functions - -void gldCopyTexImage1D_DX7(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -void gldCopyTexImage2D_DX7(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -void gldCopyTexSubImage1D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ); -void gldCopyTexSubImage2D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); -void gldCopyTexSubImage3D_DX7(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); - -void gld_NEW_TEXTURE_DX7(GLcontext *ctx); -void gld_DrawPixels_DX7(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels); -void gld_ReadPixels_DX7(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest); -void gld_CopyPixels_DX7(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type); -void gld_Bitmap_DX7(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap); -const struct gl_texture_format* gld_ChooseTextureFormat_DX7(GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType); -void gld_TexImage2D_DX7(GLcontext *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 *tObj, struct gl_texture_image *texImage); -void gld_TexImage1D_DX7(GLcontext *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 ); -void gld_TexSubImage2D_DX7( GLcontext *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 ); -void gld_TexSubImage1D_DX7(GLcontext *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); -void gld_DeleteTexture_DX7(GLcontext *ctx, struct gl_texture_object *tObj); -void gld_ResetLineStipple_DX7(GLcontext *ctx); - -// 2D primitive functions - -void gld_Points2D_DX7(GLcontext *ctx, GLuint first, GLuint last); - -void gld_Line2DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Line2DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1); - -void gld_Triangle2DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DFlatExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmoothExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); - -void gld_Quad2DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DFlatExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmoothExtras_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -// 3D primitive functions - -void gld_Points3D_DX7(GLcontext *ctx, GLuint first, GLuint last); -void gld_Line3DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle3DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad3DFlat_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Line3DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle3DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad3DSmooth_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -// Primitive functions for Two-sided-lighting Vertex Shader - -void gld_Points2DTwoside_DX7(GLcontext *ctx, GLuint first, GLuint last); -void gld_Line2DFlatTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Line2DSmoothTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle2DFlatTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmoothTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad2DFlatTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmoothTwoside_DX7(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -#endif diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h deleted file mode 100644 index df6fceb43..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_dxerr7.h +++ /dev/null @@ -1,77 +0,0 @@ -/*==========================================================================; - * - * - * File: dxerr8.h - * Content: DirectX Error Library Include File - * - ****************************************************************************/ - -#ifndef _GLD_DXERR7_H_ -#define _GLD_DXERR7_H_ - - -#include - -// -// DXGetErrorString8 -// -// Desc: Converts an DirectX HRESULT to a string -// -// Args: HRESULT hr Can be any error code from -// DPLAY D3D8 D3DX8 DMUSIC DSOUND -// -// Return: Converted string -// -const char* __stdcall DXGetErrorString8A(HRESULT hr); -const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr); - -#ifdef UNICODE - #define DXGetErrorString8 DXGetErrorString8W -#else - #define DXGetErrorString8 DXGetErrorString8A -#endif - - -// -// DXTrace -// -// Desc: Outputs a formatted error message to the debug stream -// -// Args: CHAR* strFile The current file, typically passed in using the -// __FILE__ macro. -// DWORD dwLine The current line number, typically passed in using the -// __LINE__ macro. -// HRESULT hr An HRESULT that will be traced to the debug stream. -// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) -// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. -// -// Return: The hr that was passed in. -// -//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE ); -//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE ); -HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox); -HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox); - -#ifdef UNICODE - #define DXTrace DXTraceW -#else - #define DXTrace DXTraceA -#endif - - -// -// Helper macros -// -#if defined(DEBUG) | defined(_DEBUG) - #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) - #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) - #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) -#else - #define DXTRACE_MSG(str) (0L) - #define DXTRACE_ERR(str,hr) (hr) - #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr) -#endif - - -#endif - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c deleted file mode 100644 index ba60980bb..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c +++ /dev/null @@ -1,346 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GL extensions -* -****************************************************************************/ - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "../gld_settings.h" - -#include -#define GL_GLEXT_PROTOTYPES -#include -#include - -//#include "ddlog.h" -//#include "gld_dx8.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -#include "dglcontext.h" -#include "extensions.h" - -// For some reason this is not defined in an above header... -extern void _mesa_enable_imaging_extensions(GLcontext *ctx); - -//--------------------------------------------------------------------------- -// Hack for the SGIS_multitexture extension that was removed from Mesa -// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel - - // NOTE: Quake2 ran *slower* with this enabled, so I've - // disabled it for now. - // To enable, uncomment: - // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0); - -//--------------------------------------------------------------------------- - -enum { - /* Quake2 GL_SGIS_multitexture */ - GL_SELECTED_TEXTURE_SGIS = 0x835B, - GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C, - GL_MAX_TEXTURES_SGIS = 0x835D, - GL_TEXTURE0_SGIS = 0x835E, - GL_TEXTURE1_SGIS = 0x835F, - GL_TEXTURE2_SGIS = 0x8360, - GL_TEXTURE3_SGIS = 0x8361, - GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363, -}; - -//--------------------------------------------------------------------------- - -void APIENTRY gldSelectTextureSGIS( - GLenum target) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glActiveTextureARB(ARB_target); -} - -//--------------------------------------------------------------------------- - -void APIENTRY gldMTexCoord2fSGIS( - GLenum target, - GLfloat s, - GLfloat t) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glMultiTexCoord2fARB(ARB_target, s, t); -} - -//--------------------------------------------------------------------------- - -void APIENTRY gldMTexCoord2fvSGIS( - GLenum target, - const GLfloat *v) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glMultiTexCoord2fvARB(ARB_target, v); -} - -//--------------------------------------------------------------------------- -// Extensions -//--------------------------------------------------------------------------- - -typedef struct { - PROC proc; - char *name; -} GLD_extension; - -GLD_extension GLD_extList[] = { -#ifdef GL_EXT_polygon_offset - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, -#endif - { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, - { (PROC)glBlendColorEXT, "glBlendColorExt" }, - { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, - { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, - { (PROC)glColorPointerEXT, "glColorPointerEXT" }, - { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, - { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, - { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, - { (PROC)glGetPointervEXT, "glGetPointervEXT" }, - { (PROC)glArrayElementEXT, "glArrayElementEXT" }, - { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, - { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, - { (PROC)glBindTextureEXT, "glBindTextureEXT" }, - { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, - { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, - { (PROC)glIsTextureEXT, "glIsTextureEXT" }, - { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, - { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, - { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, - { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, - { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, - { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, - - { (PROC)glLockArraysEXT, "glLockArraysEXT" }, - { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" }, - { NULL, "\0" } -}; - -GLD_extension GLD_multitexList[] = { -/* - { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" }, - { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" }, - { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" }, - { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" }, - { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" }, - { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" }, - { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" }, - { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" }, - { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" }, - { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" }, - { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" }, - { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" }, - { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" }, - { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" }, - { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" }, - { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" }, - { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" }, - { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" }, - { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" }, - { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" }, - { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" }, - { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" }, - { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" }, - { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" }, - { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" }, - { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" }, - { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" }, - { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" }, - { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" }, - { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" }, - { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" }, - { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" }, - { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" }, - { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" }, - { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" }, -*/ - { (PROC)glActiveTextureARB, "glActiveTextureARB" }, - { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" }, - { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" }, - { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" }, - { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" }, - { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" }, - { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" }, - { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" }, - { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" }, - { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" }, - { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" }, - { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" }, - { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" }, - { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" }, - { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" }, - { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" }, - { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" }, - { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" }, - { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" }, - { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" }, - { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" }, - { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" }, - { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" }, - { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" }, - { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" }, - { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" }, - { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" }, - { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" }, - { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" }, - { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" }, - { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" }, - { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" }, - { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" }, - { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" }, - - // Descent3 doesn't use correct string, hence this hack - { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" }, - - // Quake2 SGIS multitexture - { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" }, - { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" }, - { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" }, - - { NULL, "\0" } -}; - -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_DX( - LPCSTR a) -{ - int i; - PROC proc = NULL; - - for (i=0; GLD_extList[i].proc; i++) { - if (!strcmp(a, GLD_extList[i].name)) { - proc = GLD_extList[i].proc; - break; - } - } - - if (glb.bMultitexture) { - for (i=0; GLD_multitexList[i].proc; i++) { - if (!strcmp(a, GLD_multitexList[i].name)) { - proc = GLD_multitexList[i].proc; - break; - } - } - } - - gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed"); - - return proc; -} - -//--------------------------------------------------------------------------- - -void gldEnableExtensions_DX7( - GLcontext *ctx) -{ - GLuint i; - - // Mesa enables some extensions by default. - // This table decides which ones we want to switch off again. - - // NOTE: GL_EXT_compiled_vertex_array appears broken. - - const char *gld_disable_extensions[] = { -// "GL_ARB_transpose_matrix", -// "GL_EXT_compiled_vertex_array", -// "GL_EXT_polygon_offset", -// "GL_EXT_rescale_normal", - "GL_EXT_texture3D", -// "GL_NV_texgen_reflection", - "GL_EXT_abgr", - "GL_EXT_bgra", - NULL - }; - - const char *gld_multitex_extensions[] = { - "GL_ARB_multitexture", // Quake 3 - NULL - }; - - // Quake 2 engines - const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture"; - - const char *gld_enable_extensions[] = { - "GL_EXT_texture_env_add", // Quake 3 - "GL_ARB_texture_env_add", // Quake 3 - NULL - }; - - for (i=0; gld_disable_extensions[i]; i++) { - _mesa_disable_extension(ctx, gld_disable_extensions[i]); - } - - for (i=0; gld_enable_extensions[i]; i++) { - _mesa_enable_extension(ctx, gld_enable_extensions[i]); - } - - if (glb.bMultitexture) { - for (i=0; gld_multitex_extensions[i]; i++) { - _mesa_enable_extension(ctx, gld_multitex_extensions[i]); - } - - // GL_SGIS_multitexture - // NOTE: Quake2 ran *slower* with this enabled, so I've - // disabled it for now. - // Fair bit slower on GeForce256, - // Much slower on 3dfx Voodoo5 5500. -// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0); - - } - - _mesa_enable_imaging_extensions(ctx); - _mesa_enable_1_3_extensions(ctx); - _mesa_enable_1_4_extensions(ctx); -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c deleted file mode 100644 index 9ccec69b9..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_pipeline_dx7.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Mesa transformation pipeline with GLDirect fastpath -* -****************************************************************************/ - -//#include "../GLDirect.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx7.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -//--------------------------------------------------------------------------- - -extern struct tnl_pipeline_stage _gld_d3d_render_stage; -extern struct tnl_pipeline_stage _gld_mesa_render_stage; - -static const struct tnl_pipeline_stage *gld_pipeline[] = { - &_gld_d3d_render_stage, // Direct3D TnL - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */ - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_point_attenuation_stage, - &_gld_mesa_render_stage, // Mesa TnL, D3D rendering - 0, -}; - -//--------------------------------------------------------------------------- - -void gldInstallPipeline_DX7( - GLcontext *ctx) -{ - // Remove any existing pipeline stages, - // then install GLDirect pipeline stages. - - _tnl_destroy_pipeline(ctx); - _tnl_install_pipeline(ctx, gld_pipeline); -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c deleted file mode 100644 index c99ba0bba..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c +++ /dev/null @@ -1,1448 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Primitive (points/lines/tris/quads) rendering -* -****************************************************************************/ - -//#include "../GLDirect.h" - -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx7.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_lines.h" -#include "swrast/s_triangle.h" -#include "swrast/s_trispan.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -// Disable compiler complaints about unreferenced local variables -#pragma warning (disable:4101) - -//--------------------------------------------------------------------------- -// Helper defines for primitives -//--------------------------------------------------------------------------- - -//static const float ooZ = 1.0f / 65536.0f; // One over Z - -#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3])) -#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3])) -#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y)) - -//--------------------------------------------------------------------------- -// 2D vertex setup -//--------------------------------------------------------------------------- - -#define GLD_SETUP_2D_VARS_POINTS \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour - -#define GLD_SETUP_2D_VARS_LINES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour - -#define GLD_SETUP_2D_VARS_TRIANGLES \ - BOOL bFog = ctx->Fog.Enabled; \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour; \ - GLuint facing = 0; \ - struct vertex_buffer *VB; \ - GLchan (*vbcolor)[4]; \ - GLchan (*vbspec)[4] - -#define GLD_SETUP_GET_SWVERT(s) \ - swv = &ss->verts[##s] - -#define GLD_SETUP_2D_VERTEX \ - pV->x = swv->win[0]; \ - pV->y = GLD_FLIP_Y(swv->win[1]); \ - pV->rhw = swv->win[3] - -#define GLD_SETUP_SMOOTH_COLOUR \ - pV->diffuse = GLD_COLOUR - -#define GLD_SETUP_GET_FLAT_COLOUR \ - dwFlatColour = GLD_COLOUR -#define GLD_SETUP_GET_FLAT_FOG_COLOUR \ - dwFlatColour = _gldComputeFog(ctx, swv) - -#define GLD_SETUP_USE_FLAT_COLOUR \ - pV->diffuse = dwFlatColour - -#define GLD_SETUP_GET_FLAT_SPECULAR \ - dwSpecularColour= GLD_SPECULAR - -#define GLD_SETUP_USE_FLAT_SPECULAR \ - pV->specular = dwSpecularColour - -#define GLD_SETUP_DEPTH \ - pV->sz = swv->win[2] / ctx->DepthMaxF -// pV->z = swv->win[2] * ooZ; - -#define GLD_SETUP_SPECULAR \ - pV->specular = GLD_SPECULAR - -#define GLD_SETUP_FOG \ - pV->diffuse = _gldComputeFog(ctx, swv) - -#define GLD_SETUP_TEX0 \ - pV->t0_u = swv->texcoord[0][0]; \ - pV->t0_v = swv->texcoord[0][1] - -#define GLD_SETUP_TEX1 \ - pV->t1_u = swv->texcoord[1][0]; \ - pV->t1_v = swv->texcoord[1][1] - -#define GLD_SETUP_LIGHTING(v) \ - if (facing == 1) { \ - pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \ - if (vbspec) { \ - pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \ - } \ - } else { \ - if (bFog) \ - GLD_SETUP_FOG; \ - else \ - GLD_SETUP_SMOOTH_COLOUR; \ - GLD_SETUP_SPECULAR; \ - } - -#define GLD_SETUP_GET_FLAT_LIGHTING(v) \ - if (facing == 1) { \ - dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \ - if (vbspec) { \ - dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \ - } \ - } - -#define GLD_SETUP_TWOSIDED_LIGHTING \ - /* Two-sided lighting */ \ - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \ - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \ - SWvertex *v[3]; \ - GLfloat ex,ey,fx,fy,cc; \ - /* Get vars for later */ \ - VB = &TNL_CONTEXT(ctx)->vb; \ - vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ - if (VB->SecondaryColorPtr[1]) { \ - vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ - } else { \ - vbspec = NULL; \ - } \ - v[0] = &verts[v0]; \ - v[1] = &verts[v1]; \ - v[2] = &verts[v2]; \ - ex = v[0]->win[0] - v[2]->win[0]; \ - ey = v[0]->win[1] - v[2]->win[1]; \ - fx = v[1]->win[0] - v[2]->win[0]; \ - fy = v[1]->win[1] - v[2]->win[1]; \ - cc = ex*fy - ey*fx; \ - facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \ - } - -//--------------------------------------------------------------------------- -// 3D vertex setup -//--------------------------------------------------------------------------- - -#define GLD_SETUP_3D_VARS_POINTS \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VARS_LINES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VARS_TRIANGLES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ - pV->Position.x = p4f[##v][0]; \ - pV->Position.y = p4f[##v][1]; \ - pV->Position.z = p4f[##v][2]; - -#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ - pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); - - -#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ - dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); - -#define GLD_SETUP_USE_FLAT_COLOUR_3D \ - pV->Diffuse = dwColor; - -#define GLD_SETUP_TEX0_3D(v) \ - if (VB->TexCoordPtr[0]) { \ - tc = VB->TexCoordPtr[0]->data; \ - pV->TexUnit0.x = tc[##v][0]; \ - pV->TexUnit0.y = tc[##v][1]; \ - } - -#define GLD_SETUP_TEX1_3D(v) \ - if (VB->TexCoordPtr[1]) { \ - tc = VB->TexCoordPtr[1]->data; \ - pV->TexUnit1.x = tc[##v][0]; \ - pV->TexUnit1.y = tc[##v][1]; \ - } - -//--------------------------------------------------------------------------- -// Helper functions -//--------------------------------------------------------------------------- - -__inline DWORD _gldComputeFog( - GLcontext *ctx, - SWvertex *swv) -{ - // Full fog calculation. - // Based on Mesa code. - - GLchan rFog, gFog, bFog; - GLchan fR, fG, fB; - const GLfloat f = swv->fog; - const GLfloat g = 1.0 - f; - - UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]); - fR = f * swv->color[0] + g * rFog; - fG = f * swv->color[1] + g * gFog; - fB = f * swv->color[2] + g * bFog; - return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]); -} - -//--------------------------------------------------------------------------- - -void gld_ResetLineStipple_DX7( - GLcontext *ctx) -{ - // TODO: Fake stipple with a 32x32 texture. -} - -//--------------------------------------------------------------------------- -// 2D (post-transformed) primitives -//--------------------------------------------------------------------------- - -void gld_Points2D_DX7( - GLcontext *ctx, - GLuint first, - GLuint last) -{ - GLD_SETUP_2D_VARS_POINTS; - - unsigned i; - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - // _Size is already clamped to MaxPointSize and MinPointSize - // Not supported by DX7 -// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size)); - - if (VB->Elts) { - for (i=first; iClipMask[VB->Elts[i]] == 0) { -// _swrast_Point( ctx, &verts[VB->Elts[i]] ); - GLD_SETUP_GET_SWVERT(VB->Elts[i]); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - } - } - } else { - GLD_SETUP_GET_SWVERT(first); - for (i=first; iClipMask[i] == 0) { -// _swrast_Point( ctx, &verts[i] ); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - } - } - } - - gld->PB2d.pPoints = (BYTE*)pV; - gld->PB2d.nPoints += (last-first); -} - -//--------------------------------------------------------------------------- - -void gld_Line2DFlat_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_2D_VARS_LINES; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pLines = (BYTE*)pV; - gld->PB2d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Line2DSmooth_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_2D_VARS_LINES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_SPECULAR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pLines = (BYTE*)pV; - gld->PB2d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlat_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - pV++;; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmooth_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlatExtras_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v2); - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - if (bFog) - GLD_SETUP_GET_FLAT_FOG_COLOUR; - else - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_GET_FLAT_LIGHTING(v2); - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmoothExtras_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v0); - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v1); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlat_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmooth_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlatExtras_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v3); - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - if (bFog) - GLD_SETUP_GET_FLAT_FOG_COLOUR; - else - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_GET_FLAT_LIGHTING(v3); - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmoothExtras_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v0); - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v1); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v3); - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- -// 3D (pre-transformed) primitives -//--------------------------------------------------------------------------- - -void gld_Points3D_DX7( - GLcontext *ctx, - GLuint first, - GLuint last) -{ - GLD_SETUP_3D_VARS_POINTS - - unsigned i; -// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - // _Size is already clamped to MaxPointSize and MinPointSize - // Not supported by DX7 -// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size)); - - if (VB->Elts) { - for (i=first; iClipMask[VB->Elts[i]] == 0) { -// _swrast_Point( ctx, &verts[VB->Elts[i]] ); -// GLD_SETUP_GET_SWVERT(VB->Elts[i]); - GLD_SETUP_3D_VERTEX(VB->Elts[i]) - GLD_SETUP_SMOOTH_COLOUR_3D(i) - GLD_SETUP_TEX0_3D(i) - GLD_SETUP_TEX1_3D(i) - } - } - } else { -// GLD_SETUP_GET_SWVERT(first); - for (i=first; iClipMask[i] == 0) { -// _swrast_Point( ctx, &verts[i] ); - GLD_SETUP_3D_VERTEX(i) - GLD_SETUP_SMOOTH_COLOUR_3D(i) - GLD_SETUP_TEX0_3D(i) - GLD_SETUP_TEX1_3D(i) - } - } - } -/* - for (i=first; iPB3d.pPoints = (BYTE*)pV; - gld->PB3d.nPoints += (last-first); -} - -//--------------------------------------------------------------------------- -// Line functions -//--------------------------------------------------------------------------- - -void gld_Line3DFlat_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_3D_VARS_LINES - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_GET_FLAT_COLOUR_3D(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pLines = (BYTE*)pV; - gld->PB3d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Line3DSmooth_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_3D_VARS_LINES - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pLines = (BYTE*)pV; - gld->PB3d.nLines++; -} - -//--------------------------------------------------------------------------- -// Triangle functions -//--------------------------------------------------------------------------- - -void gld_Triangle3DFlat_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - GLD_SETUP_GET_FLAT_COLOUR_3D(v2) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle3DSmooth_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles++; -} - -//--------------------------------------------------------------------------- -// Quad functions -//--------------------------------------------------------------------------- - -void gld_Quad3DFlat_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_GET_FLAT_COLOUR_3D(v3) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad3DSmooth_DX7( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_SMOOTH_COLOUR_3D(v3) - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- -// Vertex setup for two-sided-lighting vertex shader -//--------------------------------------------------------------------------- - -/* - -void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last) -{ - // NOTE: Two-sided lighting does not apply to Points -} - -//--------------------------------------------------------------------------- - -void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1) -{ - // NOTE: Two-sided lighting does not apply to Lines -} - -//--------------------------------------------------------------------------- - -void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1) -{ - // NOTE: Two-sided lighting does not apply to Lines -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2) -{ -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 4th vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 5th vert - swv = &ss->verts[v3]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 6th vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 4th vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 5th vert - swv = &ss->verts[v3]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 6th vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -*/ diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c deleted file mode 100644 index bbe673516..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_texture_dx7.c +++ /dev/null @@ -1,2196 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Texture / Bitmap functions -* -****************************************************************************/ - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx7.h" - -//#include - -#include "texformat.h" -#include "colormac.h" -#include "texstore.h" -#include "image.h" -// #include "mem.h" - -//--------------------------------------------------------------------------- - -#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h)) - -D3DX_SURFACEFORMAT _gldD3DXFormatFromSurface(IDirectDrawSurface7 *pSurface); - -//--------------------------------------------------------------------------- -// 1D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + (i) * (sz)) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (i) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (i)) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + (i)) - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// 2D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz)) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + ((t)->Width * (j) + (i))) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i))) - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// 3D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i)) * (sz) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i))) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i))) - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// Direct3D texture formats that have no Mesa equivalent -//--------------------------------------------------------------------------- - -const struct gl_texture_format _gld_texformat_X8R8G8B8 = { - MESA_FORMAT_ARGB8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */ - gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */ - gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */ -}; - -const struct gl_texture_format _gld_texformat_X1R5G5B5 = { - MESA_FORMAT_ARGB1555, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */ - gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */ - gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */ -}; - -const struct gl_texture_format _gld_texformat_X4R4G4B4 = { - MESA_FORMAT_ARGB4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */ - gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */ - gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */ -}; - -//--------------------------------------------------------------------------- -// Texture unit constants -//--------------------------------------------------------------------------- - -// List of possible combinations of texture environments. -// Example: GLD_TEXENV_MODULATE_RGBA means -// GL_MODULATE, GL_RGBA base internal format. -#define GLD_TEXENV_DECAL_RGB 0 -#define GLD_TEXENV_DECAL_RGBA 1 -#define GLD_TEXENV_DECAL_ALPHA 2 -#define GLD_TEXENV_REPLACE_RGB 3 -#define GLD_TEXENV_REPLACE_RGBA 4 -#define GLD_TEXENV_REPLACE_ALPHA 5 -#define GLD_TEXENV_MODULATE_RGB 6 -#define GLD_TEXENV_MODULATE_RGBA 7 -#define GLD_TEXENV_MODULATE_ALPHA 8 -#define GLD_TEXENV_BLEND_RGB 9 -#define GLD_TEXENV_BLEND_RGBA 10 -#define GLD_TEXENV_BLEND_ALPHA 11 -#define GLD_TEXENV_ADD_RGB 12 -#define GLD_TEXENV_ADD_RGBA 13 -#define GLD_TEXENV_ADD_ALPHA 14 - -// Per-stage (i.e. per-unit) texture environment -typedef struct { - DWORD ColorArg1; // Colour argument 1 - D3DTEXTUREOP ColorOp; // Colour operation - DWORD ColorArg2; // Colour argument 2 - DWORD AlphaArg1; // Alpha argument 1 - D3DTEXTUREOP AlphaOp; // Alpha operation - DWORD AlphaArg2; // Alpha argument 2 -} GLD_texenv; - -// TODO: Do we really need to set ARG1 and ARG2 every time? -// They seem to always be TEXTURE and CURRENT respectively. - -// C = Colour out -// A = Alpha out -// Ct = Colour from Texture -// Cf = Colour from fragment (diffuse) -// At = Alpha from Texture -// Af = Alpha from fragment (diffuse) -// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND) -const GLD_texenv gldTexEnv[] = { - // DECAL_RGB: C=Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af - {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // DECAL_ALPHA: use DECAL_RGB - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - - // REPLACE_RGB: C=Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // REPLACE_RGBA: C=Ct, A=At - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT}, - // REPLACE_ALPHA: C=Cf, A=At - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT}, - - // MODULATE_RGB: C=CfCt, A=Af - {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // MODULATE_RGBA: C=CfCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // MODULATE_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - - // - // DX7 Does not support D3DTOP_LERP - // Emulate(?) via D3DTOP_ADDSMOOTH - // -#if 0 - // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af - {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, -#else - // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af - {D3DTA_TEXTURE, D3DTOP_ADDSMOOTH, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_ADDSMOOTH, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, -#endif - // BLEND_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - - // ADD_RGB: C=Cf+Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // ADD_RGBA: C=Cf+Ct, A=AfAt - {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // ADD_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, -}; - -//--------------------------------------------------------------------------- - -D3DTEXTUREADDRESS _gldConvertWrap( - GLenum wrap) -{ -// ASSERT(wrap==GL_CLAMP || wrap==GL_REPEAT); - return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP; -} - -//--------------------------------------------------------------------------- - -D3DTEXTUREMAGFILTER _gldConvertMagFilter( - GLenum magfilter) -{ - ASSERT(magfilter==GL_LINEAR || magfilter==GL_NEAREST); - return (magfilter == GL_LINEAR) ? D3DTFG_LINEAR : D3DTFG_POINT; -} - -//--------------------------------------------------------------------------- - -void _gldConvertMinFilter( - GLenum minfilter, - D3DTEXTUREMINFILTER *min_filter, - D3DTEXTUREMIPFILTER *mip_filter) -{ - switch (minfilter) { - case GL_NEAREST: - *min_filter = D3DTFN_POINT; - *mip_filter = D3DTFP_NONE; - break; - case GL_LINEAR: - *min_filter = D3DTFN_LINEAR; - *mip_filter = D3DTFP_NONE; - break; - case GL_NEAREST_MIPMAP_NEAREST: - *min_filter = D3DTFN_POINT; - *mip_filter = D3DTFP_POINT; - break; - case GL_LINEAR_MIPMAP_NEAREST: - *min_filter = D3DTFN_LINEAR; - *mip_filter = D3DTFP_POINT; - break; - case GL_NEAREST_MIPMAP_LINEAR: - *min_filter = D3DTFN_POINT; - *mip_filter = D3DTFP_LINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - *min_filter = D3DTFN_LINEAR; - *mip_filter = D3DTFP_LINEAR; - break; - default: - ASSERT(0); - } -} - -//--------------------------------------------------------------------------- - -D3DX_SURFACEFORMAT _gldGLFormatToD3DFormat( - GLenum internalFormat) -{ - switch (internalFormat) { - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures - return D3DX_SF_L8; - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return D3DX_SF_L8; - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return D3DX_SF_A8; - 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 D3DX_SF_X8R8G8B8; - 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 D3DX_SF_A8L8; - case GL_R3_G3_B2: - // TODO: Mesa does not support RGB332 internally - return D3DX_SF_X4R4G4B4; //D3DFMT_R3G3B2; - case GL_RGB4: - return D3DX_SF_X4R4G4B4; - case GL_RGB5: - return D3DX_SF_R5G5B5; - case 3: - case GL_RGB: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return D3DX_SF_R8G8B8; - case GL_RGBA4: - return D3DX_SF_A4R4G4B4; - case 4: - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return D3DX_SF_A8R8G8B8; - case GL_RGB5_A1: - return D3DX_SF_A1R5G5B5; - } - - ASSERT(0); - - // Return an acceptable default - return D3DX_SF_A8R8G8B8; -} - -//--------------------------------------------------------------------------- - -GLenum _gldDecodeBaseFormat( - IDirectDrawSurface7 *pTex) -{ - // Examine Direct3D texture and return base OpenGL internal texture format - // NOTE: We can't use any base format info from Mesa because D3D might have - // used a different texture format when we used D3DXCreateTexture(). - - // Base internal format is one of (Red Book p355): - // GL_ALPHA, - // GL_LUMINANCE, - // GL_LUMINANCE_ALPHA, - // GL_INTENSITY, - // GL_RGB, - // GL_RGBA - - // NOTE: INTENSITY not used (not supported by Direct3D) - // LUMINANCE has same texture functions as RGB - // LUMINANCE_ALPHA has same texture functions as RGBA - - // TODO: cache format instead of using GetLevelDesc() -// D3DSURFACE_DESC desc; -// _GLD_DX7_TEX(GetLevelDesc(pTex, 0, &desc)); - - D3DX_SURFACEFORMAT sf; - - sf = _gldD3DXFormatFromSurface(pTex); - - switch (sf) { - case D3DX_SF_R8G8B8: - case D3DX_SF_X8R8G8B8: - case D3DX_SF_R5G6B5: - case D3DX_SF_R5G5B5: - case D3DX_SF_R3G3B2: - case D3DX_SF_X4R4G4B4: - case D3DX_SF_PALETTE8: - case D3DX_SF_L8: - return GL_RGB; - case D3DX_SF_A8R8G8B8: - case D3DX_SF_A1R5G5B5: - case D3DX_SF_A4R4G4B4: -// case D3DX_SF_A8R3G3B2: // Unsupported by DX7 -// case D3DX_SF_A8P8: // Unsupported by DX7 - case D3DX_SF_A8L8: -// case D3DX_SF_A4L4: // Unsupported by DX7 - return GL_RGBA; - case D3DX_SF_A8: - return GL_ALPHA; - // Compressed texture formats. Need to check these... - case D3DX_SF_DXT1: - return GL_RGBA; -// case D3DX_SF_DXT2: // Unsupported by DX7 - return GL_RGB; - case D3DX_SF_DXT3: - return GL_RGBA; -// case D3DX_SF_DXT4: // Unsupported by DX7 - return GL_RGB; - case D3DX_SF_DXT5: - return GL_RGBA; - } - - // Fell through. Return arbitary default. - ASSERT(0); // BANG! - return GL_RGBA; -} - -//--------------------------------------------------------------------------- - -const struct gl_texture_format* _gldMesaFormatForD3DFormat( - D3DX_SURFACEFORMAT d3dfmt) -{ - switch (d3dfmt) { - case D3DX_SF_A8R8G8B8: - return &_mesa_texformat_argb8888; - case D3DX_SF_R8G8B8: - return &_mesa_texformat_rgb888; - case D3DX_SF_R5G6B5: - return &_mesa_texformat_rgb565; - case D3DX_SF_A4R4G4B4: - return &_mesa_texformat_argb4444; - case D3DX_SF_A1R5G5B5: - return &_mesa_texformat_argb1555; - case D3DX_SF_A8L8: - return &_mesa_texformat_al88; - case D3DX_SF_R3G3B2: - return &_mesa_texformat_rgb332; - case D3DX_SF_A8: - return &_mesa_texformat_a8; - case D3DX_SF_L8: - return &_mesa_texformat_l8; - case D3DX_SF_X8R8G8B8: - return &_gld_texformat_X8R8G8B8; - case D3DX_SF_R5G5B5: - return &_gld_texformat_X1R5G5B5; - case D3DX_SF_X4R4G4B4: - return &_gld_texformat_X4R4G4B4; - } - - // If we reach here then we've made an error somewhere else - // by allowing a format that is not supported. - ASSERT(0); - - return NULL; // Shut up compiler warning -} - -//--------------------------------------------------------------------------- - -D3DX_SURFACEFORMAT _gldD3DXFormatFromSurface( - IDirectDrawSurface7 *pSurface) -{ - DDPIXELFORMAT ddpf; - - ddpf.dwSize = sizeof(ddpf); - - // Obtain pixel format of surface - _GLD_DX7_TEX(GetPixelFormat(pSurface, &ddpf)); - // Decode to D3DX surface format - return D3DXMakeSurfaceFormat(&ddpf); -} - -//--------------------------------------------------------------------------- - -void _gldClearSurface( - IDirectDrawSurface *pSurface, - D3DCOLOR dwColour) -{ - DDBLTFX bltFX; // Used for colour fill - - // Initialise struct - bltFX.dwSize = sizeof(bltFX); - // Set clear colour - bltFX.dwFillColor = dwColour; - // Clear surface. HW accelerated if available. - IDirectDrawSurface7_Blt(pSurface, NULL, NULL, NULL, DDBLT_COLORFILL, &bltFX); -} - -//--------------------------------------------------------------------------- -// Copy* functions -//--------------------------------------------------------------------------- - -void gldCopyTexImage1D_DX7( - GLcontext *ctx, - GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLint border ) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexImage2D_DX7( - GLcontext *ctx, - GLenum target, - GLint level, - GLenum internalFormat, - GLint x, - GLint y, - GLsizei width, - GLsizei height, - GLint border) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage1D_DX7( - GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage2D_DX7( - GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint x, - GLint y, - GLsizei width, - GLsizei height) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage3D_DX7( - GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint zoffset, - GLint x, - GLint y, - GLsizei width, - GLsizei height ) -{ - // TODO ? -} - -//--------------------------------------------------------------------------- -// Bitmap/Pixel functions -//--------------------------------------------------------------------------- - -#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y)) - -#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1) - -typedef struct { - FLOAT x, y; // 2D raster coords - FLOAT z; // depth value - FLOAT rhw; // reciprocal homogenous W (always 1.0f) - FLOAT tu, tv; // texture coords -} _GLD_IMAGE_VERTEX; - -//--------------------------------------------------------------------------- - -HRESULT _gldDrawPixels( - GLcontext *ctx, - BOOL bChromakey, // Alpha test for glBitmap() images - GLint x, // GL x position - GLint y, // GL y position (needs flipping) - GLsizei width, // Width of input image - GLsizei height, // Height of input image - IDirectDrawSurface7 *pImage) -{ - // - // Draw input image as texture implementing PixelZoom and clipping. - // Any fragment operations currently enabled will be used. - // - - // NOTE: This DX7 version does not create a new texture in which - // to copy the input image, as the image is already a texture. - - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - DDSURFACEDESC2 ddsd; - _GLD_IMAGE_VERTEX v[4]; - - float ZoomWidth, ZoomHeight; - float ScaleWidth, ScaleHeight; - - // Fixup for rasterisation rules - const float cfEpsilon = 1.0f / (float)height; - - // - // Set up the quad like this (ascii-art ahead!) - // - // 3--2 - // | | - // 0--1 - // - // - - // Set depth - v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2]; - // Set Reciprocal Homogenous W - v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f; - - // Set texcoords - // Examine texture size - if different to input width and height - // then we'll need to munge the texcoords to fit. - ddsd.dwSize = sizeof(DDSURFACEDESC2); - IDirectDrawSurface7_GetSurfaceDesc(pImage, &ddsd); - ScaleWidth = (float)width / (float)ddsd.dwWidth; - ScaleHeight = (float)height / (float)ddsd.dwHeight; - v[0].tu = 0.0f; v[0].tv = 0.0f; - v[1].tu = ScaleWidth; v[1].tv = 0.0f; - v[2].tu = ScaleWidth; v[2].tv = ScaleHeight; - v[3].tu = 0.0f; v[3].tv = ScaleHeight; - - // Set raster positions - ZoomWidth = (float)width * ctx->Pixel.ZoomX; - ZoomHeight = (float)height * ctx->Pixel.ZoomY; - - v[0].x = x; v[0].y = GLD_FLIP_Y(y+cfEpsilon); - v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y+cfEpsilon); - v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight+cfEpsilon); - v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight+cfEpsilon); - - // Draw image with full HW acceleration - // NOTE: Be nice to use a State Block for all this state... - IDirect3DDevice7_SetTexture(gld->pDev, 0, pImage); - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, TRUE); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTFN_POINT); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTFP_POINT); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTFG_POINT); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - // Ensure texture unit 1 is disabled - IDirect3DDevice7_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - // - // Emulate Chromakey with an Alpha Test. - // [Alpha Test is more widely supported anyway] - // - if (bChromakey) { - // Switch on alpha testing - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHATESTENABLE, TRUE); - // Fragment passes is alpha is greater than reference value - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAFUNC, D3DCMP_GREATER); - // Set alpha reference value between Bitmap alpha values of - // zero (transparent) and one (opaque). - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ALPHAREF, 0x7f); - } - - IDirect3DDevice7_DrawPrimitive(gld->pDev, D3DPT_TRIANGLEFAN, _GLD_FVF_IMAGE, &v, 4, 0); - - // Reset state to before we messed it up - FLUSH_VERTICES(ctx, _NEW_ALL); - - return S_OK; -} - -//--------------------------------------------------------------------------- - -void gld_DrawPixels_DX7( - GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - GLD_context *gldCtx; - GLD_driver_dx7 *gld; - - IDirectDrawSurface7 *pImage; - HRESULT hr; - DDSURFACEDESC2 ddsd; - DWORD dwFlags; - D3DX_SURFACEFORMAT sf; - DWORD dwMipmaps; - - const struct gl_texture_format *MesaFormat; - - MesaFormat = _mesa_choose_tex_format(ctx, format, format, type); - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX7_DRIVER(gldCtx); - - dwFlags = D3DX_TEXTURE_NOMIPMAP; - sf = D3DX_SF_A8R8G8B8; - dwMipmaps = 1; - - hr = D3DXCreateTexture( - gld->pDev, - &dwFlags, - &width, &height, - &sf, // format - NULL, // palette - &pImage, // Output texture - &dwMipmaps); - if (FAILED(hr)) { - return; - } - - // D3DXCreateTexture() may not clear the texture is creates. - _gldClearSurface(pImage, 0); - - // - // Use Mesa to fill in image - // - - // Lock all of surface - ddsd.dwSize = sizeof(DDSURFACEDESC2); - dwFlags = DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT; - hr = IDirectDrawSurface7_Lock(pImage, NULL, &ddsd, dwFlags, NULL); - if (FAILED(hr)) { - SAFE_RELEASE_SURFACE7(pImage); - return; - } - - // unpack image, apply transfer ops and store directly in texture - MesaFormat->StoreImage( - ctx, - 2, - GL_RGBA, - &_mesa_texformat_argb8888, - ddsd.lpSurface, - width, height, 1, 0, 0, 0, - ddsd.lPitch, - 0, /* dstImageStride */ - format, type, pixels, unpack); - - IDirectDrawSurface7_Unlock(pImage, NULL); - - _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage); - - SAFE_RELEASE_SURFACE7(pImage); -} - -//--------------------------------------------------------------------------- - -void gld_ReadPixels_DX7( - GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest) -{ -// TODO -#if 0 - GLD_context *gldCtx; - GLD_driver_dx7 *gld; - - IDirect3DSurface8 *pBackbuffer = NULL; - IDirect3DSurface8 *pNativeImage = NULL; - IDirect3DSurface8 *pCanonicalImage = NULL; - - D3DSURFACE_DESC d3dsd; - RECT rcSrc; // Source rect - POINT ptDst; // Dest point - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - struct gl_pixelstore_attrib srcPacking; - int i; - GLint DstRowStride; - const struct gl_texture_format *MesaFormat; - - switch (format) { - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - return; - } - - MesaFormat = _mesa_choose_tex_format(ctx, format, format, type); - DstRowStride = _mesa_image_row_stride(pack, width, format, type); - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX7_DRIVER(gldCtx); - - // Get backbuffer - hr = IDirect3DDevice8_GetBackBuffer( - gld->pDev, - 0, // First backbuffer - D3DBACKBUFFER_TYPE_MONO, - &pBackbuffer); - if (FAILED(hr)) - return; - - // Get backbuffer description - hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd); - if (FAILED(hr)) { - goto gld_ReadPixels_DX7_return; - } - - // Create a surface compatible with backbuffer - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - d3dsd.Format, - &pNativeImage); - if (FAILED(hr)) { - goto gld_ReadPixels_DX7_return; - } - - // Compute source rect and dest point - SetRect(&rcSrc, 0, 0, width, height); - OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height)); - ptDst.x = ptDst.y = 0; - - // Get source pixels. - // - // This intermediate surface ensure that we can use CopyRects() - // instead of relying on D3DXLoadSurfaceFromSurface(), which may - // try and lock the backbuffer. This way seems safer. - // - hr = IDirect3DDevice8_CopyRects( - gld->pDev, - pBackbuffer, - &rcSrc, - 1, - pNativeImage, - &ptDst); - if (FAILED(hr)) { - goto gld_ReadPixels_DX7_return; - } - - // Create an RGBA8888 surface - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - &pCanonicalImage); - if (FAILED(hr)) { - goto gld_ReadPixels_DX7_return; - } - - // Convert to RGBA8888 - hr = D3DXLoadSurfaceFromSurface( - pCanonicalImage, // Dest surface - NULL, NULL, // Dest palette, RECT - pNativeImage, // Src surface - NULL, NULL, // Src palette, RECT - D3DX_FILTER_NONE, // Filter - 0); // Colourkey - if (FAILED(hr)) { - goto gld_ReadPixels_DX7_return; - } - - srcPacking.Alignment = 1; - srcPacking.ImageHeight = height; - srcPacking.LsbFirst = GL_FALSE; - srcPacking.RowLength = 0; - srcPacking.SkipImages = 0; - srcPacking.SkipPixels = 0; - srcPacking.SkipRows = 0; - srcPacking.SwapBytes = GL_FALSE; - - // Lock all of image - hr = IDirect3DSurface8_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - goto gld_ReadPixels_DX7_return; - } - - // We need to flip the data. Yuck. - // Perhaps Mesa has a span packer we can use in future... - for (i=0; iTexFormat->StoreImage( - ctx, - 2, - GL_RGBA, // base format - MesaFormat, // dst format - pDestRow, // dest addr - width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z - DstRowStride, // dst row stride - 0, // dstImageStride - GL_BGRA, // src format - GL_UNSIGNED_BYTE, // src type - pSrcRow, // src addr - &srcPacking); // packing params of source image - } - - IDirect3DSurface8_UnlockRect(pCanonicalImage); - -gld_ReadPixels_DX7_return: - SAFE_RELEASE_SURFACE8(pCanonicalImage); - SAFE_RELEASE_SURFACE8(pNativeImage); - SAFE_RELEASE_SURFACE8(pBackbuffer); -#endif -} - -//--------------------------------------------------------------------------- - -void gld_CopyPixels_DX7( - GLcontext *ctx, - GLint srcx, - GLint srcy, - GLsizei width, - GLsizei height, - GLint dstx, - GLint dsty, - GLenum type) -{ -// TODO -#if 0 - // - // NOTE: Not allowed to copy vidmem to vidmem! - // Therefore we use an intermediate image surface. - // - - GLD_context *gldCtx; - GLD_driver_dx7 *gld; - - IDirect3DSurface8 *pBackbuffer; - D3DSURFACE_DESC d3dsd; - IDirect3DSurface8 *pImage; - RECT rcSrc; // Source rect - POINT ptDst; // Dest point - HRESULT hr; - - // Only backbuffer - if (type != GL_COLOR) - return; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX7_DRIVER(gldCtx); - - // Get backbuffer - hr = IDirect3DDevice8_GetBackBuffer( - gld->pDev, - 0, // First backbuffer - D3DBACKBUFFER_TYPE_MONO, - &pBackbuffer); - if (FAILED(hr)) - return; - - // Get backbuffer description - hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pBackbuffer); - return; - } - - // Create a surface compatible with backbuffer - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - d3dsd.Format, - &pImage); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pBackbuffer); - return; - } - - // Compute source rect and dest point - SetRect(&rcSrc, 0, 0, width, height); - OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height)); - ptDst.x = ptDst.y = 0; - - // Get source pixels - hr = IDirect3DDevice8_CopyRects( - gld->pDev, - pBackbuffer, - &rcSrc, - 1, - pImage, - &ptDst); - IDirect3DSurface8_Release(pBackbuffer); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pImage); - return; - } - - _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage); - - IDirect3DSurface8_Release(pImage); -#endif -} - -//--------------------------------------------------------------------------- - -void gld_Bitmap_DX7( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei width, - GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - GLD_context *gldCtx; - GLD_driver_dx7 *gld; - - IDirectDrawSurface7 *pImage; // Bitmap texture - HRESULT hr; - BYTE *pTempBitmap; // Pointer to unpacked bitmap - D3DCOLOR clBitmapOne; // Opaque bitmap colour - D3DCOLOR clBitmapZero; // Transparent bitmap colour - D3DCOLOR *pBits; // Pointer to texture surface - const GLubyte *src; - int i, j, k; - - DDSURFACEDESC2 ddsd; // Surface desc returned by lock call - DWORD dwFlags; - D3DX_SURFACEFORMAT sf; - DWORD dwMipmaps; - - // Keep a copy of width/height as D3DXCreateTexture() call may alter input dimensions - GLsizei dwWidth = width; - GLsizei dwHeight = height; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX7_DRIVER(gldCtx); - - // Bail if no bitmap (only raster pos is updated) - if ((bitmap == NULL) && (width==0) && (height==0)) - return; - - // - // TODO: Detect conditions when created texture (pImage) is non-pow2. - // Texture coords may need to be adjusted to compensate. - // - - clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero - clBitmapOne = D3DCOLOR_COLORVALUE( - ctx->Current.RasterColor[0], - ctx->Current.RasterColor[1], - ctx->Current.RasterColor[2], - 1.0f); // NOTE: Alpha is One - - // Use Mesa to unpack bitmap into a canonical format - pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack); - if (pTempBitmap == NULL) - return; - - // Flags for texture creation - dwFlags = D3DX_TEXTURE_NOMIPMAP; - sf = D3DX_SF_A8R8G8B8; - dwMipmaps = 1; - - // Create a D3D texture to hold the bitmap - hr = D3DXCreateTexture( - gld->pDev, - &dwFlags, - &dwWidth, &dwHeight, - &sf, // format - NULL, // palette - &pImage, // Output texture - &dwMipmaps); - if (FAILED(hr)) { - FREE(pTempBitmap); - return; - } - - // D3DXCreateTexture may return a texture bigger than we asked for - // (i.e. padded to POW2) so let's clear the entire image bitmap. - // Additional: Looks like this is not strictly necessary. -// _gldClearSurface(pImage, clBitmapZero); - - ddsd.dwSize = sizeof(DDSURFACEDESC2); - dwFlags = DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT; - hr = IDirectDrawSurface7_Lock(pImage, NULL, &ddsd, dwFlags, NULL); - if (FAILED(hr)) { - FREE(pTempBitmap); - SAFE_RELEASE_SURFACE7(pImage); - return; - } - -#if 0 - // DEBUG CODE - if (!(width==ddsd.dwWidth && height==ddsd.dwHeight)) - ddlogPrintf(GLDLOG_WARN, "gld_Bitmap: In=%d,%d / Tex=%d,%d", width,height,ddsd.dwWidth,ddsd.dwHeight); -#endif - -#if 0 - // DEBUG CODE - ddlogPrintf(GLDLOG_SYSTEM, "gld_Bitmap: In=%d,%d / Tex=%d,%d", width,height,ddsd.dwWidth,ddsd.dwHeight); - ddlogPrintf(GLDLOG_SYSTEM, "gld_Bitmap: bpp=%d", ddsd.ddpfPixelFormat.dwRGBBitCount); -#endif - - // Cast texel pointer to texture surface. - // We can do this because we used D3DX_SF_A8R8G8B8 as the format - pBits = (D3DCOLOR*)ddsd.lpSurface; - - - // Copy from the input bitmap into the texture - for (i=0; iDefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, - 0, i, 0); - for (j=0; j<(width>>3); j++) { - byte = *src++; - for (k=0; k<8; k++) { - *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero; - byte <<= 1; - } - } - // Fill remaining bits from bitmap - if (width & 7) { - byte = *src; - for (k=0; k<(width & 7); k++) { - *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero; - byte <<= 1; - } - } - } - - // We're done with the unpacked bitmap - FREE(pTempBitmap); - - // Finished with texture surface - unlock it - IDirectDrawSurface7_Unlock(pImage, NULL); - - // Use internal function to draw bitmap onto rendertarget - _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage); - - // We're done with the bitmap texure - release it - IDirectDrawSurface7_Release(pImage); -} - -//--------------------------------------------------------------------------- -// Texture functions -//--------------------------------------------------------------------------- - -void _gldAllocateTexture( - GLcontext *ctx, - struct gl_texture_object *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - HRESULT hr; - IDirectDrawSurface7 *pTex; - D3DX_SURFACEFORMAT d3dFormat; - DWORD dwFlags; - DWORD dwMipmaps; - DWORD dwWidth, dwHeight; - - if (!tObj || !texImage) - return; - - pTex = (IDirectDrawSurface7*)tObj->DriverData; - if (pTex) { - // Decide whether we can keep existing D3D texture - // by examining top-level surface. - DDSURFACEDESC2 ddsd; - ddsd.dwSize = sizeof(DDSURFACEDESC2); - _GLD_DX7_TEX(GetSurfaceDesc(pTex, &ddsd)); - // Release existing texture if not compatible - if ((ddsd.dwWidth == texImage->Width) || - (ddsd.dwHeight == texImage->Height)) - { - return; // Keep the existing texture - } - tObj->DriverData = NULL; - _GLD_DX7_TEX(Release(pTex)); - } - - dwFlags = (glb.bUseMipmaps) ? 0 : D3DX_TEXTURE_NOMIPMAP; - dwMipmaps = (glb.bUseMipmaps) ? D3DX_DEFAULT : 1; - dwWidth = texImage->Width; - dwHeight = texImage->Height; - - d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat); - hr = D3DXCreateTexture( - gld->pDev, - &dwFlags, - &dwWidth, - &dwHeight, - &d3dFormat, - NULL, - &pTex, - &dwMipmaps); - if (FAILED(hr)) { - gldLogError(GLDLOG_ERROR, "AllocateTexture failed", hr); - } - tObj->DriverData = pTex; -} - -//--------------------------------------------------------------------------- - -const struct gl_texture_format* gld_ChooseTextureFormat_DX7( - GLcontext *ctx, - GLint internalFormat, - GLenum srcFormat, - GLenum srcType) -{ - // [Based on mesa_choose_tex_format()] - // - // We will choose only texture formats that are supported - // by Direct3D. If the hardware doesn't support a particular - // texture format, then the D3DX texture calls that we use - // will automatically use a HW supported format. - // - // The most critical aim is to reduce copying; if we can use - // texture-image data directly then it will be a big performance assist. - // - - switch (internalFormat) { - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return &_mesa_texformat_l8; // D3DFMT_L8 - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return &_mesa_texformat_l8; // D3DFMT_L8 - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return &_mesa_texformat_a8; // D3DFMT_A8 - 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 &_mesa_texformat_rgb565; // D3DFMT_R5G6B5 - // Mesa will convert this for us later... - // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5 - 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 &_mesa_texformat_al88; // D3DFMT_A8L8 - case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2 - case GL_RGB4: - case GL_RGBA4: - case GL_RGBA2: - return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4 - case 3: - case GL_RGB: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return &_mesa_texformat_rgb565; - case 4: - case GL_RGBA: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return &_mesa_texformat_argb8888; - case GL_RGB5_A1: - return &_mesa_texformat_argb1555; - default: - _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat"); - return NULL; - } -} - -//--------------------------------------------------------------------------- - -/* -// Safer(?), slower version. -void gld_TexImage2D_DX7( - GLcontext *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 *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - IDirect3DTexture8 *pTex; - IDirect3DSurface8 *pSurface; - RECT rcSrcRect; - HRESULT hr; - GLint texelBytes = 4; - GLvoid *tempImage; - - if (!tObj || !texImage) - return; - - if (level == 0) { - _gldAllocateTexture(ctx, tObj, texImage); - } - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture8_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - IDirect3DSurface8_Release(pSurface); - return; - } - // unpack image, apply transfer ops and store in tempImage - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - &_mesa_texformat_argb8888, // dest format - tempImage, - width, height, 1, 0, 0, 0, - width * texelBytes, - 0, // dstImageStride - format, type, pixels, packing); - - SetRect(&rcSrcRect, 0, 0, width, height); - D3DXLoadSurfaceFromMemory( - pSurface, - NULL, - NULL, - tempImage, - D3DFMT_A8R8G8B8, - width * texelBytes, - NULL, - &rcSrcRect, - D3DX_FILTER_NONE, - 0); - - FREE(tempImage); - IDirect3DSurface8_Release(pSurface); -} -*/ - -//--------------------------------------------------------------------------- - -// Faster, more efficient version. -// Copies subimage straight to dest texture -void gld_TexImage2D_DX7( - GLcontext *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 *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - IDirectDrawSurface7 *pTex = NULL; - IDirectDrawSurface7 *pSurface = NULL; - HRESULT hr; - DDSURFACEDESC2 ddsd; - int i; - DDSCAPS2 ddsCaps; - - if (!tObj || !texImage) - return; - - // GLQUAKE FIX - // Test for input alpha data with non-alpha internalformat - if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) { - // Input format has alpha, but a non-alpha format has been requested. - texImage->IntFormat = GL_RGBA; - internalFormat = GL_RGBA; - } - - if (level == 0) { - _gldAllocateTexture(ctx, tObj, texImage); - } - - pTex = (IDirectDrawSurface7*)tObj->DriverData; - if (!pTex) { - ASSERT(0); - return; // Texture has not been created - } - - pSurface = pTex; - if (level != 0) { - ddsd.dwSize = sizeof(ddsd); - _GLD_DX7_TEX(GetSurfaceDesc(pTex, &ddsd)); - if ((level > 0) && (level >= ddsd.dwMipMapCount)) - return; // Level does not exist - ZeroMemory(&ddsCaps, sizeof(ddsCaps)); - for (i=0; iTexFormat->StoreImage( - ctx, - 2, - texImage->Format, - //_gldMesaFormatForD3DFormat(d3dsd.Format), - _gldMesaFormatForD3DFormat(_gldD3DXFormatFromSurface(pSurface)), - ddsd.lpSurface, - width, height, 1, 0, 0, 0, - ddsd.lPitch, - 0, // dstImageStride - format, type, pixels, packing); - - IDirectDrawSurface7_Unlock(pSurface, NULL); -} - -//--------------------------------------------------------------------------- - -void gld_TexImage1D_DX7(GLcontext *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 ) -{ - // A 1D texture is a 2D texture with a height of zero - gld_TexImage2D_DX7(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage); -} - -//--------------------------------------------------------------------------- - -/* -void gld_TexSubImage2D( GLcontext *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 *tObj, - struct gl_texture_image *texImage ) -{ - GLD_GET_CONTEXT - IDirect3DTexture8 *pTex; - IDirect3DSurface8 *pSurface; - D3DFORMAT d3dFormat; - HRESULT hr; - GLint texelBytes = 4; - GLvoid *tempImage; - RECT rcSrcRect; - RECT rcDstRect; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= _GLD_DX8_TEX(GetLevelCount(pTex)) - return; // Level does not exist - hr = _GLD_DX8_TEX(GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - d3dFormat = _gldGLFormatToD3DFormat(texImage->Format); - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - IDirect3DSurface8_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store in tempImage - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - &_mesa_texformat_argb8888, // dest format - tempImage, - width, height, 1, 0, 0, 0, - width * texelBytes, - 0, // dstImageStride - format, type, pixels, packing); - - // Source rectangle is whole of input image - SetRect(&rcSrcRect, 0, 0, width, height); - - // Dest rectangle must be offset to dest image - SetRect(&rcDstRect, 0, 0, width, height); - OffsetRect(&rcDstRect, xoffset, yoffset); - - D3DXLoadSurfaceFromMemory( - pSurface, - NULL, - &rcDstRect, - tempImage, - D3DFMT_A8R8G8B8, - width * texelBytes, - NULL, - &rcSrcRect, - D3DX_FILTER_NONE, - 0); - - FREE(tempImage); - IDirect3DSurface8_Release(pSurface); -} -*/ - -//--------------------------------------------------------------------------- - -// Faster, more efficient version. -// Copies subimage straight to dest texture -void gld_TexSubImage2D_DX7( GLcontext *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 *tObj, - struct gl_texture_image *texImage ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - IDirectDrawSurface7 *pTex; - IDirectDrawSurface7 *pSurface; - HRESULT hr; - RECT rcDstRect; - DDSURFACEDESC2 ddsd; - int i; - DDSCAPS2 ddsCaps; - - if (!tObj || !texImage) - return; - - pTex = (IDirectDrawSurface7*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - - __try { - - ddsd.dwSize = sizeof(ddsd); - _GLD_DX7_TEX(GetSurfaceDesc(pTex, &ddsd)); - if ((level > 0) && (level >= ddsd.dwMipMapCount)) - return; // Level does not exist - - ZeroMemory(&ddsCaps, sizeof(ddsCaps)); - pSurface = pTex; - for (i=0; iTexFormat->StoreImage(ctx, 2, texImage->Format, - _gldMesaFormatForD3DFormat(_gldD3DXFormatFromSurface(pSurface)), - ddsd.lpSurface, - width, height, 1, - 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!! - ddsd.lPitch, - 0, // dstImageStride - format, type, pixels, packing); - - - IDirectDrawSurface7_Unlock(pSurface, &rcDstRect); - } - __except(EXCEPTION_EXECUTE_HANDLER) { - ; - } -} - -//--------------------------------------------------------------------------- - -void gld_TexSubImage1D_DX7( GLcontext *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 ) -{ - gld_TexSubImage2D_DX7(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage); -} - -//--------------------------------------------------------------------------- - -void gld_DeleteTexture_DX7( - GLcontext *ctx, - struct gl_texture_object *tObj) -{ - GLD_context *gld = (GLD_context*)(ctx->DriverCtx); - - __try { - - if (tObj) { - IDirectDrawSurface7 *pTex = (IDirectDrawSurface7*)tObj->DriverData; - if (pTex) { -/* // Make sure texture is not bound to a stage before releasing it - for (int i=0; iCurrentTexture[i] == pTex) { - gld->pDev->SetTexture(i, NULL); - gld->CurrentTexture[i] = NULL; - } - }*/ - _GLD_DX7_TEX(Release(pTex)); - tObj->DriverData = NULL; - } - } - - } - __except(EXCEPTION_EXECUTE_HANDLER) { - ; - } -} - -//--------------------------------------------------------------------------- - -__inline void _gldSetColorOps( - const GLD_driver_dx7 *gld, - GLuint unit, - DWORD ColorArg1, - D3DTEXTUREOP ColorOp, - DWORD ColorArg2) -{ - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1)); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp)); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2)); -} - -//--------------------------------------------------------------------------- - -__inline void _gldSetAlphaOps( - const GLD_driver_dx7 *gld, - GLuint unit, - DWORD AlphaArg1, - D3DTEXTUREOP AlphaOp, - DWORD AlphaArg2) -{ - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1)); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp)); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2)); -} - -//--------------------------------------------------------------------------- - -void gldUpdateTextureUnit( - GLcontext *ctx, - GLuint unit, - BOOL bPassThrough) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - D3DTEXTUREMINFILTER minfilter; - D3DTEXTUREMIPFILTER mipfilter; - GLenum BaseFormat; - DWORD dwColorArg0; - int iTexEnv = 0; - GLD_texenv *pTexenv; - - // NOTE: If bPassThrough is FALSE then texture stage can be - // disabled otherwise it must pass-through it's current fragment. - - const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = pUnit->_Current; - - IDirectDrawSurface7 *pTex = NULL; - if (tObj) { - pTex = (IDirectDrawSurface7*)tObj->DriverData; - } - - __try { - - // Enable texturing if unit is enabled and a valid D3D texture exists - // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT - //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) { - if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) { - // Enable texturing - _GLD_DX7_DEV(SetTexture(gld->pDev, unit, pTex)); - } else { - // Disable texturing, then return - _GLD_DX7_DEV(SetTexture(gld->pDev, unit, NULL)); - if (bPassThrough) { - _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE); - _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE); - } else { - _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE); - _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE); - } - return; - } - - // Texture parameters - _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter)); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter)); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter))); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS))); - _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT))); - - // Texture priority - _GLD_DX7_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f))); - - // Texture environment - // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops. - // See Page 355 of the Red Book. - BaseFormat = _gldDecodeBaseFormat(pTex); - - switch (BaseFormat) { - case GL_RGB: - iTexEnv = 0; - break; - case GL_RGBA: - iTexEnv = 1; - break; - case GL_ALPHA: - iTexEnv = 2; - break; - } - - switch (pUnit->EnvMode) { - case GL_DECAL: - iTexEnv += 0; - break; - case GL_REPLACE: - iTexEnv += 3; - break; - case GL_MODULATE: - iTexEnv += 6; - break; - case GL_BLEND: - // Set blend colour - // Unsupported by DX7 -// dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]); -// _GLD_DX7_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0)); -// gldLogMessage(GLDLOG_WARN, "GL_BLEND\n"); - iTexEnv += 9; - break; - case GL_ADD: - iTexEnv += 12; - break; - } - pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv]; - _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2); - _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2); - - } - __except(EXCEPTION_EXECUTE_HANDLER) { - ; - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_TEXTURE_DX7( - GLcontext *ctx) -{ - // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units - - BOOL bUnit0Enabled; - BOOL bUnit1Enabled; - - if (!ctx) - return; // Sanity check - - if (ctx->Const.MaxTextureUnits == 1) { - gldUpdateTextureUnit(ctx, 0, TRUE); - return; - } - - // - // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!! - // - - // Mesa 5: Texture Units altered - bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE; - bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE; - - // If Unit0 is disabled and Unit1 is enabled then we must pass-though - gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE); - // We can always disable the last texture unit - gldUpdateTextureUnit(ctx, 1, FALSE); - -#ifdef _DEBUG - { - // Find out whether device supports current renderstates - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - DWORD dwPasses; - _GLD_DX7_DEV(ValidateDevice(gld->pDev, &dwPasses)); -#if 0 - if (FAILED(hr)) { - gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr); - } -#endif - if (dwPasses != 1) { - gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n"); - } - } -#endif -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c deleted file mode 100644 index a85620dde..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c +++ /dev/null @@ -1,257 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect fastpath pipeline stage -* -****************************************************************************/ - -//--------------------------------------------------------------------------- - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx7.h" - -//--------------------------------------------------------------------------- - -#include "glheader.h" -#include "context.h" -#include "macros.h" -// #include "mem.h" -#include "mtypes.h" -//#include "mmath.h" - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "tnl/t_pipeline.h" - -//--------------------------------------------------------------------------- -/* -__inline void _gldSetVertexShaderConstants( - GLcontext *ctx, - GLD_driver_dx8 *gld) -{ - D3DXMATRIX mat, matView, matProj; - GLfloat *pM; - - // Mesa 5: Altered to a Stack - //pM = ctx->ModelView.m; - pM = ctx->ModelviewMatrixStack.Top->m; - matView._11 = pM[0]; - matView._12 = pM[1]; - matView._13 = pM[2]; - matView._14 = pM[3]; - matView._21 = pM[4]; - matView._22 = pM[5]; - matView._23 = pM[6]; - matView._24 = pM[7]; - matView._31 = pM[8]; - matView._32 = pM[9]; - matView._33 = pM[10]; - matView._34 = pM[11]; - matView._41 = pM[12]; - matView._42 = pM[13]; - matView._43 = pM[14]; - matView._44 = pM[15]; - - // Mesa 5: Altered to a Stack - //pM = ctx->ProjectionMatrix.m; - pM = ctx->ProjectionMatrixStack.Top->m; - matProj._11 = pM[0]; - matProj._12 = pM[1]; - matProj._13 = pM[2]; - matProj._14 = pM[3]; - matProj._21 = pM[4]; - matProj._22 = pM[5]; - matProj._23 = pM[6]; - matProj._24 = pM[7]; - matProj._31 = pM[8]; - matProj._32 = pM[9]; - matProj._33 = pM[10]; - matProj._34 = pM[11]; - matProj._41 = pM[12]; - matProj._42 = pM[13]; - matProj._43 = pM[14]; - matProj._44 = pM[15]; - - D3DXMatrixMultiply( &mat, &matView, &matProj ); - D3DXMatrixTranspose( &mat, &mat ); - - _GLD_DX8_DEV(SetVertexShaderConstant(gld->pDev, 0, &mat, 4)); -} -*/ -//--------------------------------------------------------------------------- - -static GLboolean gld_d3d_render_stage_run( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - TNLcontext *tnl; - struct vertex_buffer *VB; - tnl_render_func *tab; - GLint pass; - GLD_pb_dx7 *gldPB = &gld->PB3d; - DWORD dwFlags; - -/* - static int count = 0; - count++; - if (count != 2) - return GL_FALSE; -*/ - // The "check" function should disable this stage, - // but we'll test gld->bUseMesaTnL anyway. - if (gld->bUseMesaTnL) { - // Do nothing in this stage, but continue pipeline - return GL_TRUE; - } - - tnl = TNL_CONTEXT(ctx); - VB = &tnl->vb; - pass = 0; - - tnl->Driver.Render.Start( ctx ); - -#if 0 - // For debugging: Useful to see if an app passes colour data in - // an unusual format. - switch (VB->ColorPtr[0]->Type) { - case GL_FLOAT: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); - break; - case GL_UNSIGNED_BYTE: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n"); - break; - default: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n"); - break; - } -#endif - - tnl->Driver.Render.Points = gld_Points3D_DX7; - if (ctx->_TriangleCaps & DD_FLATSHADE) { - tnl->Driver.Render.Line = gld_Line3DFlat_DX7; - tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX7; - tnl->Driver.Render.Quad = gld_Quad3DFlat_DX7; - } else { - tnl->Driver.Render.Line = gld_Line3DSmooth_DX7; - tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX7; - tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX7; - } - -// _GLD_DX7_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD)); - dwFlags = DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY; - _GLD_DX7_VB(Lock(gldPB->pVB, dwFlags, &gldPB->pPoints, NULL)); - gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0; - // Allocate primitive pointers - // gldPB->pPoints is always first - gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine); - gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts); - - do { - GLuint i, length, flags = 0; - for (i = 0 ; !(flags & PRIM_END) ; i += length) - { - flags = VB->Primitive[i].mode; - length= VB->Primitive[i].count; - ASSERT(length || (flags & PRIM_END)); - ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); - if (length) - tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - _GLD_DX7_VB(Unlock(gldPB->pVB)); - -// _GLD_DX7_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride)); - - _GLD_DX7_DEV(SetTransform(gld->pDev, D3DTRANSFORMSTATE_PROJECTION, &gld->matProjection)); - _GLD_DX7_DEV(SetTransform(gld->pDev, D3DTRANSFORMSTATE_WORLD, &gld->matModelView)); - - if (gldPB->nPoints) { -// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints)); - _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_POINTLIST, gldPB->pVB, 0, gldPB->nPoints, 0)); - gldPB->nPoints = 0; - } - - if (gldPB->nLines) { -// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines)); - _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_LINELIST, gldPB->pVB, gldPB->iFirstLine, gldPB->nLines, 0)); - gldPB->nLines = 0; - } - - if (gldPB->nTriangles) { -// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles)); - _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_TRIANGLELIST, gldPB->pVB, gldPB->iFirstTriangle, gldPB->nTriangles, 0)); - gldPB->nTriangles = 0; - } - - return GL_FALSE; /* finished the pipe */ -} - - -//--------------------------------------------------------------------------- - -const struct tnl_pipeline_stage _gld_d3d_render_stage = -{ - "gld_d3d_render_stage", - NULL, - NULL, - NULL, - NULL, - gld_d3d_render_stage_run /* run */ -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c deleted file mode 100644 index 72e5e1308..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c +++ /dev/null @@ -1,422 +0,0 @@ - -/* - * 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. - * - * Authors: - * Keith Whitwell - */ - - -/* - * Render whole vertex buffers, including projection of vertices from - * clip space and clipping of primitives. - * - * This file makes calls to project vertices and to the point, line - * and triangle rasterizers via the function pointers: - * - * context->Driver.Render.* - * - */ - - -//--------------------------------------------------------------------------- - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx7.h" - -//--------------------------------------------------------------------------- - -#include "glheader.h" -#include "context.h" -#include "macros.h" -// #include "mem.h" -#include "mtypes.h" -//#include "mmath.h" - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "tnl/t_pipeline.h" - -/**********************************************************************/ -/* Clip single primitives */ -/**********************************************************************/ - - -#if defined(USE_IEEE) -#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31)) -//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31)) -#else -#define NEGATIVE(x) (x < 0) -//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0) -/* Could just use (x*y<0) except for the flatshading requirements. - * Maybe there's a better way? - */ -#endif - - -#define W(i) coord[i][3] -#define Z(i) coord[i][2] -#define Y(i) coord[i][1] -#define X(i) coord[i][0] -#define SIZE 4 -#define TAG(x) x##_4 -#include "tnl/t_vb_cliptmp.h" - - - -/**********************************************************************/ -/* Clip and render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, with the possibility of clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte ormask = c1|c2; \ - if (!ormask) \ - LineFunc( ctx, v1, v2 ); \ - else if (!(c1 & c2 & 0x3f)) \ - clip_line_4( ctx, v1, v2, ormask ); \ -} while (0) - -#define RENDER_TRI( v1, v2, v3 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \ - GLubyte ormask = c1|c2|c3; \ - if (!ormask) \ - TriangleFunc( ctx, v1, v2, v3 ); \ - else if (!(c1 & c2 & c3 & 0x3f)) \ - clip_tri_4( ctx, v1, v2, v3, ormask ); \ -} while (0) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte c3 = mask[v3], c4 = mask[v4]; \ - GLubyte ormask = c1|c2|c3|c4; \ - if (!ormask) \ - QuadFunc( ctx, v1, v2, v3, v4 ); \ - else if (!(c1 & c2 & c3 & c4 & 0x3f)) \ - clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \ -} while (0) - - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const GLubyte *mask = VB->ClipMask; \ - const GLuint sz = VB->ClipPtr->size; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; (void) mask; (void) sz; (void) stipple; - -#define TAG(x) clip_##x##_verts -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx ) -#define PRESERVE_VB_DEFS -#include "tnl/t_vb_rendertmp.h" - - - -/* Elts, with the possibility of clipping. - */ -#undef ELT -#undef TAG -#define ELT(x) elt[x] -#define TAG(x) clip_##x##_elts -#include "tnl/t_vb_rendertmp.h" - -/* TODO: do this for all primitives, verts and elts: - */ -static void clip_elt_triangles( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES]; - struct vertex_buffer *VB = &tnl->vb; - const GLuint * const elt = VB->Elts; - GLubyte *mask = VB->ClipMask; - GLuint last = count-2; - GLuint j; - (void) flags; - - tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES ); - - for (j=start; j < last; j+=3 ) { - GLubyte c1 = mask[elt[j]]; - GLubyte c2 = mask[elt[j+1]]; - GLubyte c3 = mask[elt[j+2]]; - GLubyte ormask = c1|c2|c3; - if (ormask) { - if (start < j) - render_tris( ctx, start, j, 0 ); - if (!(c1&c2&c3&0x3f)) - clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask ); - start = j+3; - } - } - - if (start < j) - render_tris( ctx, start, j, 0 ); -} - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, no clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ - LineFunc( ctx, v1, v2 ) - -#define RENDER_TRI( v1, v2, v3 ) \ - TriangleFunc( ctx, v1, v2, v3 ) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ - QuadFunc( ctx, v1, v2, v3, v4 ) - -#define TAG(x) _gld_tnl_##x##_verts - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; - -#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx ) -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RENDER_TAB_QUALIFIER -#define PRESERVE_VB_DEFS -#include "tnl/t_vb_rendertmp.h" - - -/* Elts, no clipping. - */ -#undef ELT -#define TAG(x) _gld_tnl_##x##_elts -#define ELT(x) elt[x] -#include "tnl/t_vb_rendertmp.h" - - -/**********************************************************************/ -/* Helper functions for drivers */ -/**********************************************************************/ -/* -void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint *tmp = VB->Elts; - - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; -} - -void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} -*/ - - -/**********************************************************************/ -/* Clip and render whole vertex buffers */ -/**********************************************************************/ - -tnl_points_func _gldSetupPoints[4] = { - gld_Points2D_DX7, - gld_Points2D_DX7, - gld_Points2D_DX7, - gld_Points2D_DX7 -}; -tnl_line_func _gldSetupLine[4] = { - gld_Line2DFlat_DX7, - gld_Line2DSmooth_DX7, - gld_Line2DFlat_DX7, - gld_Line2DSmooth_DX7, -}; -tnl_triangle_func _gldSetupTriangle[4] = { - gld_Triangle2DFlat_DX7, - gld_Triangle2DSmooth_DX7, - gld_Triangle2DFlatExtras_DX7, - gld_Triangle2DSmoothExtras_DX7 -}; -tnl_quad_func _gldSetupQuad[4] = { - gld_Quad2DFlat_DX7, - gld_Quad2DSmooth_DX7, - gld_Quad2DFlatExtras_DX7, - gld_Quad2DSmoothExtras_DX7 -}; - -//--------------------------------------------------------------------------- - -static GLboolean _gld_mesa_render_stage_run( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); - - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_render_func *tab; - GLint pass = 0; - GLD_pb_dx7 *gldPB; - DWORD dwFlags; - - /* Allow the drivers to lock before projected verts are built so - * that window coordinates are guarenteed not to change before - * rendering. - */ - ASSERT(tnl->Driver.Render.Start); - - tnl->Driver.Render.Start( ctx ); - - gldPB = &gld->PB2d; - tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc]; - tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc]; - tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc]; - tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc]; - - dwFlags = DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY; - _GLD_DX7_VB(Lock(gldPB->pVB, dwFlags, &gldPB->pPoints, NULL)); - gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0; - - // Allocate primitive pointers - gldPB->pPoints is always first - gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine); - gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 ); - - if (VB->ClipOrMask) { - tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts; - clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles; - } - else { - tab = (VB->Elts ? - tnl->Driver.Render.PrimTabElts : - tnl->Driver.Render.PrimTabVerts); - } - - do { - GLuint i, length, flags = 0; - for (i = 0 ; !(flags & PRIM_END) ; i += length) { - flags = VB->Primitive[i].mode; - length= VB->Primitive[i].count; - ASSERT(length || (flags & PRIM_END)); - ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); - if (length) - tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - -// tnl->Driver.Render.Finish( ctx ); - - _GLD_DX7_VB(Unlock(gldPB->pVB)); - - if (gldPB->nPoints) { - _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_POINTLIST, gldPB->pVB, 0, gldPB->nPoints, 0)); - gldPB->nPoints = 0; - } - - if (gldPB->nLines) { - _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_LINELIST, gldPB->pVB, gldPB->iFirstLine, gldPB->nLines*2, 0)); - gldPB->nLines = 0; - } - - if (gldPB->nTriangles) { - _GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_TRIANGLELIST, gldPB->pVB, gldPB->iFirstTriangle, gldPB->nTriangles*3, 0)); - gldPB->nTriangles = 0; - } - - return GL_FALSE; /* finished the pipe */ -} - - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - - -const struct tnl_pipeline_stage _gld_mesa_render_stage = -{ - "gld_mesa_render_stage", - NULL, - NULL, - NULL, - NULL, - _gld_mesa_render_stage_run /* run */ -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c b/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c deleted file mode 100644 index fa44a952a..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c +++ /dev/null @@ -1,1613 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect Direct3D 8.x WGL (WindowsGL) -* -****************************************************************************/ - -#include "dglcontext.h" -#include "gld_driver.h" -//#include "gld_dxerr8.h" -#include "gld_dx7.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" - -// Copied from dglcontect.c -#define GLDERR_NONE 0 -#define GLDERR_MEM 1 -#define GLDERR_DDRAW 2 -#define GLDERR_D3D 3 -#define GLDERR_BPP 4 -#define GLDERR_DDS 5 -// This external var keeps track of any error -extern int nContextError; - -// Uncomment this for persistant resources -//#define _GLD_PERSISTANT - -#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL - -extern void _gld_mesa_warning(GLcontext *, char *); -extern void _gld_mesa_fatal(GLcontext *, char *); - -//--------------------------------------------------------------------------- - -static char szColorDepthWarning[] = -"GLDirect does not support the current desktop\n\ -color depth.\n\n\ -You may need to change the display resolution to\n\ -16 bits per pixel or higher color depth using\n\ -the Windows Display Settings control panel\n\ -before running this OpenGL application.\n"; - -// The only depth-stencil formats currently supported by Direct3D -// Surface Format Depth Stencil Total Bits -// D3DFMT_D32 32 - 32 -// D3DFMT_D15S1 15 1 16 -// D3DFMT_D24S8 24 8 32 -// D3DFMT_D16 16 - 16 -// D3DFMT_D24X8 24 - 32 -// D3DFMT_D24X4S4 24 4 32 - -// This pixel format will be used as a template when compiling the list -// of pixel formats supported by the hardware. Many fields will be -// filled in at runtime. -// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM -static DGL_pixelFormat pfTemplateHW = -{ - { - sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure - 1, // Structure version - should be 1 - // Flags: - PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface. - PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM) - PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM) - PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing. - PFD_DOUBLEBUFFER | // The buffer is double-buffered. - 0, // Placeholder for easy commenting of above flags - PFD_TYPE_RGBA, // Pixel type RGBA. - 16, // Total colour bitplanes (excluding alpha bitplanes) - 5, 0, // Red bits, shift - 5, 0, // Green bits, shift - 5, 0, // Blue bits, shift - 0, 0, // Alpha bits, shift (destination alpha) - 0, // Accumulator bits (total) - 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha - 0, // Depth bits - 0, // Stencil bits - 0, // Number of auxiliary buffers - 0, // Layer type - 0, // Specifies the number of overlay and underlay planes. - 0, // Layer mask - 0, // Specifies the transparent color or index of an underlay plane. - 0 // Damage mask - }, - D3DX_SF_UNKNOWN, // No depth/stencil buffer -}; - -//--------------------------------------------------------------------------- -// Vertex Shaders -//--------------------------------------------------------------------------- -/* -// Vertex Shader Declaration -static DWORD dwTwoSidedLightingDecl[] = -{ - D3DVSD_STREAM(0), - D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position - D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal - D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color - D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color - D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0 - D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1 - D3DVSD_END() -}; - -// Vertex Shader for two-sided lighting -static char *szTwoSidedLightingVS = -// This is a test shader! -"vs.1.0\n" -"m4x4 oPos,v0,c0\n" -"mov oD0,v2\n" -"mov oD1,v3\n" -"mov oT0,v4\n" -"mov oT1,v5\n" -; -*/ -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -typedef struct { -// HINSTANCE hD3D8DLL; // Handle to d3d8.dll -// FNDIRECT3DCREATE7 fnDirect3DCreate7; // Direct3DCreate8 function prototype -// BOOL bDirect3D; // Persistant Direct3D7 exists -// BOOL bDirect3DDevice; // Persistant Direct3DDevice7 exists -// IDirect3D7 *pD3D; // Persistant Direct3D7 -// IDirect3DDevice7 *pDev; // Persistant Direct3DDevice7 - BOOL bD3DXStarted; -} GLD_dx7_globals; - -// These are "global" to all DX7 contexts. KeithH -static GLD_dx7_globals dx7Globals; - -// Added for correct clipping of multiple open windows. (DaveM) -LPDIRECTDRAWSURFACE7 lpDDSPrimary = NULL; -LPDIRECTDRAWCLIPPER lpDDClipper = NULL; - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -BOOL gldGetDXErrorString_DX( - HRESULT hr, - char *buf, - int nBufSize) -{ - // - // Return a string describing the input HRESULT error code - // - - D3DXGetErrorString(hr, nBufSize, buf); - return TRUE; -} - -//--------------------------------------------------------------------------- -// -// DX7 does not support multisample -/* -static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType( - IDirect3D8 *pD3D8, - D3DFORMAT SurfaceFormat, - D3DDEVTYPE d3dDevType, - BOOL Windowed) -{ - int i; - HRESULT hr; - - if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE) - return D3DMULTISAMPLE_NONE; - - if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) { - // Find fastest multisample - for (i=2; i<17; i++) { - hr = IDirect3D8_CheckDeviceMultiSampleType( - pD3D8, - glb.dwAdapter, - d3dDevType, - SurfaceFormat, - Windowed, - (D3DMULTISAMPLE_TYPE)i); - if (SUCCEEDED(hr)) { - return (D3DMULTISAMPLE_TYPE)i; - } - } - } else { - // Find nicest multisample - for (i=16; i>1; i--) { - hr = IDirect3D8_CheckDeviceMultiSampleType( - pD3D8, - glb.dwAdapter, - d3dDevType, - SurfaceFormat, - Windowed, - (D3DMULTISAMPLE_TYPE)i); - if (SUCCEEDED(hr)) { - return (D3DMULTISAMPLE_TYPE)i; - } - } - } - - // Nothing found - return default - return D3DMULTISAMPLE_NONE; -} -*/ -//--------------------------------------------------------------------------- - -void _gldDestroyPrimitiveBuffer( - GLD_pb_dx7 *gldVB) -{ - SAFE_RELEASE(gldVB->pVB); - - // Sanity check... - gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0; -} - -//--------------------------------------------------------------------------- - -HRESULT _gldCreatePrimitiveBuffer( - GLcontext *ctx, - GLD_driver_dx7 *lpCtx, - GLD_pb_dx7 *gldVB) -{ - HRESULT hResult; - char *szCreateVertexBufferFailed = "CreateVertexBuffer failed"; - DWORD dwMaxVertices; // Max number of vertices in vertex buffer - DWORD dwVBSize; // Total size of vertex buffer - D3DVERTEXBUFFERDESC vbdesc; - - // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we - // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize. - // We'll use IMM_SIZE if it's larger (which it should not be). - dwMaxVertices = MAX_ARRAY_LOCK_SIZE; - - // Max vertex buffer size limited in DX7. (DaveM) - if (dwMaxVertices*9 > D3DMAXNUMVERTICES) - dwMaxVertices = D3DMAXNUMVERTICES/9; - - // Now calculate how many vertices to allow for in total - // 1 per point, 2 per line, 6 per quad = 9 - dwVBSize = dwMaxVertices * 9 * gldVB->dwStride; - - vbdesc.dwSize = sizeof(vbdesc); - vbdesc.dwCaps = gldVB->dwCreateFlags; - vbdesc.dwFVF = gldVB->dwFVF; - vbdesc.dwNumVertices = dwMaxVertices * 9; - -/* hResult = IDirect3DDevice8_CreateVertexBuffer( - lpCtx->pDev, - dwVBSize, -RAgldVB->dwUsage, - gldVB->dwFVF, - gldVB->dwPool, - &gldVB->pVB);*/ - hResult = IDirect3D7_CreateVertexBuffer( - lpCtx->pD3D, - &vbdesc, - &gldVB->pVB, - 0); - if (FAILED(hResult)) { - ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed); - return hResult; - } - - gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0; - gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL; - gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB - gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB - - return S_OK; -} - -//--------------------------------------------------------------------------- -// Function: _gldCreateVertexShaders -// Create DX8 Vertex Shaders. -//--------------------------------------------------------------------------- -/* -void _gldCreateVertexShaders( - GLD_driver_dx8 *gld) -{ - DWORD dwFlags; - LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer - HRESULT hr; - -#ifdef _DEBUG - dwFlags = D3DXASM_DEBUG; -#else - dwFlags = 0; // D3DXASM_SKIPVALIDATION; -#endif - - ddlogMessage(DDLOG_INFO, "Creating shaders...\n"); - - // Init the shader handle - gld->VStwosidelight.hShader = 0; - - if (gld->d3dCaps8.MaxStreams == 0) { - // Lame DX8 driver doesn't support streams - // Not fatal, as defaults will be used - ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n"); - return; - } - - // ** THIS DISABLES VERTEX SHADER SUPPORT ** -// return; - // ** THIS DISABLES VERTEX SHADER SUPPORT ** - - // - // Two-sided lighting - // - -#if 0 - // - // DEBUGGING: Load shader from a text file - // - { - LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer - hr = D3DXAssembleShaderFromFile( - "twoside.vsh", - dwFlags, - NULL, // No constants - &pVSOpcodeBuffer, - &pVSErrorBuffer); - if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)) - ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)); - SAFE_RELEASE(pVSErrorBuffer); - } -#else - { - LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer - // Assemble ascii shader text into shader opcodes - hr = D3DXAssembleShader( - szTwoSidedLightingVS, - strlen(szTwoSidedLightingVS), - dwFlags, - NULL, // No constants - &pVSOpcodeBuffer, - &pVSErrorBuffer); - if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)) - ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)); - SAFE_RELEASE(pVSErrorBuffer); - } -#endif - if (FAILED(hr)) { - ddlogError(DDLOG_WARN, "AssembleShader failed", hr); - SAFE_RELEASE(pVSOpcodeBuffer); - return; - } - -// This is for debugging. Remove to enable vertex shaders in HW -#define _GLD_FORCE_SW_VS 0 - - if (_GLD_FORCE_SW_VS) { - // _GLD_FORCE_SW_VS should be disabled for Final Release - ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n"); - } - - // Try and create shader in hardware. - // NOTE: The D3D Ref device appears to succeed when trying to - // create the device in hardware, but later complains - // when trying to set it with SetVertexShader(). Go figure. - if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) { - // Don't try and create a hardware shader with the Ref device - hr = E_FAIL; // COM error/fail result - } else { - gld->VStwosidelight.bHardware = TRUE; - hr = IDirect3DDevice8_CreateVertexShader( - gld->pDev, - dwTwoSidedLightingDecl, - pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer), - &gld->VStwosidelight.hShader, - 0); - } - if (FAILED(hr)) { - ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n"); - // Failed. Try and create shader for software processing - hr = IDirect3DDevice8_CreateVertexShader( - gld->pDev, - dwTwoSidedLightingDecl, - pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer), - &gld->VStwosidelight.hShader, - D3DUSAGE_SOFTWAREPROCESSING); - if (FAILED(hr)) { - gld->VStwosidelight.hShader = 0; // Sanity check - ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr); - return; - } - // Succeeded, but for software processing - gld->VStwosidelight.bHardware = FALSE; - } - - SAFE_RELEASE(pVSOpcodeBuffer); - - ddlogMessage(DDLOG_INFO, "... OK\n"); -} - -//--------------------------------------------------------------------------- - -void _gldDestroyVertexShaders( - GLD_driver_dx8 *gld) -{ - if (gld->VStwosidelight.hShader) { - IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader); - gld->VStwosidelight.hShader = 0; - } -} -*/ -//--------------------------------------------------------------------------- - -BOOL gldCreateDrawable_DX( - DGL_ctx *ctx, -// BOOL bDefaultDriver, - BOOL bDirectDrawPersistant, - BOOL bPersistantBuffers) -{ - // - // bDirectDrawPersistant: applies to IDirect3D8 - // bPersistantBuffers: applies to IDirect3DDevice8 - // - -// D3DDEVTYPE d3dDevType; -// D3DPRESENT_PARAMETERS d3dpp; -// D3DDISPLAYMODE d3ddm; -// DWORD dwBehaviourFlags; -// D3DADAPTER_IDENTIFIER8 d3dIdent; - - HRESULT hr; - GLD_driver_dx7 *lpCtx = NULL; - D3DX_VIDMODEDESC d3ddm; - - // Parameters for D3DXCreateContextEx - // These will be different for fullscreen and windowed - DWORD dwDeviceIndex; - DWORD dwFlags; - HWND hwnd; - HWND hwndFocus; - DWORD numColorBits; - DWORD numAlphaBits; - DWORD numDepthBits; - DWORD numStencilBits; - DWORD numBackBuffers; - DWORD dwWidth; - DWORD dwHeight; - DWORD refreshRate; - - // Error if context is NULL. - if (ctx == NULL) - return FALSE; - - if (ctx->glPriv) { - lpCtx = ctx->glPriv; - // Release any existing interfaces (in reverse order) - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - lpCtx->pD3DXContext->lpVtbl->Release(lpCtx->pD3DXContext); - lpCtx->pD3DXContext = NULL; - } else { - lpCtx = (GLD_driver_dx7*)malloc(sizeof(GLD_driver_dx7)); - ZeroMemory(lpCtx, sizeof(lpCtx)); - } - -// d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; - // Use REF device if requested. Otherwise D3DX_DEFAULT will choose highest level - // of HW acceleration. - dwDeviceIndex = (glb.dwDriver == GLDS_DRIVER_REF) ? D3DX_HWLEVEL_REFERENCE : D3DX_DEFAULT; - - // TODO: Check this -// if (bDefaultDriver) -// d3dDevType = D3DDEVTYPE_REF; - -#ifdef _GLD_PERSISTANT - // Use persistant interface if needed - if (bDirectDrawPersistant && dx7Globals.bDirect3D) { - lpCtx->pD3D = dx7Globals.pD3D; - IDirect3D7_AddRef(lpCtx->pD3D); - goto SkipDirectDrawCreate; - } -#endif -/* - // Create Direct3D7 object - lpCtx->pD3D = dx7Globals.fnDirect3DCreate8(D3D_SDK_VERSION_DX8_SUPPORT_WIN95); - if (lpCtx->pD3D == NULL) { - MessageBox(NULL, "Unable to initialize Direct3D8", "GLDirect", MB_OK); - ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D8 interface"); - nContextError = GLDERR_D3D; - goto return_with_error; - } -*/ - -#ifdef _GLD_PERSISTANT - // Cache Direct3D interface for subsequent GLRCs - if (bDirectDrawPersistant && !dx8Globals.bDirect3D) { - dx7Globals.pD3D = lpCtx->pD3D; - IDirect3D7_AddRef(dx7Globals.pD3D); - dx7Globals.bDirect3D = TRUE; - } -SkipDirectDrawCreate: -#endif -/* - // Get the display mode so we can make a compatible backbuffer - hResult = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hResult)) { - nContextError = GLDERR_D3D; - goto return_with_error; - } -*/ - -#if 0 - // Get device caps - hResult = IDirect3D8_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps8); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_GetDeviceCaps failed", hResult); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Check for hardware transform & lighting - lpCtx->bHasHWTnL = lpCtx->d3dCaps8.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE; - - // If this flag is present then we can't default to Mesa - // SW rendering between BeginScene() and EndScene(). - if (lpCtx->d3dCaps8.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) { - ddlogMessage(DDLOG_WARN, - "Warning : No 2D allowed during 3D scene.\n"); - } -#endif - - // - // Create the Direct3D context - // - -#ifdef _GLD_PERSISTANT - // Re-use original IDirect3DDevice if persistant buffers exist. - // Note that we test for persistant IDirect3D8 as well - // bDirectDrawPersistant == persistant IDirect3D8 (DirectDraw8 does not exist) - if (bDirectDrawPersistant && bPersistantBuffers && dx7Globals.pD3D && dx7Globals.pDev) { - lpCtx->pDev = dx7Globals.pDev; - IDirect3DDevice7_AddRef(dx7Globals.pDev); - goto skip_direct3ddevice_create; - } -#endif -/* - // Clear the presentation parameters (sets all members to zero) - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Recommended by MS; needed for MultiSample. - // Be careful if altering this for FullScreenBlit - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - d3dpp.BackBufferFormat = d3ddm.Format; - d3dpp.BackBufferCount = 1; - d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen); - d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData; - d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE; - - if (ctx->bFullscreen) { - ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen - d3dpp.Windowed = FALSE; - d3dpp.BackBufferWidth = d3ddm.Width; - d3dpp.BackBufferHeight = d3ddm.Height; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - - // Support for vertical retrace synchronisation. - // Set default presentation interval in case caps bits are missing - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - if (glb.bWaitForRetrace) { - if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE; - } else { - if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - } - } else { - ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages - d3dpp.Windowed = TRUE; - d3dpp.BackBufferWidth = ctx->dwWidth; - d3dpp.BackBufferHeight = ctx->dwHeight; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = 0; - // FullScreen_PresentationInterval must be default for Windowed mode - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } - - // Decide if we can use hardware TnL - dwBehaviourFlags = (lpCtx->bHasHWTnL) ? - D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING; - // Add flag to tell D3D to be thread-safe - if (glb.bMultiThreaded) - dwBehaviourFlags |= D3DCREATE_MULTITHREADED; - hResult = IDirect3D8_CreateDevice(lpCtx->pD3D, - glb.dwAdapter, - d3dDevType, - ctx->hWnd, - dwBehaviourFlags, - &d3dpp, - &lpCtx->pDev); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_CreateDevice failed", hResult); - nContextError = GLDERR_D3D; - goto return_with_error; - } -*/ - - // Create D3DX context - if (ctx->bFullscreen) { - // - // FULLSCREEN - // - - // Get display mode - D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm); - - // Fullscreen Parameters - dwFlags = D3DX_CONTEXT_FULLSCREEN; - hwnd = ctx->hWnd; - hwndFocus = ctx->hWnd; - numColorBits = ctx->lpPF->pfd.cColorBits; - numAlphaBits = ctx->lpPF->pfd.cAlphaBits; - numDepthBits = ctx->lpPF->pfd.cDepthBits + ctx->lpPF->pfd.cStencilBits; - numStencilBits = ctx->lpPF->pfd.cStencilBits; - numBackBuffers = D3DX_DEFAULT; // Default is 1 backbuffer - dwWidth = d3ddm.width; - dwHeight = d3ddm.height; - refreshRate = d3ddm.refreshRate; // D3DX_DEFAULT; - } else { - // - // WINDOWED - // - - // Windowed Parameters - dwFlags = 0; // No flags means "windowed" - hwnd = ctx->hWnd; - hwndFocus = (HWND)D3DX_DEFAULT; - numColorBits = D3DX_DEFAULT; // Use Desktop depth - numAlphaBits = ctx->lpPF->pfd.cAlphaBits; - numDepthBits = ctx->lpPF->pfd.cDepthBits + ctx->lpPF->pfd.cStencilBits; - numStencilBits = ctx->lpPF->pfd.cStencilBits; - numBackBuffers = D3DX_DEFAULT; // Default is 1 backbuffer - dwWidth = ctx->dwWidth; - dwHeight = ctx->dwHeight; - refreshRate = D3DX_DEFAULT; - } - hr = D3DXCreateContextEx(dwDeviceIndex, dwFlags, hwnd, hwndFocus, - numColorBits, numAlphaBits, numDepthBits, numStencilBits, - numBackBuffers, - dwWidth, dwHeight, refreshRate, - &lpCtx->pD3DXContext); - if (FAILED(hr)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "D3DXCreateContextEx failed", hr); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Obtain D3D7 interfaces from ID3DXContext -// lpCtx->pDD = ID3DXContext_GetDD(lpCtx->pD3DXContext); - lpCtx->pDD = lpCtx->pD3DXContext->lpVtbl->GetDD(lpCtx->pD3DXContext); - if (lpCtx->pDD == NULL) - goto return_with_error; - lpCtx->pD3D = lpCtx->pD3DXContext->lpVtbl->GetD3D(lpCtx->pD3DXContext); - if (lpCtx->pD3D == NULL) - goto return_with_error; - lpCtx->pDev = lpCtx->pD3DXContext->lpVtbl->GetD3DDevice(lpCtx->pD3DXContext); - if (lpCtx->pDev == NULL) - goto return_with_error; - - // Need to manage clipper manually for multiple windows - // since DX7 D3DX utility lib does not appear to do that. (DaveM) - if (!ctx->bFullscreen) { - // Get primary surface too - lpDDSPrimary = lpCtx->pD3DXContext->lpVtbl->GetPrimary(lpCtx->pD3DXContext); - if (lpDDSPrimary == NULL) { - ddlogPrintf(DDLOG_WARN, "GetPrimary"); - goto return_with_error; - } - // Create clipper for correct window updates - if (IDirectDraw7_CreateClipper(lpCtx->pDD, 0, &lpDDClipper, NULL) != DD_OK) { - ddlogPrintf(DDLOG_WARN, "CreateClipper"); - goto return_with_error; - } - // Set the window that the clipper belongs to - if (IDirectDrawClipper_SetHWnd(lpDDClipper, 0, hwnd) != DD_OK) { - ddlogPrintf(DDLOG_WARN, "SetHWnd"); - goto return_with_error; - } - // Attach the clipper to the primary surface - if (IDirectDrawSurface7_SetClipper(lpDDSPrimary, lpDDClipper) != DD_OK) { - ddlogPrintf(DDLOG_WARN, "SetClipper"); - goto return_with_error; - } - } - - // Get device caps - IDirect3DDevice7_GetCaps(lpCtx->pDev, &lpCtx->d3dCaps); - - // Determine HW TnL - lpCtx->bHasHWTnL = lpCtx->d3dCaps.dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE; - -#ifdef _GLD_PERSISTANT - if (bDirectDrawPersistant && bPersistantBuffers && dx7Globals.pD3D) { - dx7Globals.pDev = lpCtx->pDev; - dx7Globals.bDirect3DDevice = TRUE; - } -#endif - -#if 0 - // Dump some useful stats - hResult = IDirect3D8_GetAdapterIdentifier( - lpCtx->pD3D, - glb.dwAdapter, - D3DENUM_NO_WHQL_LEVEL, // Avoids 1 to 2 second delay - &d3dIdent); - if (SUCCEEDED(hResult)) { - ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description); - ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]", - d3dIdent.Driver, - HIWORD(d3dIdent.DriverVersion.HighPart), - LOWORD(d3dIdent.DriverVersion.HighPart), - HIWORD(d3dIdent.DriverVersion.LowPart), - LOWORD(d3dIdent.DriverVersion.LowPart)); - ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]", - d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision); - } -#endif - - // Init projection matrix for D3D TnL - D3DXMatrixIdentity((D3DXMATRIX*)&lpCtx->matProjection); - lpCtx->matModelView = lpCtx->matProjection; -// gld->bUseMesaProjection = TRUE; - -skip_direct3ddevice_create: - - // Create buffers to hold primitives - lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX; -// lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM; - lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX); - lpCtx->PB2d.dwCreateFlags = D3DVBCAPS_DONOTCLIP | - D3DVBCAPS_SYSTEMMEMORY | - D3DVBCAPS_WRITEONLY; - hr = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d); - if (FAILED(hr)) - goto return_with_error; - - lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX; -// lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT; - lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX); - lpCtx->PB3d.dwCreateFlags = D3DVBCAPS_WRITEONLY; - - hr = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d); - if (FAILED(hr)) - goto return_with_error; - - // Zero the pipeline usage counters - lpCtx->PipelineUsage.qwMesa.QuadPart = -// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart = - lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0; - - // Assign drawable to GL private - ctx->glPriv = lpCtx; - return TRUE; - -return_with_error: - // Clean up and bail - _gldDestroyPrimitiveBuffer(&lpCtx->PB3d); - _gldDestroyPrimitiveBuffer(&lpCtx->PB2d); - - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - //SAFE_RELEASE(lpCtx->pD3DXContext); - lpCtx->pD3DXContext->lpVtbl->Release(lpCtx->pD3DXContext); - return FALSE; -} - -//--------------------------------------------------------------------------- - -BOOL gldResizeDrawable_DX( - DGL_ctx *ctx, - BOOL bDefaultDriver, - BOOL bPersistantInterface, - BOOL bPersistantBuffers) -{ - GLD_driver_dx7 *gld = NULL; -// D3DDEVTYPE d3dDevType; -// D3DPRESENT_PARAMETERS d3dpp; -// D3DDISPLAYMODE d3ddm; - D3DX_VIDMODEDESC d3ddm; - HRESULT hr; - DWORD dwWidth, dwHeight; - - // Error if context is NULL. - if (ctx == NULL) - return FALSE; - - gld = ctx->glPriv; - if (gld == NULL) - return FALSE; - - if (ctx->bSceneStarted) { - IDirect3DDevice7_EndScene(gld->pDev); - ctx->bSceneStarted = FALSE; - } -/* - d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; - if (!bDefaultDriver) - d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software) - - // Get the display mode so we can make a compatible backbuffer - hResult = IDirect3D8_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hResult)) { - nContextError = GLDERR_D3D; -// goto return_with_error; - return FALSE; - } -*/ - // Release objects before Reset() - _gldDestroyPrimitiveBuffer(&gld->PB3d); - _gldDestroyPrimitiveBuffer(&gld->PB2d); - -/* - // Clear the presentation parameters (sets all members to zero) - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Recommended by MS; needed for MultiSample. - // Be careful if altering this for FullScreenBlit - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - d3dpp.BackBufferFormat = d3ddm.Format; - d3dpp.BackBufferCount = 1; - d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen); - d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData; - d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE; - - // TODO: Sync to refresh - - if (ctx->bFullscreen) { - ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen - d3dpp.Windowed = FALSE; - d3dpp.BackBufferWidth = d3ddm.Width; - d3dpp.BackBufferHeight = d3ddm.Height; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - // Get better benchmark results? KeithH -// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED; - } else { - ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages - d3dpp.Windowed = TRUE; - d3dpp.BackBufferWidth = ctx->dwWidth; - d3dpp.BackBufferHeight = ctx->dwHeight; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = 0; - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } - hResult = IDirect3DDevice8_Reset(gld->pDev, &d3dpp); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult); - return FALSE; - //goto cleanup_and_return_with_error; - } -*/ - // Obtain dimensions of 'window' - if (ctx->bFullscreen) { - D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm); - dwWidth = d3ddm.width; - dwHeight = d3ddm.height; - } else { - dwWidth = ctx->dwWidth; - dwHeight = ctx->dwHeight; - } - - // Resize context - hr = gld->pD3DXContext->lpVtbl->Resize(gld->pD3DXContext, dwWidth, dwHeight); - if (FAILED(hr)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "gldResizeDrawable_DX: Resize failed", hr); - return FALSE; - } - - // Clear the resized surface (DaveM) - { - D3DVIEWPORT7 vp1, vp2; - IDirect3DDevice7_GetViewport(gld->pDev, &vp1); - IDirect3DDevice7_GetViewport(gld->pDev, &vp2); - vp2.dwX = 0; - vp2.dwY = 0; - vp2.dwWidth = dwWidth; - vp2.dwHeight = dwHeight; - IDirect3DDevice7_SetViewport(gld->pDev, &vp2); - hr = gld->pD3DXContext->lpVtbl->Clear(gld->pD3DXContext, D3DCLEAR_TARGET); - if (FAILED(hr)) - ddlogError(DDLOG_WARN, "gldResizeDrawable_DX: Clear failed", hr); - IDirect3DDevice7_SetViewport(gld->pDev, &vp1); - } - - // - // Recreate objects - // - _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d); - _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d); - - // Signal a complete state update - ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL); - - // Begin a new scene - IDirect3DDevice7_BeginScene(gld->pDev); - ctx->bSceneStarted = TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyDrawable_DX( - DGL_ctx *ctx) -{ - GLD_driver_dx7 *lpCtx = NULL; - - // Error if context is NULL. - if (!ctx) - return FALSE; - - // Error if the drawable does not exist. - if (!ctx->glPriv) - return FALSE; - - lpCtx = ctx->glPriv; - -#ifdef _DEBUG - // Dump out stats - ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X", - lpCtx->PipelineUsage.qwMesa.HighPart, - lpCtx->PipelineUsage.qwMesa.LowPart, - lpCtx->PipelineUsage.qwD3DFVF.HighPart, - lpCtx->PipelineUsage.qwD3DFVF.LowPart); -#endif - - // Destroy Primtive Buffers - _gldDestroyPrimitiveBuffer(&lpCtx->PB3d); - _gldDestroyPrimitiveBuffer(&lpCtx->PB2d); - - // Release DX interfaces (in reverse order) - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - //SAFE_RELEASE(lpCtx->pD3DXContext); - lpCtx->pD3DXContext->lpVtbl->Release(lpCtx->pD3DXContext); - - // Free the private drawable data - free(ctx->glPriv); - ctx->glPriv = NULL; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldCreatePrivateGlobals_DX(void) -{ -/* - ZeroMemory(&dx7Globals, sizeof(dx7Globals)); - - // Load d3d8.dll - dx8Globals.hD3D8DLL = LoadLibrary("D3D8.DLL"); - if (dx8Globals.hD3D8DLL == NULL) - return FALSE; - - // Now try and obtain Direct3DCreate8 - dx8Globals.fnDirect3DCreate8 = (FNDIRECT3DCREATE8)GetProcAddress(dx8Globals.hD3D8DLL, "Direct3DCreate8"); - if (dx8Globals.fnDirect3DCreate8 == NULL) { - FreeLibrary(dx8Globals.hD3D8DLL); - return FALSE; - } -*/ - - // Initialise D3DX - return FAILED(D3DXInitialize()) ? FALSE : TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyPrivateGlobals_DX(void) -{ -/* - if (dx7Globals.bDirect3DDevice) { - SAFE_RELEASE(dx7Globals.pDev); - dx7Globals.bDirect3DDevice = FALSE; - } - if (dx7Globals.bDirect3D) { - SAFE_RELEASE(dx7Globals.pD3D); - dx7Globals.bDirect3D = FALSE; - } - - FreeLibrary(dx8Globals.hD3D8DLL); - dx8Globals.hD3D8DLL = NULL; - dx8Globals.fnDirect3DCreate8 = NULL; -*/ - return FAILED(D3DXUninitialize()) ? FALSE : TRUE; -} - -//--------------------------------------------------------------------------- - -static void _BitsFromDisplayFormat( - D3DX_SURFACEFORMAT fmt, - BYTE *cColorBits, - BYTE *cRedBits, - BYTE *cGreenBits, - BYTE *cBlueBits, - BYTE *cAlphaBits) -{ - switch (fmt) { -/* case D3DX_SF_X1R5G5B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 5; - *cBlueBits = 5; - *cAlphaBits = 0; - return;*/ - case D3DX_SF_R5G5B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 5; - *cBlueBits = 5; - *cAlphaBits = 0; - return; - case D3DX_SF_R5G6B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 6; - *cBlueBits = 5; - *cAlphaBits = 0; - return; - case D3DX_SF_X8R8G8B8: - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 0; - return; - case D3DX_SF_A8R8G8B8: - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 8; - return; - } - - // Should not get here! - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 0; -} - -//--------------------------------------------------------------------------- - -static void _BitsFromDepthStencilFormat( - D3DX_SURFACEFORMAT fmt, - BYTE *cDepthBits, - BYTE *cStencilBits) -{ - // NOTE: GL expects either 32 or 16 as depth bits. - switch (fmt) { - case D3DX_SF_Z16S0: - *cDepthBits = 16; - *cStencilBits = 0; - return; - case D3DX_SF_Z32S0: - *cDepthBits = 32; - *cStencilBits = 0; - return; - case D3DX_SF_Z15S1: - *cDepthBits = 15; - *cStencilBits = 1; - return; - case D3DX_SF_Z24S8: - *cDepthBits = 24; - *cStencilBits = 8; - return; - case D3DX_SF_S1Z15: - *cDepthBits = 15; - *cStencilBits = 1; - return; - case D3DX_SF_S8Z24: - *cDepthBits = 24; - *cStencilBits = 8; - return; - } -} - -//--------------------------------------------------------------------------- -/* -BOOL GLD_CheckDepthStencilMatch( - DWORD dwDeviceIndex, - D3DX_SURFACEFORMAT sfWant) -{ - // Emulate function built in to DX9 - D3DX_SURFACEFORMAT sfFound; - int i; - int nFormats = D3DXGetMaxSurfaceFormats(dwDeviceIndex, NULL, D3DX_SC_DEPTHBUFFER); - if (nFormats) { - for (i=0; ilpVtbl->GetZBuffer(pD3DXContext); - - // Get pixel format of depth buffer - ddpf.dwSize = sizeof(ddpf); - pZBuffer->lpVtbl->GetPixelFormat(pZBuffer, &ddpf); - // Done with surface - release it - pZBuffer->lpVtbl->Release(pZBuffer); - - // Done with D3DX context - pD3DXContext->lpVtbl->Release(pD3DXContext); - - // Convert and return - return D3DXMakeSurfaceFormat(&ddpf); -} - -//--------------------------------------------------------------------------- - -BOOL gldBuildPixelformatList_DX(void) -{ - D3DX_DEVICEDESC d3dxdd; - D3DX_VIDMODEDESC d3ddm; - D3DX_SURFACEFORMAT fmt[64]; // 64 should be enough... - DWORD dwDeviceIndex; - DWORD surfClassFlags; -// IDirect3D7 *pD3D = NULL; - HRESULT hr; - int nSupportedFormats = 0; // Total formats - int nDepthOnlyFormats = 0; - int nDepthStencilFormats = 0; - int i; - DGL_pixelFormat *pPF; - BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits; -// char buf[128]; -// char cat[8]; - - // Direct3D (SW or HW) - // These are arranged so that 'best' pixelformat - // is higher in the list (for ChoosePixelFormat). -/* const D3DFORMAT DepthStencil[4] = { - D3DX_SF_Z16S0, //D3DX_SF_D16, - D3DX_SF_Z15S1, //D3DX_SF_D15S1, - D3DX_SF_Z32S0, //D3DX_SF_D32, - D3DX_SF_Z24S8, //D3DX_SF_D24S8, - //D3DX_SF_D24X8, - //D3DX_SF_D24X4S4, - };*/ - - // Dump DX version - ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 7.0\n"); - - // Release any existing pixelformat list - if (glb.lpPF) { - free(glb.lpPF); - } - - glb.nPixelFormatCount = 0; - glb.lpPF = NULL; - - // - // Pixelformats for Direct3D (SW or HW) rendering - // - - dwDeviceIndex = (glb.dwDriver == GLDS_DRIVER_REF) ? D3DX_HWLEVEL_REFERENCE : D3DX_DEFAULT; - - // Dump description - D3DXGetDeviceDescription(dwDeviceIndex, &d3dxdd); - ddlogPrintf(GLDLOG_SYSTEM, "Device: %s", d3dxdd.driverDesc); - - // Get display mode - D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm); - -#if 0 - // Phooey - this don't work... -/* - // Since D3DXGetMaxSurfaceFormats() can lie to us, we'll need a workaround. - // Explicitly test for matching depth/stencil to display bpp. - if (d3ddm.bpp <= 16) { - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z16S0)) - fmt[nSupportedFormats++] = D3DX_SF_Z16S0; - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z15S1)) - fmt[nSupportedFormats++] = D3DX_SF_Z15S1; - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_S1Z15)) - fmt[nSupportedFormats++] = D3DX_SF_S1Z15; - // Didn't find anything? Try default - if (nSupportedFormats == 0) { - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z32S0)) - fmt[nSupportedFormats++] = D3DX_SF_Z32S0; - } - } else { - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z32S0)) - fmt[nSupportedFormats++] = D3DX_SF_Z32S0; - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z24S8)) - fmt[nSupportedFormats++] = D3DX_SF_Z24S8; - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_S8Z24)) - fmt[nSupportedFormats++] = D3DX_SF_S8Z24; - // Didn't find anything? Try default - if (nSupportedFormats == 0) { - if (GLD_CheckDepthStencilMatch(dwDeviceIndex, D3DX_SF_Z16S0)) - fmt[nSupportedFormats++] = D3DX_SF_Z16S0; - } - } -*/ - // Go the Whole Hog... - fmt[nSupportedFormats++] = _gldFindCompatibleDepthStencilFormat(dwDeviceIndex); -#else - // - // Depth buffer formats WITHOUT stencil - // - surfClassFlags = D3DX_SC_DEPTHBUFFER; - nDepthOnlyFormats = D3DXGetMaxSurfaceFormats(dwDeviceIndex, NULL, surfClassFlags); - // - // Depth buffer formats WITH stencil - // - surfClassFlags = D3DX_SC_DEPTHBUFFER | D3DX_SC_STENCILBUFFER; - nDepthStencilFormats = D3DXGetMaxSurfaceFormats(dwDeviceIndex, NULL, surfClassFlags); - - // Work out how many formats we have in total - if ((nDepthOnlyFormats + nDepthStencilFormats) == 0) - return FALSE; // Bail: no compliant pixelformats - - // Get depth buffer formats WITHOUT stencil - surfClassFlags = D3DX_SC_DEPTHBUFFER; - for (i=0; ipfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - pPF->pfd.cDepthBits = 0; - pPF->pfd.cStencilBits = 0; - pPF->dwDriverData = D3DX_SF_UNKNOWN; - pPF++;*/ - - for (i=0; ipfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits); - pPF->dwDriverData = fmt[i]; - } - - // - // Add double-buffer formats - // - -/* memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat)); - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - pPF->pfd.cDepthBits = 0; - pPF->pfd.cStencilBits = 0; - pPF->dwDriverData = D3DX_SF_UNKNOWN; - pPF++;*/ - - for (i=0; ipfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits); - pPF->dwDriverData = fmt[i]; - } - - // Popup warning message if non RGB color mode - { - // This is a hack. KeithH - HDC hdcDesktop = GetDC(NULL); - DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL); - ReleaseDC(0, hdcDesktop); - if (dwDisplayBitDepth <= 8) { - ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth); - MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING); - } - } - - // Mark list as 'current' - glb.bPixelformatsDirty = FALSE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldInitialiseMesa_DX( - DGL_ctx *lpCtx) -{ - GLD_driver_dx7 *gld = NULL; - int MaxTextureSize, TextureLevels; - BOOL bSoftwareTnL; - - if (lpCtx == NULL) - return FALSE; - - gld = lpCtx->glPriv; - if (gld == NULL) - return FALSE; - - if (glb.bMultitexture) { - lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps.wMaxSimultaneousTextures; - // Only support MAX_TEXTURE_UNITS texture units. - // ** If this is altered then the FVF formats must be reviewed **. - if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX7) - lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX7; - } else { - // Multitexture override - lpCtx->glCtx->Const.MaxTextureUnits = 1; - } - - lpCtx->glCtx->Const.MaxDrawBuffers = 1; - - // max texture size -// MaxTextureSize = min(gld->d3dCaps8.MaxTextureHeight, gld->d3dCaps8.MaxTextureWidth); - MaxTextureSize = min(gld->d3dCaps.dwMaxTextureHeight, gld->d3dCaps.dwMaxTextureWidth); - if (MaxTextureSize == 0) - MaxTextureSize = 256; // Sanity check - - // - // HACK!! - if (MaxTextureSize > 1024) - MaxTextureSize = 1024; // HACK - CLAMP TO 1024 - // HACK!! - // - - // TODO: Check this again for Mesa 5 - // Got to set MAX_TEXTURE_SIZE as max levels. - // Who thought this stupid idea up? ;) - TextureLevels = 0; - // Calculate power-of-two. - while (MaxTextureSize) { - TextureLevels++; - MaxTextureSize >>= 1; - } - lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8; - - // Defaults - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_LIGHTING, FALSE); - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_DITHERENABLE, TRUE); - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD); - - // Set texture coord set to be used with each stage - IDirect3DDevice7_SetTextureStageState(gld->pDev, 0, D3DTSS_TEXCOORDINDEX, 0); - IDirect3DDevice7_SetTextureStageState(gld->pDev, 1, D3DTSS_TEXCOORDINDEX, 1); - - // Set up Depth buffer - IDirect3DDevice7_SetRenderState(gld->pDev, D3DRENDERSTATE_ZENABLE, - (lpCtx->lpPF->dwDriverData!=D3DX_SF_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE); - - // Set the view matrix - { - D3DXMATRIX vm; -#if 1 - D3DXMatrixIdentity(&vm); -#else - D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f); - D3DXVECTOR3 At(0.0f, 0.0f, -1.0f); - D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f); - D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up); - vm._31 = -vm._31; - vm._32 = -vm._32; - vm._33 = -vm._33; - vm._34 = -vm._34; -#endif - IDirect3DDevice7_SetTransform(gld->pDev, D3DTRANSFORMSTATE_VIEW, &vm); - } - -// DX7 does not support D3DRS_SOFTWAREVERTEXPROCESSING -/* - if (gld->bHasHWTnL) { - if (glb.dwTnL == GLDS_TNL_DEFAULT) - bSoftwareTnL = FALSE; // HW TnL - else { - bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE; - } - } else { - // No HW TnL, so no choice possible - bSoftwareTnL = TRUE; - } - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL); -*/ - -// Dump this in a Release build as well, now. -//#ifdef _DEBUG - ddlogPrintf(DDLOG_INFO, "HW TnL: %s", -// gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable"); - gld->bHasHWTnL ? "Enabled" : "Unavailable"); -//#endif - - // Set up interfaces to Mesa - gldEnableExtensions_DX7(lpCtx->glCtx); - gldInstallPipeline_DX7(lpCtx->glCtx); - gldSetupDriverPointers_DX7(lpCtx->glCtx); - - // Signal a complete state update - lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL); - - // Start a scene - IDirect3DDevice7_BeginScene(gld->pDev); - lpCtx->bSceneStarted = TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldSwapBuffers_DX( - DGL_ctx *ctx, - HDC hDC, - HWND hWnd) -{ - HRESULT hr; - GLD_driver_dx7 *gld = NULL; - DWORD dwFlags; - - if (ctx == NULL) - return FALSE; - - gld = ctx->glPriv; - if (gld == NULL) - return FALSE; - - - // End the scene if one is started - if (ctx->bSceneStarted) { - IDirect3DDevice7_EndScene(gld->pDev); - ctx->bSceneStarted = FALSE; - } - - // Needed by D3DX for MDI multi-window apps (DaveM) - if (lpDDClipper) - IDirectDrawClipper_SetHWnd(lpDDClipper, 0, hWnd); - - // Swap the buffers. hWnd may override the hWnd used for CreateDevice() -// hr = IDirect3DDevice8_Present(gld->pDev, NULL, NULL, hWnd, NULL); - - // Set refresh sync flag - dwFlags = glb.bWaitForRetrace ? 0 : D3DX_UPDATE_NOVSYNC; - // Render and show frame - hr = gld->pD3DXContext->lpVtbl->UpdateFrame(gld->pD3DXContext, dwFlags); - if (FAILED(hr)) - ddlogError(DDLOG_WARN, "gldSwapBuffers_DX: UpdateFrame", hr); - - if (hr == DDERR_SURFACELOST) { - hr = gld->pD3DXContext->lpVtbl->RestoreSurfaces(gld->pD3DXContext); - if (FAILED(hr)) - ddlogError(DDLOG_WARN, "gldSwapBuffers_DX: RestoreSurfaces", hr); - } - -exit_swap: - // Begin a new scene - IDirect3DDevice7_BeginScene(gld->pDev); - ctx->bSceneStarted = TRUE; - - return (FAILED(hr)) ? FALSE : TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldGetDisplayMode_DX( - DGL_ctx *ctx, - GLD_displayMode *glddm) -{ -// D3DDISPLAYMODE d3ddm; - D3DX_VIDMODEDESC d3ddm; - HRESULT hr; - GLD_driver_dx7 *lpCtx = NULL; - BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits; - - if ((glddm == NULL) || (ctx == NULL)) - return FALSE; - - lpCtx = ctx->glPriv; - if (lpCtx == NULL) - return FALSE; - - if (lpCtx->pD3D == NULL) - return FALSE; - -// hr = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm); - hr = D3DXGetCurrentVideoMode(D3DX_DEFAULT, &d3ddm); - if (FAILED(hr)) - return FALSE; - - // Get info from the display format -// _BitsFromDisplayFormat(d3ddm.Format, -// &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits); - - glddm->Width = d3ddm.width; - glddm->Height = d3ddm.height; - glddm->BPP = d3ddm.bpp; - glddm->Refresh = d3ddm.refreshRate; - - return TRUE; -} - -//--------------------------------------------------------------------------- - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c deleted file mode 100644 index 7afa9190c..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c +++ /dev/null @@ -1,1176 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Driver interface code to Mesa -* -****************************************************************************/ - -//#include -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx8.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -extern BOOL dglSwapBuffers(HDC hDC); - -// HACK: Hack the _33 member of the OpenGL perspective projection matrix -const float _fPersp_33 = 1.6f; - -//--------------------------------------------------------------------------- -// Internal functions -//--------------------------------------------------------------------------- - -void _gld_mesa_warning( - __GLcontext *gc, - char *str) -{ - // Intercept Mesa's internal warning mechanism - gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str); -} - -//--------------------------------------------------------------------------- - -void _gld_mesa_fatal( - __GLcontext *gc, - char *str) -{ - // Intercept Mesa's internal fatal-message mechanism - gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str); - - // Mesa calls abort(0) here. - ddlogClose(); - exit(0); -} - -//--------------------------------------------------------------------------- - -D3DSTENCILOP _gldConvertStencilOp( - GLenum StencilOp) -{ - // Used by Stencil: pass, fail and zfail - - switch (StencilOp) { - case GL_KEEP: - return D3DSTENCILOP_KEEP; - case GL_ZERO: - return D3DSTENCILOP_ZERO; - case GL_REPLACE: - return D3DSTENCILOP_REPLACE; - case GL_INCR: - return D3DSTENCILOP_INCRSAT; - case GL_DECR: - return D3DSTENCILOP_DECRSAT; - case GL_INVERT: - return D3DSTENCILOP_INVERT; - case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap - return D3DSTENCILOP_INCR; - case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap - return D3DSTENCILOP_DECR; - } - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n"); -#endif - - return D3DSTENCILOP_KEEP; -} - -//--------------------------------------------------------------------------- - -D3DCMPFUNC _gldConvertCompareFunc( - GLenum CmpFunc) -{ - // Used for Alpha func, depth func and stencil func. - - switch (CmpFunc) { - case GL_NEVER: - return D3DCMP_NEVER; - case GL_LESS: - return D3DCMP_LESS; - case GL_EQUAL: - return D3DCMP_EQUAL; - case GL_LEQUAL: - return D3DCMP_LESSEQUAL; - case GL_GREATER: - return D3DCMP_GREATER; - case GL_NOTEQUAL: - return D3DCMP_NOTEQUAL; - case GL_GEQUAL: - return D3DCMP_GREATEREQUAL; - case GL_ALWAYS: - return D3DCMP_ALWAYS; - }; - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n"); -#endif - - return D3DCMP_ALWAYS; -} - -//--------------------------------------------------------------------------- - -D3DBLEND _gldConvertBlendFunc( - GLenum blend, - GLenum DefaultBlend) -{ - switch (blend) { - case GL_ZERO: - return D3DBLEND_ZERO; - case GL_ONE: - return D3DBLEND_ONE; - case GL_DST_COLOR: - return D3DBLEND_DESTCOLOR; - case GL_SRC_COLOR: - return D3DBLEND_SRCCOLOR; - case GL_ONE_MINUS_DST_COLOR: - return D3DBLEND_INVDESTCOLOR; - case GL_ONE_MINUS_SRC_COLOR: - return D3DBLEND_INVSRCCOLOR; - case GL_SRC_ALPHA: - return D3DBLEND_SRCALPHA; - case GL_ONE_MINUS_SRC_ALPHA: - return D3DBLEND_INVSRCALPHA; - case GL_DST_ALPHA: - return D3DBLEND_DESTALPHA; - case GL_ONE_MINUS_DST_ALPHA: - return D3DBLEND_INVDESTALPHA; - case GL_SRC_ALPHA_SATURATE: - return D3DBLEND_SRCALPHASAT; - } - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n"); -#endif - - return DefaultBlend; -} - -//--------------------------------------------------------------------------- -// Misc. functions -//--------------------------------------------------------------------------- - -void gld_Noop_DX8( - GLcontext *ctx) -{ -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n"); -#endif -} - -//--------------------------------------------------------------------------- - -void gld_Error_DX8( - GLcontext *ctx) -{ -#ifdef _DEBUG - // Quite useless. -// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n"); -#endif -} - -//--------------------------------------------------------------------------- -// Required Mesa functions -//--------------------------------------------------------------------------- - -static GLboolean gld_set_draw_buffer_DX8( - GLcontext *ctx, - GLenum mode) -{ - (void) ctx; - if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - -//--------------------------------------------------------------------------- - -static void gld_set_read_buffer_DX8( - GLcontext *ctx, - GLframebuffer *buffer, - GLenum mode) -{ - /* separate read buffer not supported */ -/* - ASSERT(buffer == ctx->DrawBuffer); - ASSERT(mode == GL_FRONT_LEFT); -*/ -} - -//--------------------------------------------------------------------------- - -void gld_Clear_DX8( - GLcontext *ctx, - GLbitfield mask, - GLboolean all, - GLint x, - GLint y, - GLint width, - GLint height) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - DWORD dwFlags = 0; - D3DCOLOR Color = 0; - float Z = 0.0f; - DWORD Stencil = 0; - D3DRECT d3dClearRect; - - // TODO: Colourmask - const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; - - if (!gld->pDev) - return; - - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { - GLubyte col[4]; - CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]); - CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]); - dwFlags |= D3DCLEAR_TARGET; - Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]); -// ctx->Color.ClearColor[1], -// ctx->Color.ClearColor[2], -// ctx->Color.ClearColor[3]); - } - - if (mask & DD_DEPTH_BIT) { - // D3D8 will fail the Clear call if we try and clear a - // depth buffer and we haven't created one. - // Also, some apps try and clear a depth buffer, - // when a depth buffer hasn't been requested by the app. - if (ctx->Visual.depthBits == 0) { - mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask - } else { - dwFlags |= D3DCLEAR_ZBUFFER; - Z = ctx->Depth.Clear; - } - } - - if (mask & DD_STENCIL_BIT) { - if (ctx->Visual.stencilBits == 0) { - // No stencil bits in depth buffer - mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask - } else { - dwFlags |= D3DCLEAR_STENCIL; - Stencil = ctx->Stencil.Clear; - } - } - - // Some apps do really weird things with the rect, such as Quake3. - if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) { - all = GL_TRUE; - } - - if (!all) { - // Calculate clear subrect - d3dClearRect.x1 = x; - d3dClearRect.y1 = gldCtx->dwHeight - (y + height); - d3dClearRect.x2 = x + width; - d3dClearRect.y2 = d3dClearRect.y1 + height; - } - - // dwFlags will be zero if there's nothing to clear - if (dwFlags) { - _GLD_DX8_DEV(Clear( - gld->pDev, - all ? 0 : 1, - all ? NULL : &d3dClearRect, - dwFlags, - Color, Z, Stencil)); - } - - if (mask & DD_ACCUM_BIT) { - // Clear accumulation buffer - } -} - -//--------------------------------------------------------------------------- - -// Mesa 5: Parameter change -static void gld_buffer_size_DX8( -// GLcontext *ctx, - GLframebuffer *fb, - GLuint *width, - GLuint *height) -{ -// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - - *width = fb->Width; // gldCtx->dwWidth; - *height = fb->Height; // gldCtx->dwHeight; -} - -//--------------------------------------------------------------------------- - -static void gld_Finish_DX8( - GLcontext *ctx) -{ -} - -//--------------------------------------------------------------------------- - -static void gld_Flush_DX8( - GLcontext *ctx) -{ - GLD_context *gld = GLD_GET_CONTEXT(ctx); - - // TODO: Detect apps that glFlush() then SwapBuffers() ? - - if (gld->EmulateSingle) { - // Emulating a single-buffered context. - // [Direct3D doesn't allow rendering to front buffer] - dglSwapBuffers(gld->hDC); - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_STENCIL( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - // Two-sided stencil. New for Mesa 5 - const GLuint uiFace = 0UL; - - struct gl_stencil_attrib *pStencil = &ctx->Stencil; - - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE)); - if (pStencil->Enabled) { - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace]))); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILREF, pStencil->Ref[uiFace])); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILMASK, pStencil->ValueMask[uiFace])); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILWRITEMASK, pStencil->WriteMask[uiFace])); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace]))); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace]))); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace]))); - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_COLOR( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - DWORD dwFlags = 0; - D3DBLEND src; - D3DBLEND dest; - - // Alpha func - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc))); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAREF, (DWORD)ctx->Color.AlphaRef)); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, ctx->Color.AlphaEnabled)); - - // Blend func - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ALPHABLENDENABLE, ctx->Color.BlendEnabled)); - src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE); - dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SRCBLEND, src)); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_DESTBLEND, dest)); - - // Color mask - if (ctx->Color.ColorMask[0]) dwFlags |= D3DCOLORWRITEENABLE_RED; - if (ctx->Color.ColorMask[1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN; - if (ctx->Color.ColorMask[2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE; - if (ctx->Color.ColorMask[3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA; - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_COLORWRITEENABLE, dwFlags)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_DEPTH( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE)); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func))); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_POLYGON( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DFILLMODE d3dFillMode = D3DFILL_SOLID; - D3DCULL d3dCullMode = D3DCULL_NONE; - int iOffset = 0; - - // Fillmode - switch (ctx->Polygon.FrontMode) { - case GL_POINT: - d3dFillMode = D3DFILL_POINT; - break; - case GL_LINE: - d3dFillMode = D3DFILL_WIREFRAME; - break; - case GL_FILL: - d3dFillMode = D3DFILL_SOLID; - break; - } - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FILLMODE, d3dFillMode)); - - if (ctx->Polygon.CullFlag) { - switch (ctx->Polygon.CullFaceMode) { - case GL_BACK: - if (ctx->Polygon.FrontFace == GL_CCW) - d3dCullMode = D3DCULL_CW; - else - d3dCullMode = D3DCULL_CCW; - break; - case GL_FRONT: - if (ctx->Polygon.FrontFace == GL_CCW) - d3dCullMode = D3DCULL_CCW; - else - d3dCullMode = D3DCULL_CW; - break; - case GL_FRONT_AND_BACK: - d3dCullMode = D3DCULL_NONE; - break; - default: - break; - } - } else { - d3dCullMode = D3DCULL_NONE; - } -// d3dCullMode = D3DCULL_NONE; // TODO: DEBUGGING - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_CULLMODE, d3dCullMode)); - - // Polygon offset - // ZBIAS ranges from 0 to 16 and can only move towards the viewer - // Mesa5: ctx->Polygon._OffsetAny removed - if (ctx->Polygon.OffsetFill) { - iOffset = (int)ctx->Polygon.OffsetUnits; - if (iOffset < 0) - iOffset = -iOffset; - else - iOffset = 0; // D3D can't push away - } - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_ZBIAS, iOffset)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_FOG( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DCOLOR d3dFogColour; - D3DFOGMODE d3dFogMode = D3DFOG_LINEAR; - - // TODO: Fog is calculated seperately in the Mesa pipeline - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, FALSE)); - return; - - // Fog enable - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, ctx->Fog.Enabled)); - if (!ctx->Fog.Enabled) { - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, D3DFOG_NONE)); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE)); - return; // If disabled, don't bother setting any fog state - } - - // Fog colour - d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0], - ctx->Fog.Color[1], - ctx->Fog.Color[2], - ctx->Fog.Color[3]); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGCOLOR, d3dFogColour)); - - // Fog density - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density)))); - - // Fog start - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGSTART, *((DWORD*) (&ctx->Fog.Start)))); - - // Fog end - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGEND, *((DWORD*) (&ctx->Fog.End)))); - - // Fog mode - switch (ctx->Fog.Mode) { - case GL_LINEAR: - d3dFogMode = D3DFOG_LINEAR; - break; - case GL_EXP: - d3dFogMode = D3DFOG_EXP; - break; - case GL_EXP2: - d3dFogMode = D3DFOG_EXP2; - break; - } - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, d3dFogMode)); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_LIGHT( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - DWORD dwSpecularEnable; - - // Shademode - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT)); - - // Separate specular colour - if (ctx->Light.Enabled) - dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE; - else - dwSpecularEnable = FALSE; - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SPECULARENABLE, dwSpecularEnable)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_MODELVIEW( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DMATRIX m; - //GLfloat *pM = ctx->ModelView.m; - // Mesa5: Model-view is now a stack - GLfloat *pM = ctx->ModelviewMatrixStack.Top->m; - m._11 = pM[0]; - m._12 = pM[1]; - m._13 = pM[2]; - m._14 = pM[3]; - m._21 = pM[4]; - m._22 = pM[5]; - m._23 = pM[6]; - m._24 = pM[7]; - m._31 = pM[8]; - m._32 = pM[9]; - m._33 = pM[10]; - m._34 = pM[11]; - m._41 = pM[12]; - m._42 = pM[13]; - m._43 = pM[14]; - m._44 = pM[15]; - - gld->matModelView = m; -} - -//--------------------------------------------------------------------------- - -void gld_NEW_PROJECTION( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DMATRIX m; - //GLfloat *pM = ctx->ProjectionMatrix.m; - // Mesa 5: Now a stack - GLfloat *pM = ctx->ProjectionMatrixStack.Top->m; - m._11 = pM[0]; - m._12 = pM[1]; - m._13 = pM[2]; - m._14 = pM[3]; - - m._21 = pM[4]; - m._22 = pM[5]; - m._23 = pM[6]; - m._24 = pM[7]; - - m._31 = pM[8]; - m._32 = pM[9]; - m._33 = pM[10] / _fPersp_33; // / 1.6f; - m._34 = pM[11]; - - m._41 = pM[12]; - m._42 = pM[13]; - m._43 = pM[14] / 2.0f; - m._44 = pM[15]; - - gld->matProjection = m; -} - -//--------------------------------------------------------------------------- -/* -void gldFrustumHook_DX8( - GLdouble left, - GLdouble right, - GLdouble bottom, - GLdouble top, - GLdouble nearval, - GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - // Pass values on to Mesa first (in case we mess with them) - _mesa_Frustum(left, right, bottom, top, nearval, farval); - - _fPersp_33 = farval / (nearval - farval); - -// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval); -} - -//--------------------------------------------------------------------------- - -void gldOrthoHook_DX8( - GLdouble left, - GLdouble right, - GLdouble bottom, - GLdouble top, - GLdouble nearval, - GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - // Pass values on to Mesa first (in case we mess with them) - _mesa_Ortho(left, right, bottom, top, nearval, farval); - - _fPersp_33 = 1.6f; - -// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval); -} -*/ -//--------------------------------------------------------------------------- - -void gld_NEW_VIEWPORT( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DVIEWPORT8 d3dvp; -// GLint x, y; -// GLsizei w, h; - - // Set depth range - _GLD_DX8_DEV(GetViewport(gld->pDev, &d3dvp)); - // D3D can't do Quake1/Quake2 z-trick - if (ctx->Viewport.Near <= ctx->Viewport.Far) { - d3dvp.MinZ = ctx->Viewport.Near; - d3dvp.MaxZ = ctx->Viewport.Far; - } else { - d3dvp.MinZ = ctx->Viewport.Far; - d3dvp.MaxZ = ctx->Viewport.Near; - } -/* x = ctx->Viewport.X; - y = ctx->Viewport.Y; - w = ctx->Viewport.Width; - h = ctx->Viewport.Height; - if (x < 0) x = 0; - if (y < 0) y = 0; - if (w > gldCtx->dwWidth) w = gldCtx->dwWidth; - if (h > gldCtx->dwHeight) h = gldCtx->dwHeight; - // Ditto for D3D viewport dimensions - if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x; - if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y; - d3dvp.X = x; - d3dvp.Y = gldCtx->dwHeight - (y + h); - d3dvp.Width = w; - d3dvp.Height = h;*/ - _GLD_DX8_DEV(SetViewport(gld->pDev, &d3dvp)); - -// gld->fFlipWindowY = (float)gldCtx->dwHeight; -} - -//--------------------------------------------------------------------------- - -__inline BOOL _gldAnyEvalEnabled( - GLcontext *ctx) -{ - struct gl_eval_attrib *eval = &ctx->Eval; - - if ((eval->AutoNormal) || - (eval->Map1Color4) || - (eval->Map1Index) || - (eval->Map1Normal) || - (eval->Map1TextureCoord1) || - (eval->Map1TextureCoord2) || - (eval->Map1TextureCoord3) || - (eval->Map1TextureCoord4) || - (eval->Map1Vertex3) || - (eval->Map1Vertex4) || - (eval->Map2Color4) || - (eval->Map2Index) || - (eval->Map2Normal) || - (eval->Map2TextureCoord1) || - (eval->Map2TextureCoord2) || - (eval->Map2TextureCoord3) || - (eval->Map2TextureCoord4) || - (eval->Map2Vertex3) || - (eval->Map2Vertex4) - ) - return TRUE; - - return FALSE; -} - -//--------------------------------------------------------------------------- - -BOOL _gldChooseInternalPipeline( - GLcontext *ctx, - GLD_driver_dx8 *gld) -{ -// return TRUE; // DEBUGGING: ALWAYS USE MESA -// return FALSE; // DEBUGGING: ALWAYS USE D3D - - if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE)) - { - gld->PipelineUsage.qwMesa.QuadPart++; - return TRUE; // Force Mesa TnL - } - - if ((ctx->Light.Enabled) || - (1) || - (ctx->Texture._TexGenEnabled) || - (ctx->Texture._TexMatEnabled) || -// (ctx->Transform._AnyClip) || - (ctx->Scissor.Enabled) || - _gldAnyEvalEnabled(ctx) // Put this last so we can early-out - ) - { - gld->PipelineUsage.qwMesa.QuadPart++; - return TRUE; - } - - gld->PipelineUsage.qwD3DFVF.QuadPart++; - return FALSE; - -/* // Force Mesa pipeline? - if (glb.dwTnL == GLDS_TNL_MESA) { - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - - // Test for functionality not exposed in the D3D pathways - if ((ctx->Texture._GenFlags)) { - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - - // Now decide if vertex shader can be used. - // If two sided lighting is enabled then we must either - // use Mesa TnL or the vertex shader - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { - if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) { - // Use Vertex Shader - gld->PipelineUsage.dwD3D2SVS.QuadPart++; - return GLD_PIPELINE_D3D_VS_TWOSIDE; - } else { - // Use Mesa TnL - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - } - - // Must be D3D fixed-function pipeline - gld->PipelineUsage.dwD3DFVF.QuadPart++; - return GLD_PIPELINE_D3D_FVF; -*/ -} - -//--------------------------------------------------------------------------- - -void gld_update_state_DX8( - GLcontext *ctx, - GLuint new_state) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLD_pb_dx8 *gldPB; - - if (!gld || !gld->pDev) - return; - - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - - // SetupIndex will be used in the pipelines for choosing setup function - if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) || - (ctx->Fog.Enabled)) - { - if (ctx->_TriangleCaps & DD_FLATSHADE) - gld->iSetupFunc = GLD_SI_FLAT_EXTRAS; - else - gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS; - } else { - if (ctx->_TriangleCaps & DD_FLATSHADE) - gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture - else - gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture - } - - gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld); - if (gld->bUseMesaTnL) { - gldPB = &gld->PB2d; - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE)); - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, FALSE)); - _GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); - } else { - gldPB = &gld->PB3d; - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE)); -// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) { -// _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware)); -// _GLD_DX8_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader)); -// } else { - _GLD_DX8_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL)); - _GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); -// } - } - -#define _GLD_TEST_STATE(a) \ - if (new_state & (a)) { \ - gld##a(ctx); \ - new_state &= ~(a); \ - } - -#define _GLD_TEST_STATE_DX8(a) \ - if (new_state & (a)) { \ - gld##a##_DX8(ctx); \ - new_state &= ~(a); \ - } - -#define _GLD_IGNORE_STATE(a) new_state &= ~(a); - -// if (!gld->bUseMesaTnL) { - // Not required if Mesa is doing the TnL. - // Problem: If gld->bUseMesaTnL is TRUE when these are signaled, - // then we'll miss updating the D3D TnL pipeline. - // Therefore, don't test for gld->bUseMesaTnL - _GLD_TEST_STATE(_NEW_MODELVIEW); - _GLD_TEST_STATE(_NEW_PROJECTION); -// } - - _GLD_TEST_STATE_DX8(_NEW_TEXTURE); // extern, so guard with _DX8 - _GLD_TEST_STATE(_NEW_COLOR); - _GLD_TEST_STATE(_NEW_DEPTH); - _GLD_TEST_STATE(_NEW_POLYGON); - _GLD_TEST_STATE(_NEW_STENCIL); - _GLD_TEST_STATE(_NEW_FOG); - _GLD_TEST_STATE(_NEW_LIGHT); - _GLD_TEST_STATE(_NEW_VIEWPORT); - - _GLD_IGNORE_STATE(_NEW_TRANSFORM); - - -// Stubs for future use. -/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX); - _GLD_TEST_STATE(_NEW_COLOR_MATRIX); - _GLD_TEST_STATE(_NEW_ACCUM); - _GLD_TEST_STATE(_NEW_EVAL); - _GLD_TEST_STATE(_NEW_HINT); - _GLD_TEST_STATE(_NEW_LINE); - _GLD_TEST_STATE(_NEW_PIXEL); - _GLD_TEST_STATE(_NEW_POINT); - _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE); - _GLD_TEST_STATE(_NEW_SCISSOR); - _GLD_TEST_STATE(_NEW_PACKUNPACK); - _GLD_TEST_STATE(_NEW_ARRAY); - _GLD_TEST_STATE(_NEW_RENDERMODE); - _GLD_TEST_STATE(_NEW_BUFFERS); - _GLD_TEST_STATE(_NEW_MULTISAMPLE); -*/ - -// For debugging. -#if 0 -#define _GLD_TEST_UNHANDLED_STATE(a) \ - if (new_state & (a)) { \ - gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \ - } - _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX); - _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX); - _GLD_TEST_UNHANDLED_STATE(_NEW_ACCUM); - _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL); - _GLD_TEST_UNHANDLED_STATE(_NEW_HINT); - _GLD_TEST_UNHANDLED_STATE(_NEW_LINE); - _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL); - _GLD_TEST_UNHANDLED_STATE(_NEW_POINT); - _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE); - _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR); - _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK); - _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY); - _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE); - _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS); - _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE); -#undef _GLD_UNHANDLED_STATE -#endif - -#undef _GLD_TEST_STATE -} - -//--------------------------------------------------------------------------- -// Viewport -//--------------------------------------------------------------------------- - -void gld_Viewport_DX8( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei w, - GLsizei h) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DVIEWPORT8 d3dvp; - - if (!gld || !gld->pDev) - return; - - // This is a hack. When the app is minimized, Mesa passes - // w=1 and h=1 for viewport dimensions. Without this test - // we get a GPF in gld_wgl_resize_buffers(). - if ((w==1) && (h==1)) - return; - - // Call ResizeBuffersMESA. This function will early-out - // if no resize is needed. - //ctx->Driver.ResizeBuffersMESA(ctx); - // Mesa 5: Changed parameters - ctx->Driver.ResizeBuffers(gldCtx->glBuffer); - -#if 0 - ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h); -#endif - - // ** D3D viewport must not be outside the render target surface ** - // Sanity check the GL viewport dimensions - if (x < 0) x = 0; - if (y < 0) y = 0; - if (w > gldCtx->dwWidth) w = gldCtx->dwWidth; - if (h > gldCtx->dwHeight) h = gldCtx->dwHeight; - // Ditto for D3D viewport dimensions - if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x; - if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y; - - d3dvp.X = x; - d3dvp.Y = gldCtx->dwHeight - (y + h); - d3dvp.Width = w; - d3dvp.Height = h; - if (ctx->Viewport.Near <= ctx->Viewport.Far) { - d3dvp.MinZ = ctx->Viewport.Near; - d3dvp.MaxZ = ctx->Viewport.Far; - } else { - d3dvp.MinZ = ctx->Viewport.Far; - d3dvp.MaxZ = ctx->Viewport.Near; - } - - // TODO: DEBUGGING -// d3dvp.MinZ = 0.0f; -// d3dvp.MaxZ = 1.0f; - - _GLD_DX8_DEV(SetViewport(gld->pDev, &d3dvp)); - -} - -//--------------------------------------------------------------------------- - -extern BOOL dglWglResizeBuffers(GLcontext *ctx, BOOL bDefaultDriver); - -// Mesa 5: Parameter change -void gldResizeBuffers_DX8( -// GLcontext *ctx) - GLframebuffer *fb) -{ - GET_CURRENT_CONTEXT(ctx); - dglWglResizeBuffers(ctx, TRUE); -} - -//--------------------------------------------------------------------------- -#ifdef _DEBUG -// This is only for debugging. -// To use, plug into ctx->Driver.Enable pointer below. -void gld_Enable( - GLcontext *ctx, - GLenum e, - GLboolean b) -{ - char buf[1024]; - sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE"); - ddlogMessage(DDLOG_SYSTEM, buf); -} -#endif -//--------------------------------------------------------------------------- -// Driver pointer setup -//--------------------------------------------------------------------------- - -extern const GLubyte* _gldGetStringGeneric(GLcontext*, GLenum); - -void gldSetupDriverPointers_DX8( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - TNLcontext *tnl = TNL_CONTEXT(ctx); - - // Mandatory functions - ctx->Driver.GetString = _gldGetStringGeneric; - ctx->Driver.UpdateState = gld_update_state_DX8; - ctx->Driver.Clear = gld_Clear_DX8; - ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX8; - ctx->Driver.GetBufferSize = gld_buffer_size_DX8; - ctx->Driver.Finish = gld_Finish_DX8; - ctx->Driver.Flush = gld_Flush_DX8; - ctx->Driver.Error = gld_Error_DX8; - - // Hardware accumulation buffer - ctx->Driver.Accum = NULL; // TODO: gld_Accum; - - // Bitmap functions - ctx->Driver.CopyPixels = gld_CopyPixels_DX8; - ctx->Driver.DrawPixels = gld_DrawPixels_DX8; - ctx->Driver.ReadPixels = gld_ReadPixels_DX8; - ctx->Driver.Bitmap = gld_Bitmap_DX8; - - // Buffer resize - ctx->Driver.ResizeBuffers = gldResizeBuffers_DX8; - - // Texture image functions - ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX8; - ctx->Driver.TexImage1D = gld_TexImage1D_DX8; - ctx->Driver.TexImage2D = gld_TexImage2D_DX8; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX8; - ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX8; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - - ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX8; //NULL; - ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX8; //NULL; - ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX8; //NULL; - ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX8; //NULL; - ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX8; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - // Texture object functions - ctx->Driver.BindTexture = NULL; - ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!; - ctx->Driver.DeleteTexture = gld_DeleteTexture_DX8; - ctx->Driver.PrioritizeTexture = NULL; - - // Imaging functionality - ctx->Driver.CopyColorTable = NULL; - ctx->Driver.CopyColorSubTable = NULL; - ctx->Driver.CopyConvolutionFilter1D = NULL; - ctx->Driver.CopyConvolutionFilter2D = NULL; - - // State changing functions - ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc; - ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc; - ctx->Driver.ClearColor = NULL; //gld_ClearColor; - ctx->Driver.ClearDepth = NULL; //gld_ClearDepth; - ctx->Driver.ClearStencil = NULL; //gld_ClearStencil; - ctx->Driver.ColorMask = NULL; //gld_ColorMask; - ctx->Driver.CullFace = NULL; //gld_CullFace; - ctx->Driver.ClipPlane = NULL; //gld_ClipPlane; - ctx->Driver.FrontFace = NULL; //gld_FrontFace; - ctx->Driver.DepthFunc = NULL; //gld_DepthFunc; - ctx->Driver.DepthMask = NULL; //gld_DepthMask; - ctx->Driver.DepthRange = NULL; - ctx->Driver.Enable = NULL; //gld_Enable; - ctx->Driver.Fogfv = NULL; //gld_Fogfv; - ctx->Driver.Hint = NULL; //gld_Hint; - ctx->Driver.Lightfv = NULL; //gld_Lightfv; - ctx->Driver.LightModelfv = NULL; //gld_LightModelfv; - ctx->Driver.LineStipple = NULL; //gld_LineStipple; - ctx->Driver.LineWidth = NULL; //gld_LineWidth; - ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode; - ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv; - ctx->Driver.PointSize = NULL; //gld_PointSize; - ctx->Driver.PolygonMode = NULL; //gld_PolygonMode; - ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset; - ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple; - ctx->Driver.RenderMode = NULL; //gld_RenderMode; - ctx->Driver.Scissor = NULL; //gld_Scissor; - ctx->Driver.ShadeModel = NULL; //gld_ShadeModel; - ctx->Driver.StencilFunc = NULL; //gld_StencilFunc; - ctx->Driver.StencilMask = NULL; //gld_StencilMask; - ctx->Driver.StencilOp = NULL; //gld_StencilOp; - ctx->Driver.TexGen = NULL; //gld_TexGen; - ctx->Driver.TexEnv = NULL; - ctx->Driver.TexParameter = NULL; - ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix; - ctx->Driver.Viewport = gld_Viewport_DX8; - - _swsetup_Wakeup(ctx); - - tnl->Driver.RunPipeline = _tnl_run_pipeline; - tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX8; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; - - // Hook into glFrustum() and glOrtho() -// ctx->Exec->Frustum = gldFrustumHook_DX8; -// ctx->Exec->Ortho = gldOrthoHook_DX8; - -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h deleted file mode 100644 index 7efec7cae..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dx8.h +++ /dev/null @@ -1,324 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect Direct3D 8.0 header file -* -****************************************************************************/ - -#ifndef _GLD_DX8_H -#define _GLD_DX8_H - -//--------------------------------------------------------------------------- -// Windows includes -//--------------------------------------------------------------------------- - -//#ifndef STRICT -//#define STRICT -//#endif - -//#define WIN32_LEAN_AND_MEAN -//#include -#include -#include - -// MS screwed up with the DX8.1 SDK - there's no compile-time -// method of compiling for 8.0 via the 8.1 SDK unless you -// "make sure you don't use any 8.1 interfaces". -// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces. -// -// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95). -// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95). -// -#define D3D_SDK_VERSION_DX8_SUPPORT_WIN95 120 - -// Typedef for obtaining function from d3d8.dll -typedef IDirect3D8* (WINAPI *FNDIRECT3DCREATE8) (UINT); - - -//--------------------------------------------------------------------------- -// Defines -//--------------------------------------------------------------------------- - -#ifdef _DEBUG -#define _GLD_TEST_HRESULT(h) \ -{ \ - HRESULT _hr = (h); \ - if (FAILED(_hr)) { \ - gldLogError(GLDLOG_ERROR, #h, _hr); \ - } \ -} -#define _GLD_DX8(func) _GLD_TEST_HRESULT(IDirect3D8_##func##) -#define _GLD_DX8_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice8_##func##) -#define _GLD_DX8_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer8_##func##) -#define _GLD_DX8_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture8_##func##) -#else -#define _GLD_DX8(func) IDirect3D8_##func -#define _GLD_DX8_DEV(func) IDirect3DDevice8_##func -#define _GLD_DX8_VB(func) IDirect3DVertexBuffer8_##func -#define _GLD_DX8_TEX(func) IDirect3DTexture8_##func -#endif - -#define SAFE_RELEASE(p) \ -{ \ - if (p) { \ - (p)->lpVtbl->Release(p); \ - (p) = NULL; \ - } \ -} - -#define SAFE_RELEASE_VB8(p) \ -{ \ - if (p) { \ - IDirect3DVertexBuffer8_Release((p)); \ - (p) = NULL; \ - } \ -} - -#define SAFE_RELEASE_SURFACE8(p) \ -{ \ - if (p) { \ - IDirect3DSurface8_Release((p)); \ - (p) = NULL; \ - } \ -} - -// Setup index. -enum { - GLD_SI_FLAT = 0, - GLD_SI_SMOOTH = 1, - GLD_SI_FLAT_EXTRAS = 2, - GLD_SI_SMOOTH_EXTRAS = 3, -}; -/* -// Internal pipeline -typedef enum { - GLD_PIPELINE_MESA = 0, // Mesa pipeline - GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline - GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader -} GLD_tnl_pipeline; -*/ -//--------------------------------------------------------------------------- -// Vertex definitions for Fixed-Function pipeline -//--------------------------------------------------------------------------- - -// -// NOTE: If the number of texture units is altered then most of -// the texture code will need to be revised. -// - -#define GLD_MAX_TEXTURE_UNITS_DX8 2 - -// -// 2D vertex transformed by Mesa -// -#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \ - D3DFVF_DIFFUSE | \ - D3DFVF_SPECULAR | \ - D3DFVF_TEX2) -typedef struct { - FLOAT x, y; // 2D raster coords - FLOAT sz; // Screen Z (depth) - FLOAT rhw; // Reciprocal homogenous W - DWORD diffuse; // Diffuse colour - DWORD specular; // For separate-specular support - FLOAT t0_u, t0_v; // 1st set of texture coords - FLOAT t1_u, t1_v; // 2nd set of texture coords -} GLD_2D_VERTEX; - - -// -// 3D vertex transformed by Direct3D -// -#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \ - D3DFVF_DIFFUSE | \ - D3DFVF_TEX2) - -typedef struct { - D3DXVECTOR3 Position; // XYZ Vector in object space - D3DCOLOR Diffuse; // Diffuse colour - D3DXVECTOR2 TexUnit0; // Texture unit 0 - D3DXVECTOR2 TexUnit1; // Texture unit 1 -} GLD_3D_VERTEX; - -//--------------------------------------------------------------------------- -// Vertex Shaders -//--------------------------------------------------------------------------- -/* -// DX8 Vertex Shader -typedef struct { - DWORD hShader; // If NULL, shader is invalid and cannot be used - BOOL bHardware; // If TRUE then shader was created for hardware, - // otherwise shader was created for software. -} GLD_vertexShader; -*/ -//--------------------------------------------------------------------------- -// Structs -//--------------------------------------------------------------------------- - -// This keeps a count of how many times we choose each individual internal -// pathway. Useful for seeing if a certain pathway was ever used by an app, and -// how much each pathway is biased. -// Zero the members at context creation and dump stats at context deletion. -typedef struct { - // Note: DWORD is probably too small - ULARGE_INTEGER qwMesa; // Mesa TnL pipeline - ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline -// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline -} GLD_pipeline_usage; - -// GLDirect Primitive Buffer (points, lines, triangles and quads) -typedef struct { - // Data for IDirect3DDevice8::CreateVertexBuffer() - DWORD dwStride; // Stride of vertex - DWORD dwUsage; // Usage flags - DWORD dwFVF; // Direct3D Flexible Vertex Format - DWORD dwPool; // Pool flags - - IDirect3DVertexBuffer8 *pVB; // Holds points, lines, tris and quads. - - // Point list is assumed to be at start of buffer - DWORD iFirstLine; // Index of start of line list - DWORD iFirstTriangle; // Index of start of triangle list - - BYTE *pPoints; // Pointer to next free point - BYTE *pLines; // Pointer to next free line - BYTE *pTriangles; // Pointer to next free triangle - - DWORD nPoints; // Number of points ready to render - DWORD nLines; // Number of lines ready to render - DWORD nTriangles; // Number of triangles ready to render -} GLD_pb_dx8; - -// GLDirect DX8 driver data -typedef struct { - // GLDirect vars - BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered) - BOOL bDepthStencil; // Depth buffer needed (stencil optional) - D3DFORMAT RenderFormat; // Format of back/front buffer - D3DFORMAT DepthFormat; // Format of depth/stencil -// float fFlipWindowY; // Value for flipping viewport Y coord - - // Direct3D vars - D3DCAPS8 d3dCaps8; - BOOL bHasHWTnL; // Device has Hardware Transform/Light? - IDirect3D8 *pD3D; // Base Direct3D8 interface - IDirect3DDevice8 *pDev; // Direct3D8 Device interface - GLD_pb_dx8 PB2d; // Vertices transformed by Mesa - GLD_pb_dx8 PB3d; // Vertices transformed by Direct3D - D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type - D3DXMATRIX matProjection; // Projection matrix for D3D TnL - D3DXMATRIX matModelView; // Model/View matrix for D3D TnL - int iSetupFunc; // Which setup functions to use - BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL - - // Direct3D vars for two-sided lighting -// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting -// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders - - -// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline - GLD_pipeline_usage PipelineUsage; -} GLD_driver_dx8; - -#define GLD_GET_DX8_DRIVER(c) (GLD_driver_dx8*)(c)->glPriv - -//--------------------------------------------------------------------------- -// Function prototypes -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_DX8(LPCSTR a); -void gldEnableExtensions_DX8(GLcontext *ctx); -void gldInstallPipeline_DX8(GLcontext *ctx); -void gldSetupDriverPointers_DX8(GLcontext *ctx); -//void gldResizeBuffers_DX8(GLcontext *ctx); -void gldResizeBuffers_DX8(GLframebuffer *fb); - - -// Texture functions - -void gldCopyTexImage1D_DX8(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -void gldCopyTexImage2D_DX8(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -void gldCopyTexSubImage1D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ); -void gldCopyTexSubImage2D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); -void gldCopyTexSubImage3D_DX8(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); - -void gld_NEW_TEXTURE_DX8(GLcontext *ctx); -void gld_DrawPixels_DX8(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels); -void gld_ReadPixels_DX8(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest); -void gld_CopyPixels_DX8(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type); -void gld_Bitmap_DX8(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap); -const struct gl_texture_format* gld_ChooseTextureFormat_DX8(GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType); -void gld_TexImage2D_DX8(GLcontext *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 *tObj, struct gl_texture_image *texImage); -void gld_TexImage1D_DX8(GLcontext *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 ); -void gld_TexSubImage2D_DX8( GLcontext *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 ); -void gld_TexSubImage1D_DX8(GLcontext *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); -void gld_DeleteTexture_DX8(GLcontext *ctx, struct gl_texture_object *tObj); -void gld_ResetLineStipple_DX8(GLcontext *ctx); - -// 2D primitive functions - -void gld_Points2D_DX8(GLcontext *ctx, GLuint first, GLuint last); - -void gld_Line2DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Line2DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1); - -void gld_Triangle2DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DFlatExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmoothExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); - -void gld_Quad2DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DFlatExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmoothExtras_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -// 3D primitive functions - -void gld_Points3D_DX8(GLcontext *ctx, GLuint first, GLuint last); -void gld_Line3DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle3DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad3DFlat_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Line3DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle3DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad3DSmooth_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -// Primitive functions for Two-sided-lighting Vertex Shader - -void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last); -void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -#endif diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h deleted file mode 100644 index f8e92b936..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_dxerr8.h +++ /dev/null @@ -1,77 +0,0 @@ -/*==========================================================================; - * - * - * File: dxerr8.h - * Content: DirectX Error Library Include File - * - ****************************************************************************/ - -#ifndef _GLD_DXERR8_H_ -#define _GLD_DXERR8_H_ - - -#include - -// -// DXGetErrorString8 -// -// Desc: Converts an DirectX HRESULT to a string -// -// Args: HRESULT hr Can be any error code from -// DPLAY D3D8 D3DX8 DMUSIC DSOUND -// -// Return: Converted string -// -const char* __stdcall DXGetErrorString8A(HRESULT hr); -const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr); - -#ifdef UNICODE - #define DXGetErrorString8 DXGetErrorString8W -#else - #define DXGetErrorString8 DXGetErrorString8A -#endif - - -// -// DXTrace -// -// Desc: Outputs a formatted error message to the debug stream -// -// Args: CHAR* strFile The current file, typically passed in using the -// __FILE__ macro. -// DWORD dwLine The current line number, typically passed in using the -// __LINE__ macro. -// HRESULT hr An HRESULT that will be traced to the debug stream. -// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) -// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. -// -// Return: The hr that was passed in. -// -//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE ); -//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE ); -HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox); -HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox); - -#ifdef UNICODE - #define DXTrace DXTraceW -#else - #define DXTrace DXTraceA -#endif - - -// -// Helper macros -// -#if defined(DEBUG) | defined(_DEBUG) - #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) - #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) - #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) -#else - #define DXTRACE_MSG(str) (0L) - #define DXTRACE_ERR(str,hr) (hr) - #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr) -#endif - - -#endif - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c deleted file mode 100644 index b51bba9b3..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c +++ /dev/null @@ -1,344 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GL extensions -* -****************************************************************************/ - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "../gld_settings.h" - -#include -#define GL_GLEXT_PROTOTYPES -#include -#include - -//#include "ddlog.h" -//#include "gld_dx8.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -#include "dglcontext.h" -#include "extensions.h" - -// For some reason this is not defined in an above header... -extern void _mesa_enable_imaging_extensions(GLcontext *ctx); - -//--------------------------------------------------------------------------- -// Hack for the SGIS_multitexture extension that was removed from Mesa -// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel - - // NOTE: Quake2 ran *slower* with this enabled, so I've - // disabled it for now. - // To enable, uncomment: - // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0); - -//--------------------------------------------------------------------------- - -enum { - /* Quake2 GL_SGIS_multitexture */ - GL_SELECTED_TEXTURE_SGIS = 0x835B, - GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C, - GL_MAX_TEXTURES_SGIS = 0x835D, - GL_TEXTURE0_SGIS = 0x835E, - GL_TEXTURE1_SGIS = 0x835F, - GL_TEXTURE2_SGIS = 0x8360, - GL_TEXTURE3_SGIS = 0x8361, - GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363, -}; - -//--------------------------------------------------------------------------- - -void APIENTRY gldSelectTextureSGIS( - GLenum target) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glActiveTextureARB(ARB_target); -} - -//--------------------------------------------------------------------------- - -void APIENTRY gldMTexCoord2fSGIS( - GLenum target, - GLfloat s, - GLfloat t) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glMultiTexCoord2fARB(ARB_target, s, t); -} - -//--------------------------------------------------------------------------- - -void APIENTRY gldMTexCoord2fvSGIS( - GLenum target, - const GLfloat *v) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glMultiTexCoord2fvARB(ARB_target, v); -} - -//--------------------------------------------------------------------------- -// Extensions -//--------------------------------------------------------------------------- - -typedef struct { - PROC proc; - char *name; -} GLD_extension; - -GLD_extension GLD_extList[] = { -#ifdef GL_EXT_polygon_offset - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, -#endif - { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, - { (PROC)glBlendColorEXT, "glBlendColorExt" }, - { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, - { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, - { (PROC)glColorPointerEXT, "glColorPointerEXT" }, - { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, - { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, - { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, - { (PROC)glGetPointervEXT, "glGetPointervEXT" }, - { (PROC)glArrayElementEXT, "glArrayElementEXT" }, - { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, - { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, - { (PROC)glBindTextureEXT, "glBindTextureEXT" }, - { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, - { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, - { (PROC)glIsTextureEXT, "glIsTextureEXT" }, - { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, - { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, - { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, - { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, - { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, - { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, - - { (PROC)glLockArraysEXT, "glLockArraysEXT" }, - { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" }, - { NULL, "\0" } -}; - -GLD_extension GLD_multitexList[] = { -/* - { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" }, - { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" }, - { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" }, - { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" }, - { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" }, - { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" }, - { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" }, - { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" }, - { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" }, - { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" }, - { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" }, - { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" }, - { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" }, - { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" }, - { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" }, - { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" }, - { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" }, - { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" }, - { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" }, - { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" }, - { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" }, - { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" }, - { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" }, - { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" }, - { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" }, - { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" }, - { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" }, - { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" }, - { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" }, - { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" }, - { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" }, - { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" }, - { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" }, - { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" }, - { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" }, -*/ - { (PROC)glActiveTextureARB, "glActiveTextureARB" }, - { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" }, - { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" }, - { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" }, - { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" }, - { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" }, - { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" }, - { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" }, - { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" }, - { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" }, - { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" }, - { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" }, - { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" }, - { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" }, - { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" }, - { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" }, - { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" }, - { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" }, - { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" }, - { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" }, - { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" }, - { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" }, - { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" }, - { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" }, - { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" }, - { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" }, - { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" }, - { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" }, - { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" }, - { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" }, - { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" }, - { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" }, - { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" }, - { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" }, - - // Descent3 doesn't use correct string, hence this hack - { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" }, - - // Quake2 SGIS multitexture - { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" }, - { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" }, - { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" }, - - { NULL, "\0" } -}; - -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_DX( - LPCSTR a) -{ - int i; - PROC proc = NULL; - - for (i=0; GLD_extList[i].proc; i++) { - if (!strcmp(a, GLD_extList[i].name)) { - proc = GLD_extList[i].proc; - break; - } - } - - if (glb.bMultitexture) { - for (i=0; GLD_multitexList[i].proc; i++) { - if (!strcmp(a, GLD_multitexList[i].name)) { - proc = GLD_multitexList[i].proc; - break; - } - } - } - - gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed"); - - return proc; -} - -//--------------------------------------------------------------------------- - -void gldEnableExtensions_DX8( - GLcontext *ctx) -{ - GLuint i; - - // Mesa enables some extensions by default. - // This table decides which ones we want to switch off again. - - // NOTE: GL_EXT_compiled_vertex_array appears broken. - - const char *gld_disable_extensions[] = { -// "GL_ARB_transpose_matrix", -// "GL_EXT_compiled_vertex_array", -// "GL_EXT_polygon_offset", -// "GL_EXT_rescale_normal", - "GL_EXT_texture3D", -// "GL_NV_texgen_reflection", - NULL - }; - - const char *gld_multitex_extensions[] = { - "GL_ARB_multitexture", // Quake 3 - NULL - }; - - // Quake 2 engines - const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture"; - - const char *gld_enable_extensions[] = { - "GL_EXT_texture_env_add", // Quake 3 - "GL_ARB_texture_env_add", // Quake 3 - NULL - }; - - for (i=0; gld_disable_extensions[i]; i++) { - _mesa_disable_extension(ctx, gld_disable_extensions[i]); - } - - for (i=0; gld_enable_extensions[i]; i++) { - _mesa_enable_extension(ctx, gld_enable_extensions[i]); - } - - if (glb.bMultitexture) { - for (i=0; gld_multitex_extensions[i]; i++) { - _mesa_enable_extension(ctx, gld_multitex_extensions[i]); - } - - // GL_SGIS_multitexture - // NOTE: Quake2 ran *slower* with this enabled, so I've - // disabled it for now. - // Fair bit slower on GeForce256, - // Much slower on 3dfx Voodoo5 5500. -// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0); - - } - - _mesa_enable_imaging_extensions(ctx); - _mesa_enable_1_3_extensions(ctx); - _mesa_enable_1_4_extensions(ctx); -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c deleted file mode 100644 index 2baea5744..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_pipeline_dx8.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Mesa transformation pipeline with GLDirect fastpath -* -****************************************************************************/ - -//#include "../GLDirect.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx8.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -//--------------------------------------------------------------------------- - -extern struct tnl_pipeline_stage _gld_d3d_render_stage; -extern struct tnl_pipeline_stage _gld_mesa_render_stage; - -static const struct tnl_pipeline_stage *gld_pipeline[] = { - &_gld_d3d_render_stage, // Direct3D TnL - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */ - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_point_attenuation_stage, - &_gld_mesa_render_stage, // Mesa TnL, D3D rendering - 0, -}; - -//--------------------------------------------------------------------------- - -void gldInstallPipeline_DX8( - GLcontext *ctx) -{ - // Remove any existing pipeline stages, - // then install GLDirect pipeline stages. - - _tnl_destroy_pipeline(ctx); - _tnl_install_pipeline(ctx, gld_pipeline); -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c deleted file mode 100644 index a5b5462f0..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c +++ /dev/null @@ -1,1446 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Primitive (points/lines/tris/quads) rendering -* -****************************************************************************/ - -//#include "../GLDirect.h" - -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx8.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_lines.h" -#include "swrast/s_triangle.h" -#include "swrast/s_trispan.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -// Disable compiler complaints about unreferenced local variables -#pragma warning (disable:4101) - -//--------------------------------------------------------------------------- -// Helper defines for primitives -//--------------------------------------------------------------------------- - -//static const float ooZ = 1.0f / 65536.0f; // One over Z - -#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3])) -#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3])) -#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y)) - -//--------------------------------------------------------------------------- -// 2D vertex setup -//--------------------------------------------------------------------------- - -#define GLD_SETUP_2D_VARS_POINTS \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour - -#define GLD_SETUP_2D_VARS_LINES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour - -#define GLD_SETUP_2D_VARS_TRIANGLES \ - BOOL bFog = ctx->Fog.Enabled; \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour; \ - GLuint facing = 0; \ - struct vertex_buffer *VB; \ - GLchan (*vbcolor)[4]; \ - GLchan (*vbspec)[4] - -#define GLD_SETUP_GET_SWVERT(s) \ - swv = &ss->verts[##s] - -#define GLD_SETUP_2D_VERTEX \ - pV->x = swv->win[0]; \ - pV->y = GLD_FLIP_Y(swv->win[1]); \ - pV->rhw = swv->win[3] - -#define GLD_SETUP_SMOOTH_COLOUR \ - pV->diffuse = GLD_COLOUR - -#define GLD_SETUP_GET_FLAT_COLOUR \ - dwFlatColour = GLD_COLOUR -#define GLD_SETUP_GET_FLAT_FOG_COLOUR \ - dwFlatColour = _gldComputeFog(ctx, swv) - -#define GLD_SETUP_USE_FLAT_COLOUR \ - pV->diffuse = dwFlatColour - -#define GLD_SETUP_GET_FLAT_SPECULAR \ - dwSpecularColour= GLD_SPECULAR - -#define GLD_SETUP_USE_FLAT_SPECULAR \ - pV->specular = dwSpecularColour - -#define GLD_SETUP_DEPTH \ - pV->sz = swv->win[2] / ctx->DepthMaxF -// pV->z = swv->win[2] * ooZ; - -#define GLD_SETUP_SPECULAR \ - pV->specular = GLD_SPECULAR - -#define GLD_SETUP_FOG \ - pV->diffuse = _gldComputeFog(ctx, swv) - -#define GLD_SETUP_TEX0 \ - pV->t0_u = swv->texcoord[0][0]; \ - pV->t0_v = swv->texcoord[0][1] - -#define GLD_SETUP_TEX1 \ - pV->t1_u = swv->texcoord[1][0]; \ - pV->t1_v = swv->texcoord[1][1] - -#define GLD_SETUP_LIGHTING(v) \ - if (facing == 1) { \ - pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \ - if (vbspec) { \ - pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \ - } \ - } else { \ - if (bFog) \ - GLD_SETUP_FOG; \ - else \ - GLD_SETUP_SMOOTH_COLOUR; \ - GLD_SETUP_SPECULAR; \ - } - -#define GLD_SETUP_GET_FLAT_LIGHTING(v) \ - if (facing == 1) { \ - dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \ - if (vbspec) { \ - dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \ - } \ - } - -#define GLD_SETUP_TWOSIDED_LIGHTING \ - /* Two-sided lighting */ \ - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \ - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \ - SWvertex *v[3]; \ - GLfloat ex,ey,fx,fy,cc; \ - /* Get vars for later */ \ - VB = &TNL_CONTEXT(ctx)->vb; \ - vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ - if (VB->SecondaryColorPtr[1]) { \ - vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ - } else { \ - vbspec = NULL; \ - } \ - v[0] = &verts[v0]; \ - v[1] = &verts[v1]; \ - v[2] = &verts[v2]; \ - ex = v[0]->win[0] - v[2]->win[0]; \ - ey = v[0]->win[1] - v[2]->win[1]; \ - fx = v[1]->win[0] - v[2]->win[0]; \ - fy = v[1]->win[1] - v[2]->win[1]; \ - cc = ex*fy - ey*fx; \ - facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \ - } - -//--------------------------------------------------------------------------- -// 3D vertex setup -//--------------------------------------------------------------------------- - -#define GLD_SETUP_3D_VARS_POINTS \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VARS_LINES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VARS_TRIANGLES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ - pV->Position.x = p4f[##v][0]; \ - pV->Position.y = p4f[##v][1]; \ - pV->Position.z = p4f[##v][2]; - -#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ - pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); - - -#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ - dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); - -#define GLD_SETUP_USE_FLAT_COLOUR_3D \ - pV->Diffuse = dwColor; - -#define GLD_SETUP_TEX0_3D(v) \ - if (VB->TexCoordPtr[0]) { \ - tc = VB->TexCoordPtr[0]->data; \ - pV->TexUnit0.x = tc[##v][0]; \ - pV->TexUnit0.y = tc[##v][1]; \ - } - -#define GLD_SETUP_TEX1_3D(v) \ - if (VB->TexCoordPtr[1]) { \ - tc = VB->TexCoordPtr[1]->data; \ - pV->TexUnit1.x = tc[##v][0]; \ - pV->TexUnit1.y = tc[##v][1]; \ - } - -//--------------------------------------------------------------------------- -// Helper functions -//--------------------------------------------------------------------------- - -__inline DWORD _gldComputeFog( - GLcontext *ctx, - SWvertex *swv) -{ - // Full fog calculation. - // Based on Mesa code. - - GLchan rFog, gFog, bFog; - GLchan fR, fG, fB; - const GLfloat f = swv->fog; - const GLfloat g = 1.0f - f; - - UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]); - fR = f * swv->color[0] + g * rFog; - fG = f * swv->color[1] + g * gFog; - fB = f * swv->color[2] + g * bFog; - return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]); -} - -//--------------------------------------------------------------------------- - -void gld_ResetLineStipple_DX8( - GLcontext *ctx) -{ - // TODO: Fake stipple with a 32x32 texture. -} - -//--------------------------------------------------------------------------- -// 2D (post-transformed) primitives -//--------------------------------------------------------------------------- - -void gld_Points2D_DX8( - GLcontext *ctx, - GLuint first, - GLuint last) -{ - GLD_SETUP_2D_VARS_POINTS; - - unsigned i; - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - // _Size is already clamped to MaxPointSize and MinPointSize - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size)); - - if (VB->Elts) { - for (i=first; iClipMask[VB->Elts[i]] == 0) { -// _swrast_Point( ctx, &verts[VB->Elts[i]] ); - GLD_SETUP_GET_SWVERT(VB->Elts[i]); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - } - } - } else { - GLD_SETUP_GET_SWVERT(first); - for (i=first; iClipMask[i] == 0) { -// _swrast_Point( ctx, &verts[i] ); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - } - } - } - - gld->PB2d.pPoints = (BYTE*)pV; - gld->PB2d.nPoints += (last-first); -} - -//--------------------------------------------------------------------------- - -void gld_Line2DFlat_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_2D_VARS_LINES; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pLines = (BYTE*)pV; - gld->PB2d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Line2DSmooth_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_2D_VARS_LINES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_SPECULAR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pLines = (BYTE*)pV; - gld->PB2d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlat_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - pV++;; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmooth_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlatExtras_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v2); - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - if (bFog) - GLD_SETUP_GET_FLAT_FOG_COLOUR; - else - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_GET_FLAT_LIGHTING(v2); - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmoothExtras_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v0); - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v1); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlat_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmooth_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlatExtras_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v3); - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - if (bFog) - GLD_SETUP_GET_FLAT_FOG_COLOUR; - else - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_GET_FLAT_LIGHTING(v3); - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmoothExtras_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v0); - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v1); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v3); - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- -// 3D (pre-transformed) primitives -//--------------------------------------------------------------------------- - -void gld_Points3D_DX8( - GLcontext *ctx, - GLuint first, - GLuint last) -{ - GLD_SETUP_3D_VARS_POINTS - - unsigned i; -// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - // _Size is already clamped to MaxPointSize and MinPointSize - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size)); - - if (VB->Elts) { - for (i=first; iClipMask[VB->Elts[i]] == 0) { -// _swrast_Point( ctx, &verts[VB->Elts[i]] ); -// GLD_SETUP_GET_SWVERT(VB->Elts[i]); - GLD_SETUP_3D_VERTEX(VB->Elts[i]) - GLD_SETUP_SMOOTH_COLOUR_3D(i) - GLD_SETUP_TEX0_3D(i) - GLD_SETUP_TEX1_3D(i) - } - } - } else { -// GLD_SETUP_GET_SWVERT(first); - for (i=first; iClipMask[i] == 0) { -// _swrast_Point( ctx, &verts[i] ); - GLD_SETUP_3D_VERTEX(i) - GLD_SETUP_SMOOTH_COLOUR_3D(i) - GLD_SETUP_TEX0_3D(i) - GLD_SETUP_TEX1_3D(i) - } - } - } -/* - for (i=first; iPB3d.pPoints = (BYTE*)pV; - gld->PB3d.nPoints += (last-first); -} - -//--------------------------------------------------------------------------- -// Line functions -//--------------------------------------------------------------------------- - -void gld_Line3DFlat_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_3D_VARS_LINES - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_GET_FLAT_COLOUR_3D(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pLines = (BYTE*)pV; - gld->PB3d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Line3DSmooth_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_3D_VARS_LINES - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pLines = (BYTE*)pV; - gld->PB3d.nLines++; -} - -//--------------------------------------------------------------------------- -// Triangle functions -//--------------------------------------------------------------------------- - -void gld_Triangle3DFlat_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - GLD_SETUP_GET_FLAT_COLOUR_3D(v2) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle3DSmooth_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles++; -} - -//--------------------------------------------------------------------------- -// Quad functions -//--------------------------------------------------------------------------- - -void gld_Quad3DFlat_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_GET_FLAT_COLOUR_3D(v3) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad3DSmooth_DX8( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_SMOOTH_COLOUR_3D(v3) - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- -// Vertex setup for two-sided-lighting vertex shader -//--------------------------------------------------------------------------- - -/* - -void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last) -{ - // NOTE: Two-sided lighting does not apply to Points -} - -//--------------------------------------------------------------------------- - -void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1) -{ - // NOTE: Two-sided lighting does not apply to Lines -} - -//--------------------------------------------------------------------------- - -void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1) -{ - // NOTE: Two-sided lighting does not apply to Lines -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2) -{ -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 4th vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 5th vert - swv = &ss->verts[v3]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 6th vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 4th vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 5th vert - swv = &ss->verts[v3]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 6th vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -*/ diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c deleted file mode 100644 index f24b3cfb7..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_texture_dx8.c +++ /dev/null @@ -1,2046 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Texture / Bitmap functions -* -****************************************************************************/ - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx8.h" - -#include - -#include "texformat.h" -#include "colormac.h" -#include "texstore.h" -#include "image.h" -// #include "mem.h" - -//--------------------------------------------------------------------------- - -#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h)) - -//--------------------------------------------------------------------------- -// 1D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + (i) * (sz)) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (i) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (i)) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + (i)) - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// 2D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz)) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + ((t)->Width * (j) + (i))) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i))) - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// 3D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i)) * (sz) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i))) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i))) - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// Direct3D texture formats that have no Mesa equivalent -//--------------------------------------------------------------------------- - -const struct gl_texture_format _gld_texformat_X8R8G8B8 = { - MESA_FORMAT_ARGB8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */ - gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */ - gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */ -}; - -const struct gl_texture_format _gld_texformat_X1R5G5B5 = { - MESA_FORMAT_ARGB1555, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */ - gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */ - gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */ -}; - -const struct gl_texture_format _gld_texformat_X4R4G4B4 = { - MESA_FORMAT_ARGB4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */ - gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */ - gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */ -}; - -//--------------------------------------------------------------------------- -// Texture unit constants -//--------------------------------------------------------------------------- - -// List of possible combinations of texture environments. -// Example: GLD_TEXENV_MODULATE_RGBA means -// GL_MODULATE, GL_RGBA base internal format. -#define GLD_TEXENV_DECAL_RGB 0 -#define GLD_TEXENV_DECAL_RGBA 1 -#define GLD_TEXENV_DECAL_ALPHA 2 -#define GLD_TEXENV_REPLACE_RGB 3 -#define GLD_TEXENV_REPLACE_RGBA 4 -#define GLD_TEXENV_REPLACE_ALPHA 5 -#define GLD_TEXENV_MODULATE_RGB 6 -#define GLD_TEXENV_MODULATE_RGBA 7 -#define GLD_TEXENV_MODULATE_ALPHA 8 -#define GLD_TEXENV_BLEND_RGB 9 -#define GLD_TEXENV_BLEND_RGBA 10 -#define GLD_TEXENV_BLEND_ALPHA 11 -#define GLD_TEXENV_ADD_RGB 12 -#define GLD_TEXENV_ADD_RGBA 13 -#define GLD_TEXENV_ADD_ALPHA 14 - -// Per-stage (i.e. per-unit) texture environment -typedef struct { - DWORD ColorArg1; // Colour argument 1 - D3DTEXTUREOP ColorOp; // Colour operation - DWORD ColorArg2; // Colour argument 2 - DWORD AlphaArg1; // Alpha argument 1 - D3DTEXTUREOP AlphaOp; // Alpha operation - DWORD AlphaArg2; // Alpha argument 2 -} GLD_texenv; - -// TODO: Do we really need to set ARG1 and ARG2 every time? -// They seem to always be TEXTURE and CURRENT respectively. - -// C = Colour out -// A = Alpha out -// Ct = Colour from Texture -// Cf = Colour from fragment (diffuse) -// At = Alpha from Texture -// Af = Alpha from fragment (diffuse) -// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND) -const GLD_texenv gldTexEnv[] = { - // DECAL_RGB: C=Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af - {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // DECAL_ALPHA: use DECAL_RGB - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - - // REPLACE_RGB: C=Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // REPLACE_RGBA: C=Ct, A=At - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT}, - // REPLACE_ALPHA: C=Cf, A=At - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT}, - - // MODULATE_RGB: C=CfCt, A=Af - {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // MODULATE_RGBA: C=CfCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // MODULATE_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - - // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af - {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // BLEND_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - - // ADD_RGB: C=Cf+Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // ADD_RGBA: C=Cf+Ct, A=AfAt - {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // ADD_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, -}; - -//--------------------------------------------------------------------------- - -D3DTEXTUREADDRESS _gldConvertWrap( - GLenum wrap) -{ - return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP; -} - -//--------------------------------------------------------------------------- - -D3DTEXTUREFILTERTYPE _gldConvertMagFilter( - GLenum magfilter) -{ - return (magfilter == GL_LINEAR) ? D3DTEXF_LINEAR : D3DTEXF_POINT; -} - -//--------------------------------------------------------------------------- - -void _gldConvertMinFilter( - GLenum minfilter, - D3DTEXTUREFILTERTYPE *min_filter, - D3DTEXTUREFILTERTYPE *mip_filter) -{ - switch (minfilter) { - case GL_NEAREST: - *min_filter = D3DTEXF_POINT; - *mip_filter = D3DTEXF_NONE; - break; - case GL_LINEAR: - *min_filter = D3DTEXF_LINEAR; - *mip_filter = D3DTEXF_NONE; - break; - case GL_NEAREST_MIPMAP_NEAREST: - *min_filter = D3DTEXF_POINT; - *mip_filter = D3DTEXF_POINT; - break; - case GL_LINEAR_MIPMAP_NEAREST: - *min_filter = D3DTEXF_LINEAR; - *mip_filter = D3DTEXF_POINT; - break; - case GL_NEAREST_MIPMAP_LINEAR: - *min_filter = D3DTEXF_POINT; - *mip_filter = D3DTEXF_LINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - *min_filter = D3DTEXF_LINEAR; - *mip_filter = D3DTEXF_LINEAR; - break; - } -} - -//--------------------------------------------------------------------------- - -D3DFORMAT _gldGLFormatToD3DFormat( - GLenum internalFormat) -{ - switch (internalFormat) { - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures - return D3DFMT_L8; - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return D3DFMT_L8; - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return D3DFMT_A8; - 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 D3DFMT_X8R8G8B8; - 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 D3DFMT_A8L8; - case GL_R3_G3_B2: - // TODO: Mesa does not support RGB332 internally - return D3DFMT_X4R4G4B4; //D3DFMT_R3G3B2; - case GL_RGB4: - return D3DFMT_X4R4G4B4; - case GL_RGB5: - return D3DFMT_X1R5G5B5; - case 3: - case GL_RGB: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return D3DFMT_R8G8B8; - case GL_RGBA4: - return D3DFMT_A4R4G4B4; - case 4: - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return D3DFMT_A8R8G8B8; - case GL_RGB5_A1: - return D3DFMT_A1R5G5B5; - } - - // Return an acceptable default - return D3DFMT_A8R8G8B8; -} - -//--------------------------------------------------------------------------- - -GLenum _gldDecodeBaseFormat( - IDirect3DTexture8 *pTex) -{ - // Examine Direct3D texture and return base OpenGL internal texture format - // NOTE: We can't use any base format info from Mesa because D3D might have - // used a different texture format when we used D3DXCreateTexture(). - - // Base internal format is one of (Red Book p355): - // GL_ALPHA, - // GL_LUMINANCE, - // GL_LUMINANCE_ALPHA, - // GL_INTENSITY, - // GL_RGB, - // GL_RGBA - - // NOTE: INTENSITY not used (not supported by Direct3D) - // LUMINANCE has same texture functions as RGB - // LUMINANCE_ALPHA has same texture functions as RGBA - - // TODO: cache format instead of using GetLevelDesc() - D3DSURFACE_DESC desc; - _GLD_DX8_TEX(GetLevelDesc(pTex, 0, &desc)); - - switch (desc.Format) { - case D3DFMT_R8G8B8: - case D3DFMT_X8R8G8B8: - case D3DFMT_R5G6B5: - case D3DFMT_X1R5G5B5: - case D3DFMT_R3G3B2: - case D3DFMT_X4R4G4B4: - case D3DFMT_P8: - case D3DFMT_L8: - return GL_RGB; - case D3DFMT_A8R8G8B8: - case D3DFMT_A1R5G5B5: - case D3DFMT_A4R4G4B4: - case D3DFMT_A8R3G3B2: - case D3DFMT_A8P8: - case D3DFMT_A8L8: - case D3DFMT_A4L4: - return GL_RGBA; - case D3DFMT_A8: - return GL_ALPHA; - // Compressed texture formats. Need to check these... - case D3DFMT_DXT1: - return GL_RGBA; - case D3DFMT_DXT2: - return GL_RGB; - case D3DFMT_DXT3: - return GL_RGBA; - case D3DFMT_DXT4: - return GL_RGB; - case D3DFMT_DXT5: - return GL_RGBA; - } - - // Fell through. Return arbitary default. - return GL_RGBA; -} - -//--------------------------------------------------------------------------- - -const struct gl_texture_format* _gldMesaFormatForD3DFormat( - D3DFORMAT d3dfmt) -{ - switch (d3dfmt) { - case D3DFMT_A8R8G8B8: - return &_mesa_texformat_argb8888; - case D3DFMT_R8G8B8: - return &_mesa_texformat_rgb888; - case D3DFMT_R5G6B5: - return &_mesa_texformat_rgb565; - case D3DFMT_A4R4G4B4: - return &_mesa_texformat_argb4444; - case D3DFMT_A1R5G5B5: - return &_mesa_texformat_argb1555; - case D3DFMT_A8L8: - return &_mesa_texformat_al88; - case D3DFMT_R3G3B2: - return &_mesa_texformat_rgb332; - case D3DFMT_A8: - return &_mesa_texformat_a8; - case D3DFMT_L8: - return &_mesa_texformat_l8; - case D3DFMT_X8R8G8B8: - return &_gld_texformat_X8R8G8B8; - case D3DFMT_X1R5G5B5: - return &_gld_texformat_X1R5G5B5; - case D3DFMT_X4R4G4B4: - return &_gld_texformat_X4R4G4B4; - } - - // If we reach here then we've made an error somewhere else - // by allowing a format that is not supported. - assert(0); - - return NULL; // Shut up compiler warning -} - -//--------------------------------------------------------------------------- -// Copy* functions -//--------------------------------------------------------------------------- - -void gldCopyTexImage1D_DX8( - GLcontext *ctx, - GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLint border ) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexImage2D_DX8( - GLcontext *ctx, - GLenum target, - GLint level, - GLenum internalFormat, - GLint x, - GLint y, - GLsizei width, - GLsizei height, - GLint border) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage1D_DX8( - GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage2D_DX8( - GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint x, - GLint y, - GLsizei width, - GLsizei height) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage3D_DX8( - GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint zoffset, - GLint x, - GLint y, - GLsizei width, - GLsizei height ) -{ - // TODO ? -} - -//--------------------------------------------------------------------------- -// Bitmap/Pixel functions -//--------------------------------------------------------------------------- - -#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y)) - -#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1) - -typedef struct { - FLOAT x, y; // 2D raster coords - FLOAT z; // depth value - FLOAT rhw; // reciprocal homogenous W (always 1.0f) - FLOAT tu, tv; // texture coords -} _GLD_IMAGE_VERTEX; - -//--------------------------------------------------------------------------- - -HRESULT _gldDrawPixels( - GLcontext *ctx, - BOOL bChromakey, // Alpha test for glBitmap() images - GLint x, // GL x position - GLint y, // GL y position (needs flipping) - GLsizei width, // Width of input image - GLsizei height, // Height of input image - IDirect3DSurface8 *pImage) -{ - // - // Draw input image as texture implementing PixelZoom and clipping. - // Any fragment operations currently enabled will be used. - // - - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - IDirect3DTexture8 *pTexture; - D3DSURFACE_DESC d3dsd; - IDirect3DSurface8 *pSurface; - _GLD_IMAGE_VERTEX v[4]; - HRESULT hr; - - float ZoomWidth, ZoomHeight; - float ScaleWidth, ScaleHeight; - - // Create a texture to hold image - hr = D3DXCreateTexture( - gld->pDev, - width, height, - 1, // miplevels - 0, // usage - D3DFMT_A8R8G8B8, // format - D3DPOOL_MANAGED, // pool - &pTexture); - if (FAILED(hr)) - return hr; - - hr = IDirect3DTexture8_GetSurfaceLevel(pTexture, 0, &pSurface); - if (FAILED(hr)) { - IDirect3DTexture8_Release(pTexture); - return hr; - } - - // Copy image into texture - hr = D3DXLoadSurfaceFromSurface( - pSurface, NULL, NULL, // Dest surface - pImage, NULL, NULL, // Src surface - D3DX_FILTER_NONE, - 0); - IDirect3DSurface8_Release(pSurface); - if (FAILED(hr)) { - IDirect3DTexture8_Release(pTexture); - return hr; - } - - // - // Set up the quad like this (ascii-art ahead!) - // - // 3--2 - // | | - // 0--1 - // - // - - // Set depth - v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2]; - // Set Reciprocal Homogenous W - v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f; - - // Set texcoords - // Examine texture size - if different to input width and height - // then we'll need to munge the texcoords to fit. - IDirect3DTexture8_GetLevelDesc(pTexture, 0, &d3dsd); - ScaleWidth = (float)width / (float)d3dsd.Width; - ScaleHeight = (float)height / (float)d3dsd.Height; - v[0].tu = 0.0f; v[0].tv = 0.0f; - v[1].tu = ScaleWidth; v[1].tv = 0.0f; - v[2].tu = ScaleWidth; v[2].tv = ScaleHeight; - v[3].tu = 0.0f; v[3].tv = ScaleHeight; - - // Set raster positions - ZoomWidth = (float)width * ctx->Pixel.ZoomX; - ZoomHeight = (float)height * ctx->Pixel.ZoomY; - - v[0].x = x; v[0].y = GLD_FLIP_Y(y); - v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y); - v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight); - v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight); - - // Draw image with full HW acceleration - // NOTE: Be nice to use a State Block for all this state... - IDirect3DDevice8_SetTexture(gld->pDev, 0, pTexture); - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE); - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTEXF_POINT); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - IDirect3DDevice8_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - IDirect3DDevice8_SetVertexShader(gld->pDev, _GLD_FVF_IMAGE); - - // - // Emulate Chromakey with an Alpha Test. - // [Alpha Test is more widely supported anyway] - // - if (bChromakey) { - // Switch on alpha testing - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, TRUE); - // Fragment passes is alpha is greater than reference value - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, D3DCMP_GREATER); - // Set alpha reference value between Bitmap alpha values of - // zero (transparent) and one (opaque). - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ALPHAREF, 0x7f); - } - - IDirect3DDevice8_DrawPrimitiveUP(gld->pDev, D3DPT_TRIANGLEFAN, 2, &v, sizeof(_GLD_IMAGE_VERTEX)); - - // Release texture - IDirect3DDevice8_SetTexture(gld->pDev, 0, NULL); - IDirect3DTexture8_Release(pTexture); - - // Reset state to before we messed it up - FLUSH_VERTICES(ctx, _NEW_ALL); - - return S_OK; -} - -//--------------------------------------------------------------------------- - -void gld_DrawPixels_DX8( - GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - GLD_context *gldCtx; - GLD_driver_dx8 *gld; - - IDirect3DSurface8 *pImage; - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - - const struct gl_texture_format *MesaFormat; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX8_DRIVER(gldCtx); - - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - &pImage); - if (FAILED(hr)) { - return; - } - - // - // Use Mesa to fill in image - // - - // Lock all of surface - hr = IDirect3DSurface8_LockRect(pImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pImage); - return; - } - - MesaFormat = _mesa_choose_tex_format(ctx, format, format, type); - - // unpack image, apply transfer ops and store directly in texture - MesaFormat->StoreImage( - ctx, - 2, - GL_RGBA, - &_mesa_texformat_argb8888, - d3dLockedRect.pBits, - width, height, 1, 0, 0, 0, - d3dLockedRect.Pitch, - 0, /* dstImageStride */ - format, type, pixels, unpack); - - IDirect3DSurface8_UnlockRect(pImage); - - _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage); - - IDirect3DSurface8_Release(pImage); -} - -//--------------------------------------------------------------------------- - -void gld_ReadPixels_DX8( - GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest) -{ - - GLD_context *gldCtx; - GLD_driver_dx8 *gld; - - IDirect3DSurface8 *pBackbuffer = NULL; - IDirect3DSurface8 *pNativeImage = NULL; - IDirect3DSurface8 *pCanonicalImage = NULL; - - D3DSURFACE_DESC d3dsd; - RECT rcSrc; // Source rect - POINT ptDst; // Dest point - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - struct gl_pixelstore_attrib srcPacking; - int i; - GLint DstRowStride; - const struct gl_texture_format *MesaFormat; - - switch (format) { - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - return; - } - - MesaFormat = _mesa_choose_tex_format(ctx, format, format, type); - DstRowStride = _mesa_image_row_stride(pack, width, format, type); - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX8_DRIVER(gldCtx); - - // Get backbuffer - hr = IDirect3DDevice8_GetBackBuffer( - gld->pDev, - 0, // First backbuffer - D3DBACKBUFFER_TYPE_MONO, - &pBackbuffer); - if (FAILED(hr)) - return; - - // Get backbuffer description - hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd); - if (FAILED(hr)) { - goto gld_ReadPixels_DX8_return; - } - - // Create a surface compatible with backbuffer - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - d3dsd.Format, - &pNativeImage); - if (FAILED(hr)) { - goto gld_ReadPixels_DX8_return; - } - - // Compute source rect and dest point - SetRect(&rcSrc, 0, 0, width, height); - OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height)); - ptDst.x = ptDst.y = 0; - - // Get source pixels. - // - // This intermediate surface ensure that we can use CopyRects() - // instead of relying on D3DXLoadSurfaceFromSurface(), which may - // try and lock the backbuffer. This way seems safer. - // - hr = IDirect3DDevice8_CopyRects( - gld->pDev, - pBackbuffer, - &rcSrc, - 1, - pNativeImage, - &ptDst); - if (FAILED(hr)) { - goto gld_ReadPixels_DX8_return; - } - - // Create an RGBA8888 surface - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - &pCanonicalImage); - if (FAILED(hr)) { - goto gld_ReadPixels_DX8_return; - } - - // Convert to RGBA8888 - hr = D3DXLoadSurfaceFromSurface( - pCanonicalImage, // Dest surface - NULL, NULL, // Dest palette, RECT - pNativeImage, // Src surface - NULL, NULL, // Src palette, RECT - D3DX_FILTER_NONE, // Filter - 0); // Colourkey - if (FAILED(hr)) { - goto gld_ReadPixels_DX8_return; - } - - srcPacking.Alignment = 1; - srcPacking.ImageHeight = height; - srcPacking.LsbFirst = GL_FALSE; - srcPacking.RowLength = 0; - srcPacking.SkipImages = 0; - srcPacking.SkipPixels = 0; - srcPacking.SkipRows = 0; - srcPacking.SwapBytes = GL_FALSE; - - // Lock all of image - hr = IDirect3DSurface8_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - goto gld_ReadPixels_DX8_return; - } - - // We need to flip the data. Yuck. - // Perhaps Mesa has a span packer we can use in future... - for (i=0; iStoreImage( - ctx, - 2, - GL_RGBA, // base format - MesaFormat, // dst format - pDestRow, // dest addr - width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z - DstRowStride, // dst row stride - 0, // dstImageStride - GL_BGRA, // src format - GL_UNSIGNED_BYTE, // src type - pSrcRow, // src addr - &srcPacking); // packing params of source image - } - - IDirect3DSurface8_UnlockRect(pCanonicalImage); - -gld_ReadPixels_DX8_return: - SAFE_RELEASE_SURFACE8(pCanonicalImage); - SAFE_RELEASE_SURFACE8(pNativeImage); - SAFE_RELEASE_SURFACE8(pBackbuffer); -} - -//--------------------------------------------------------------------------- - -void gld_CopyPixels_DX8( - GLcontext *ctx, - GLint srcx, - GLint srcy, - GLsizei width, - GLsizei height, - GLint dstx, - GLint dsty, - GLenum type) -{ - // - // NOTE: Not allowed to copy vidmem to vidmem! - // Therefore we use an intermediate image surface. - // - - GLD_context *gldCtx; - GLD_driver_dx8 *gld; - - IDirect3DSurface8 *pBackbuffer; - D3DSURFACE_DESC d3dsd; - IDirect3DSurface8 *pImage; - RECT rcSrc; // Source rect - POINT ptDst; // Dest point - HRESULT hr; - - // Only backbuffer - if (type != GL_COLOR) - return; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX8_DRIVER(gldCtx); - - // Get backbuffer - hr = IDirect3DDevice8_GetBackBuffer( - gld->pDev, - 0, // First backbuffer - D3DBACKBUFFER_TYPE_MONO, - &pBackbuffer); - if (FAILED(hr)) - return; - - // Get backbuffer description - hr = IDirect3DSurface8_GetDesc(pBackbuffer, &d3dsd); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pBackbuffer); - return; - } - - // Create a surface compatible with backbuffer - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - d3dsd.Format, - &pImage); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pBackbuffer); - return; - } - - // Compute source rect and dest point - SetRect(&rcSrc, 0, 0, width, height); - OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height)); - ptDst.x = ptDst.y = 0; - - // Get source pixels - hr = IDirect3DDevice8_CopyRects( - gld->pDev, - pBackbuffer, - &rcSrc, - 1, - pImage, - &ptDst); - IDirect3DSurface8_Release(pBackbuffer); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pImage); - return; - } - - _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage); - - IDirect3DSurface8_Release(pImage); -} - -//--------------------------------------------------------------------------- - -void gld_Bitmap_DX8( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei width, - GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - GLD_context *gldCtx; - GLD_driver_dx8 *gld; - - IDirect3DSurface8 *pImage; - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - BYTE *pTempBitmap; - D3DCOLOR clBitmapOne, clBitmapZero; - D3DCOLOR *pBits; - const GLubyte *src; - int i, j, k; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX8_DRIVER(gldCtx); - - clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero - clBitmapOne = D3DCOLOR_COLORVALUE( - ctx->Current.RasterColor[0], - ctx->Current.RasterColor[1], - ctx->Current.RasterColor[2], - 1.0f); // NOTE: Alpha is One - - hr = IDirect3DDevice8_CreateImageSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - &pImage); - if (FAILED(hr)) { - return; - } - - // Lock all of surface - hr = IDirect3DSurface8_LockRect(pImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pImage); - return; - } - - pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack); - if (pTempBitmap == NULL) { - IDirect3DSurface8_Release(pImage); - return; - } - - pBits = (D3DCOLOR*)d3dLockedRect.pBits; - - for (i=0; iDefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, - 0, i, 0); - for (j=0; j<(width>>3); j++) { - byte = *src++; - for (k=0; k<8; k++) { - *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero; - byte <<= 1; - } - } - // Fill remaining bits from bitmap - if (width & 7) { - byte = *src; - for (k=0; k<(width & 7); k++) { - *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero; - byte <<= 1; - } - } - } - - FREE(pTempBitmap); - -/* - // unpack image, apply transfer ops and store directly in texture - texImage->TexFormat->StoreImage( - ctx, - 2, - GL_BITMAP, - &_mesa_texformat_argb8888, - d3dLockedRect.pBits, - width, height, 1, 0, 0, 0, - d3dLockedRect.Pitch, - 0, // dstImageStride - GL_BITMAP, GL_COLOR_INDEX, bitmap, unpack); -*/ - IDirect3DSurface8_UnlockRect(pImage); - - _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage); - - IDirect3DSurface8_Release(pImage); -} - -//--------------------------------------------------------------------------- -// Texture functions -//--------------------------------------------------------------------------- - -void _gldAllocateTexture( - GLcontext *ctx, - struct gl_texture_object *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - IDirect3DTexture8 *pTex; - D3DFORMAT d3dFormat; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (pTex) { - // Decide whether we can keep existing D3D texture - // by examining top-level surface. - D3DSURFACE_DESC d3dsd; - _GLD_DX8_TEX(GetLevelDesc(pTex, 0, &d3dsd)); - // Release existing texture if not compatible - if ((d3dsd.Width == texImage->Width) || - (d3dsd.Height == texImage->Height)) - { - return; // Keep the existing texture - } - tObj->DriverData = NULL; - _GLD_DX8_TEX(Release(pTex)); - } - - d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat); - D3DXCreateTexture( - gld->pDev, - texImage->Width, - texImage->Height, - // TODO: Re-evaluate mipmapping - (glb.bUseMipmaps) ? D3DX_DEFAULT : 1, - 0, // Usage - d3dFormat, - D3DPOOL_MANAGED, - &pTex); - tObj->DriverData = pTex; -} - -//--------------------------------------------------------------------------- - -const struct gl_texture_format* gld_ChooseTextureFormat_DX8( - GLcontext *ctx, - GLint internalFormat, - GLenum srcFormat, - GLenum srcType) -{ - // [Based on mesa_choose_tex_format()] - // - // We will choose only texture formats that are supported - // by Direct3D. If the hardware doesn't support a particular - // texture format, then the D3DX texture calls that we use - // will automatically use a HW supported format. - // - // The most critical aim is to reduce copying; if we can use - // texture-image data directly then it will be a big performance assist. - // - - switch (internalFormat) { - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return &_mesa_texformat_l8; // D3DFMT_L8 - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return &_mesa_texformat_l8; // D3DFMT_L8 - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return &_mesa_texformat_a8; // D3DFMT_A8 - 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 &_mesa_texformat_rgb565; // D3DFMT_R5G6B5 - // Mesa will convert this for us later... - // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5 - 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 &_mesa_texformat_al88; // D3DFMT_A8L8 - case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2 - case GL_RGB4: - case GL_RGBA4: - case GL_RGBA2: - return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4 - case 3: - case GL_RGB: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return &_mesa_texformat_rgb565; - case 4: - case GL_RGBA: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return &_mesa_texformat_argb8888; - case GL_RGB5_A1: - return &_mesa_texformat_argb1555; - default: - _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat"); - return NULL; - } -} - -//--------------------------------------------------------------------------- - -/* -// Safer(?), slower version. -void gld_TexImage2D_DX8( - GLcontext *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 *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - IDirect3DTexture8 *pTex; - IDirect3DSurface8 *pSurface; - RECT rcSrcRect; - HRESULT hr; - GLint texelBytes = 4; - GLvoid *tempImage; - - if (!tObj || !texImage) - return; - - if (level == 0) { - _gldAllocateTexture(ctx, tObj, texImage); - } - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture8_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - IDirect3DSurface8_Release(pSurface); - return; - } - // unpack image, apply transfer ops and store in tempImage - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - &_mesa_texformat_argb8888, // dest format - tempImage, - width, height, 1, 0, 0, 0, - width * texelBytes, - 0, // dstImageStride - format, type, pixels, packing); - - SetRect(&rcSrcRect, 0, 0, width, height); - D3DXLoadSurfaceFromMemory( - pSurface, - NULL, - NULL, - tempImage, - D3DFMT_A8R8G8B8, - width * texelBytes, - NULL, - &rcSrcRect, - D3DX_FILTER_NONE, - 0); - - FREE(tempImage); - IDirect3DSurface8_Release(pSurface); -} -*/ - -//--------------------------------------------------------------------------- - -// Faster, more efficient version. -// Copies subimage straight to dest texture -void gld_TexImage2D_DX8( - GLcontext *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 *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - IDirect3DTexture8 *pTex; - IDirect3DSurface8 *pSurface; - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - D3DSURFACE_DESC d3dsd; - - if (!tObj || !texImage) - return; - - // GLQUAKE FIX - // Test for input alpha data with non-alpha internalformat - if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) { - // Input format has alpha, but a non-alpha format has been requested. - texImage->IntFormat = GL_RGBA; - internalFormat = GL_RGBA; - } - - if (level == 0) { - _gldAllocateTexture(ctx, tObj, texImage); - } - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture8_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - IDirect3DSurface8_GetDesc(pSurface, &d3dsd); - - // Lock all of surface - hr = IDirect3DSurface8_LockRect(pSurface, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store directly in texture - texImage->TexFormat->StoreImage( - ctx, - 2, - texImage->Format, - _gldMesaFormatForD3DFormat(d3dsd.Format), - d3dLockedRect.pBits, - width, height, 1, 0, 0, 0, - d3dLockedRect.Pitch, - 0, // dstImageStride - format, type, pixels, packing); - - IDirect3DSurface8_UnlockRect(pSurface); - IDirect3DSurface8_Release(pSurface); -} - -//--------------------------------------------------------------------------- - -void gld_TexImage1D_DX8(GLcontext *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 ) -{ - // A 1D texture is a 2D texture with a height of zero - gld_TexImage2D_DX8(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage); -} - -//--------------------------------------------------------------------------- - -/* -void gld_TexSubImage2D( GLcontext *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 *tObj, - struct gl_texture_image *texImage ) -{ - GLD_GET_CONTEXT - IDirect3DTexture8 *pTex; - IDirect3DSurface8 *pSurface; - D3DFORMAT d3dFormat; - HRESULT hr; - GLint texelBytes = 4; - GLvoid *tempImage; - RECT rcSrcRect; - RECT rcDstRect; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= _GLD_DX8_TEX(GetLevelCount(pTex)) - return; // Level does not exist - hr = _GLD_DX8_TEX(GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - d3dFormat = _gldGLFormatToD3DFormat(texImage->Format); - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - IDirect3DSurface8_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store in tempImage - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - &_mesa_texformat_argb8888, // dest format - tempImage, - width, height, 1, 0, 0, 0, - width * texelBytes, - 0, // dstImageStride - format, type, pixels, packing); - - // Source rectangle is whole of input image - SetRect(&rcSrcRect, 0, 0, width, height); - - // Dest rectangle must be offset to dest image - SetRect(&rcDstRect, 0, 0, width, height); - OffsetRect(&rcDstRect, xoffset, yoffset); - - D3DXLoadSurfaceFromMemory( - pSurface, - NULL, - &rcDstRect, - tempImage, - D3DFMT_A8R8G8B8, - width * texelBytes, - NULL, - &rcSrcRect, - D3DX_FILTER_NONE, - 0); - - FREE(tempImage); - IDirect3DSurface8_Release(pSurface); -} -*/ - -//--------------------------------------------------------------------------- - -// Faster, more efficient version. -// Copies subimage straight to dest texture -void gld_TexSubImage2D_DX8( GLcontext *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 *tObj, - struct gl_texture_image *texImage ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - IDirect3DTexture8 *pTex; - IDirect3DSurface8 *pSurface; - HRESULT hr; - RECT rcDstRect; - D3DLOCKED_RECT d3dLockedRect; - D3DSURFACE_DESC d3dsd; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture8*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture8_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture8_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - IDirect3DSurface8_GetDesc(pSurface, &d3dsd); - - // Dest rectangle must be offset to dest image - SetRect(&rcDstRect, 0, 0, width, height); - OffsetRect(&rcDstRect, xoffset, yoffset); - - // Lock sub-rect of surface - hr = IDirect3DSurface8_LockRect(pSurface, &d3dLockedRect, &rcDstRect, 0); - if (FAILED(hr)) { - IDirect3DSurface8_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store directly in texture - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - _gldMesaFormatForD3DFormat(d3dsd.Format), - d3dLockedRect.pBits, - width, height, 1, - 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!! - d3dLockedRect.Pitch, - 0, // dstImageStride - format, type, pixels, packing); - - - IDirect3DSurface8_UnlockRect(pSurface); - IDirect3DSurface8_Release(pSurface); -} - -//--------------------------------------------------------------------------- - -void gld_TexSubImage1D_DX8( GLcontext *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 ) -{ - gld_TexSubImage2D_DX8(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage); -} - -//--------------------------------------------------------------------------- - -void gld_DeleteTexture_DX8( - GLcontext *ctx, - struct gl_texture_object *tObj) -{ - GLD_context *gld = (GLD_context*)(ctx->DriverCtx); - - if (tObj) { - IDirect3DTexture8 *pTex = (IDirect3DTexture8*)tObj->DriverData; - if (pTex) { -/* // Make sure texture is not bound to a stage before releasing it - for (int i=0; iCurrentTexture[i] == pTex) { - gld->pDev->SetTexture(i, NULL); - gld->CurrentTexture[i] = NULL; - } - }*/ - _GLD_DX8_TEX(Release(pTex)); - tObj->DriverData = NULL; - } - } -} - -//--------------------------------------------------------------------------- - -__inline void _gldSetColorOps( - const GLD_driver_dx8 *gld, - GLuint unit, - DWORD ColorArg1, - D3DTEXTUREOP ColorOp, - DWORD ColorArg2) -{ - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1)); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp)); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2)); -} - -//--------------------------------------------------------------------------- - -__inline void _gldSetAlphaOps( - const GLD_driver_dx8 *gld, - GLuint unit, - DWORD AlphaArg1, - D3DTEXTUREOP AlphaOp, - DWORD AlphaArg2) -{ - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1)); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp)); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2)); -} - -//--------------------------------------------------------------------------- - -void gldUpdateTextureUnit( - GLcontext *ctx, - GLuint unit, - BOOL bPassThrough) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - D3DTEXTUREFILTERTYPE minfilter; - D3DTEXTUREFILTERTYPE mipfilter; - GLenum BaseFormat; - DWORD dwColorArg0; - int iTexEnv = 0; - GLD_texenv *pTexenv; - - // NOTE: If bPassThrough is FALSE then texture stage can be - // disabled otherwise it must pass-through it's current fragment. - - const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = pUnit->_Current; - - IDirect3DTexture8 *pTex = NULL; - if (tObj) { - pTex = (IDirect3DTexture8*)tObj->DriverData; - } - - // Enable texturing if unit is enabled and a valid D3D texture exists - // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT - //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) { - if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) { - // Enable texturing - _GLD_DX8_DEV(SetTexture(gld->pDev, unit, pTex)); - } else { - // Disable texturing, then return - _GLD_DX8_DEV(SetTexture(gld->pDev, unit, NULL)); - if (bPassThrough) { - _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE); - _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE); - } else { - _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE); - _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE); - } - return; - } - - // Texture parameters - _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter)); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter)); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter))); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS))); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT))); - - // Texture priority - _GLD_DX8_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f))); - - // Texture environment - // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops. - // See Page 355 of the Red Book. - BaseFormat = _gldDecodeBaseFormat(pTex); - - switch (BaseFormat) { - case GL_RGB: - iTexEnv = 0; - break; - case GL_RGBA: - iTexEnv = 1; - break; - case GL_ALPHA: - iTexEnv = 2; - break; - } - - switch (pUnit->EnvMode) { - case GL_DECAL: - iTexEnv += 0; - break; - case GL_REPLACE: - iTexEnv += 3; - break; - case GL_MODULATE: - iTexEnv += 6; - break; - case GL_BLEND: - // Set blend colour - dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]); - _GLD_DX8_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0)); - iTexEnv += 9; - break; - case GL_ADD: - iTexEnv += 12; - break; - } - pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv]; - _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2); - _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_TEXTURE_DX8( - GLcontext *ctx) -{ - // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units - - BOOL bUnit0Enabled; - BOOL bUnit1Enabled; - - if (!ctx) - return; // Sanity check - - if (ctx->Const.MaxTextureUnits == 1) { - gldUpdateTextureUnit(ctx, 0, TRUE); - return; - } - - // - // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!! - // - - // Mesa 5: Texture Units altered - //bUnit0Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) ? TRUE : FALSE; - //bUnit1Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D)) ? TRUE : FALSE; - bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE; - bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE; - - // If Unit0 is disabled and Unit1 is enabled then we must pass-though - gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE); - // We can always disable the last texture unit - gldUpdateTextureUnit(ctx, 1, FALSE); - -#ifdef _DEBUG - { - // Find out whether device supports current renderstates - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); -// GLD_context *gld = GLD_GET_CONTEXT(ctx); - - DWORD dwPasses; - _GLD_DX8_DEV(ValidateDevice(gld->pDev, &dwPasses)); -// if (FAILED(hr)) { -// gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr); -// } - if (dwPasses != 1) { - gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n"); - } - } -#endif -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c deleted file mode 100644 index cafbf4f5c..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c +++ /dev/null @@ -1,249 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect fastpath pipeline stage -* -****************************************************************************/ - -//--------------------------------------------------------------------------- - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx8.h" - -//--------------------------------------------------------------------------- - -#include "glheader.h" -#include "context.h" -#include "macros.h" -// #include "mem.h" -#include "mtypes.h" -//#include "mmath.h" - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "tnl/t_pipeline.h" - -//--------------------------------------------------------------------------- - -__inline void _gldSetVertexShaderConstants( - GLcontext *ctx, - GLD_driver_dx8 *gld) -{ - D3DXMATRIX mat, matView, matProj; - GLfloat *pM; - - // Mesa 5: Altered to a Stack - //pM = ctx->ModelView.m; - pM = ctx->ModelviewMatrixStack.Top->m; - matView._11 = pM[0]; - matView._12 = pM[1]; - matView._13 = pM[2]; - matView._14 = pM[3]; - matView._21 = pM[4]; - matView._22 = pM[5]; - matView._23 = pM[6]; - matView._24 = pM[7]; - matView._31 = pM[8]; - matView._32 = pM[9]; - matView._33 = pM[10]; - matView._34 = pM[11]; - matView._41 = pM[12]; - matView._42 = pM[13]; - matView._43 = pM[14]; - matView._44 = pM[15]; - - // Mesa 5: Altered to a Stack - //pM = ctx->ProjectionMatrix.m; - pM = ctx->ProjectionMatrixStack.Top->m; - matProj._11 = pM[0]; - matProj._12 = pM[1]; - matProj._13 = pM[2]; - matProj._14 = pM[3]; - matProj._21 = pM[4]; - matProj._22 = pM[5]; - matProj._23 = pM[6]; - matProj._24 = pM[7]; - matProj._31 = pM[8]; - matProj._32 = pM[9]; - matProj._33 = pM[10]; - matProj._34 = pM[11]; - matProj._41 = pM[12]; - matProj._42 = pM[13]; - matProj._43 = pM[14]; - matProj._44 = pM[15]; - - D3DXMatrixMultiply( &mat, &matView, &matProj ); - D3DXMatrixTranspose( &mat, &mat ); - - _GLD_DX8_DEV(SetVertexShaderConstant(gld->pDev, 0, &mat, 4)); -} - -//--------------------------------------------------------------------------- - -static GLboolean gld_d3d_render_stage_run( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - TNLcontext *tnl; - struct vertex_buffer *VB; - tnl_render_func *tab; - GLint pass; - GLD_pb_dx8 *gldPB = &gld->PB3d; -/* - static int count = 0; - count++; - if (count != 2) - return GL_FALSE; -*/ - // The "check" function should disable this stage, - // but we'll test gld->bUseMesaTnL anyway. - if (gld->bUseMesaTnL) { - // Do nothing in this stage, but continue pipeline - return GL_TRUE; - } - - tnl = TNL_CONTEXT(ctx); - VB = &tnl->vb; - pass = 0; - - tnl->Driver.Render.Start( ctx ); - -#if 0 - // For debugging: Useful to see if an app passes colour data in - // an unusual format. - switch (VB->ColorPtr[0]->Type) { - case GL_FLOAT: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); - break; - case GL_UNSIGNED_BYTE: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n"); - break; - default: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n"); - break; - } -#endif - - tnl->Driver.Render.Points = gld_Points3D_DX8; - if (ctx->_TriangleCaps & DD_FLATSHADE) { - tnl->Driver.Render.Line = gld_Line3DFlat_DX8; - tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX8; - tnl->Driver.Render.Quad = gld_Quad3DFlat_DX8; - } else { - tnl->Driver.Render.Line = gld_Line3DSmooth_DX8; - tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX8; - tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX8; - } - - _GLD_DX8_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD)); - gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0; - // Allocate primitive pointers - // gldPB->pPoints is always first - gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine); - gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts); - - do { - GLuint i, length, flags = 0; - for (i = 0 ; !(flags & PRIM_END) ; i += length) - { - flags = VB->Primitive[i].mode; - length= VB->Primitive[i].count; - ASSERT(length || (flags & PRIM_END)); - ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); - if (length) - tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - _GLD_DX8_VB(Unlock(gldPB->pVB)); - - _GLD_DX8_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride)); - - _GLD_DX8_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection)); - _GLD_DX8_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView)); - - if (gldPB->nPoints) { - _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints)); - gldPB->nPoints = 0; - } - - if (gldPB->nLines) { - _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines)); - gldPB->nLines = 0; - } - - if (gldPB->nTriangles) { - _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles)); - gldPB->nTriangles = 0; - } - - return GL_FALSE; /* finished the pipe */ -} - -//--------------------------------------------------------------------------- - -const struct tnl_pipeline_stage _gld_d3d_render_stage = -{ - "gld_d3d_render_stage", - NULL, - NULL, - NULL, - NULL, - gld_d3d_render_stage_run /* run */ -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c deleted file mode 100644 index 9ab562010..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c +++ /dev/null @@ -1,448 +0,0 @@ - -/* - * 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. - * - * Authors: - * Keith Whitwell - */ - - -/* - * Render whole vertex buffers, including projection of vertices from - * clip space and clipping of primitives. - * - * This file makes calls to project vertices and to the point, line - * and triangle rasterizers via the function pointers: - * - * context->Driver.Render.* - * - */ - - -//--------------------------------------------------------------------------- - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx8.h" - -//--------------------------------------------------------------------------- - -#include "glheader.h" -#include "context.h" -#include "macros.h" -// #include "mem.h" -#include "mtypes.h" -//#include "mmath.h" - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "tnl/t_pipeline.h" - -/**********************************************************************/ -/* Clip single primitives */ -/**********************************************************************/ - - -#if defined(USE_IEEE) -#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31)) -//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31)) -#else -#define NEGATIVE(x) (x < 0) -//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0) -/* Could just use (x*y<0) except for the flatshading requirements. - * Maybe there's a better way? - */ -#endif - - -#define W(i) coord[i][3] -#define Z(i) coord[i][2] -#define Y(i) coord[i][1] -#define X(i) coord[i][0] -#define SIZE 4 -#define TAG(x) x##_4 -#include "tnl/t_vb_cliptmp.h" - - - -/**********************************************************************/ -/* Clip and render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, with the possibility of clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte ormask = c1|c2; \ - if (!ormask) \ - LineFunc( ctx, v1, v2 ); \ - else if (!(c1 & c2 & 0x3f)) \ - clip_line_4( ctx, v1, v2, ormask ); \ -} while (0) - -#define RENDER_TRI( v1, v2, v3 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \ - GLubyte ormask = c1|c2|c3; \ - if (!ormask) \ - TriangleFunc( ctx, v1, v2, v3 ); \ - else if (!(c1 & c2 & c3 & 0x3f)) \ - clip_tri_4( ctx, v1, v2, v3, ormask ); \ -} while (0) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte c3 = mask[v3], c4 = mask[v4]; \ - GLubyte ormask = c1|c2|c3|c4; \ - if (!ormask) \ - QuadFunc( ctx, v1, v2, v3, v4 ); \ - else if (!(c1 & c2 & c3 & c4 & 0x3f)) \ - clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \ -} while (0) - - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const GLubyte *mask = VB->ClipMask; \ - const GLuint sz = VB->ClipPtr->size; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; (void) mask; (void) sz; (void) stipple; - -#define TAG(x) clip_##x##_verts -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx ) -#define PRESERVE_VB_DEFS -#include "tnl/t_vb_rendertmp.h" - - - -/* Elts, with the possibility of clipping. - */ -#undef ELT -#undef TAG -#define ELT(x) elt[x] -#define TAG(x) clip_##x##_elts -#include "tnl/t_vb_rendertmp.h" - -/* TODO: do this for all primitives, verts and elts: - */ -static void clip_elt_triangles( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES]; - struct vertex_buffer *VB = &tnl->vb; - const GLuint * const elt = VB->Elts; - GLubyte *mask = VB->ClipMask; - GLuint last = count-2; - GLuint j; - (void) flags; - - tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES ); - - for (j=start; j < last; j+=3 ) { - GLubyte c1 = mask[elt[j]]; - GLubyte c2 = mask[elt[j+1]]; - GLubyte c3 = mask[elt[j+2]]; - GLubyte ormask = c1|c2|c3; - if (ormask) { - if (start < j) - render_tris( ctx, start, j, 0 ); - if (!(c1&c2&c3&0x3f)) - clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask ); - start = j+3; - } - } - - if (start < j) - render_tris( ctx, start, j, 0 ); -} - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, no clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ - LineFunc( ctx, v1, v2 ) - -#define RENDER_TRI( v1, v2, v3 ) \ - TriangleFunc( ctx, v1, v2, v3 ) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ - QuadFunc( ctx, v1, v2, v3, v4 ) - -#define TAG(x) _gld_tnl_##x##_verts - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; - -#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx ) -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RENDER_TAB_QUALIFIER -#define PRESERVE_VB_DEFS -#include "tnl/t_vb_rendertmp.h" - - -/* Elts, no clipping. - */ -#undef ELT -#define TAG(x) _gld_tnl_##x##_elts -#define ELT(x) elt[x] -#include "tnl/t_vb_rendertmp.h" - - -/**********************************************************************/ -/* Helper functions for drivers */ -/**********************************************************************/ -/* -void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint *tmp = VB->Elts; - - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; -} - -void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} -*/ - - -/**********************************************************************/ -/* Clip and render whole vertex buffers */ -/**********************************************************************/ - -tnl_points_func _gldSetupPoints[4] = { - gld_Points2D_DX8, - gld_Points2D_DX8, - gld_Points2D_DX8, - gld_Points2D_DX8 -}; -tnl_line_func _gldSetupLine[4] = { - gld_Line2DFlat_DX8, - gld_Line2DSmooth_DX8, - gld_Line2DFlat_DX8, - gld_Line2DSmooth_DX8, -}; -tnl_triangle_func _gldSetupTriangle[4] = { - gld_Triangle2DFlat_DX8, - gld_Triangle2DSmooth_DX8, - gld_Triangle2DFlatExtras_DX8, - gld_Triangle2DSmoothExtras_DX8 -}; -tnl_quad_func _gldSetupQuad[4] = { - gld_Quad2DFlat_DX8, - gld_Quad2DSmooth_DX8, - gld_Quad2DFlatExtras_DX8, - gld_Quad2DSmoothExtras_DX8 -}; - -//--------------------------------------------------------------------------- - -static GLboolean _gld_mesa_render_stage_run( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx); - - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_render_func *tab; - GLint pass = 0; - GLD_pb_dx8 *gldPB; - - /* Allow the drivers to lock before projected verts are built so - * that window coordinates are guarenteed not to change before - * rendering. - */ - ASSERT(tnl->Driver.Render.Start); - - tnl->Driver.Render.Start( ctx ); - - // NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets - // stream, indices and shader to default values of NULL or 0. -/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) && - gld->VStwosidelight.hShader && - !ctx->Fog.Enabled) - { - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware); - _GLD_DX8_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader)); - gldPB = &gld->PBtwosidelight; - tnl->Driver.Render.Points = gld_Points2DTwoside_DX8; - if (ctx->_TriangleCaps & DD_FLATSHADE) { - tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX8; - tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX8; - tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX8; - } else { - tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX8; - tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX8; - tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX8; - } - } else {*/ - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE); - gldPB = &gld->PB2d; - _GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); - tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc]; - tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc]; - tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc]; - tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc]; -// } - - _GLD_DX8_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD)); - gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0; - // Allocate primitive pointers - // gldPB->pPoints is always first - gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine); - gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 ); - - if (VB->ClipOrMask) { - tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts; - clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles; - } - else { - tab = (VB->Elts ? - tnl->Driver.Render.PrimTabElts : - tnl->Driver.Render.PrimTabVerts); - } - - do { - GLuint i, length, flags = 0; - for (i = 0 ; !(flags & PRIM_END) ; i += length) { - flags = VB->Primitive[i].mode; - length= VB->Primitive[i].count; - ASSERT(length || (flags & PRIM_END)); - ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); - if (length) - tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - -// tnl->Driver.Render.Finish( ctx ); - - _GLD_DX8_VB(Unlock(gldPB->pVB)); - - _GLD_DX8_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride)); - - if (gldPB->nPoints) { - _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints)); - gldPB->nPoints = 0; - } - - if (gldPB->nLines) { - _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines)); - gldPB->nLines = 0; - } - - if (gldPB->nTriangles) { - _GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles)); - gldPB->nTriangles = 0; - } - - return GL_FALSE; /* finished the pipe */ -} - - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - - - -//--------------------------------------------------------------------------- - -const struct tnl_pipeline_stage _gld_mesa_render_stage = -{ - "gld_mesa_render_stage", - NULL, - NULL, - NULL, - NULL, - _gld_mesa_render_stage_run /* run */ -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c b/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c deleted file mode 100644 index 011d810e9..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c +++ /dev/null @@ -1,1336 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect Direct3D 8.x WGL (WindowsGL) -* -****************************************************************************/ - -#include "dglcontext.h" -#include "gld_driver.h" -#include "gld_dxerr8.h" -#include "gld_dx8.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" - -// Copied from dglcontect.c -#define GLDERR_NONE 0 -#define GLDERR_MEM 1 -#define GLDERR_DDRAW 2 -#define GLDERR_D3D 3 -#define GLDERR_BPP 4 -#define GLDERR_DDS 5 -// This external var keeps track of any error -extern int nContextError; - -#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL - -extern void _gld_mesa_warning(GLcontext *, char *); -extern void _gld_mesa_fatal(GLcontext *, char *); - -//--------------------------------------------------------------------------- - -static char szColorDepthWarning[] = -"GLDirect does not support the current desktop\n\ -color depth.\n\n\ -You may need to change the display resolution to\n\ -16 bits per pixel or higher color depth using\n\ -the Windows Display Settings control panel\n\ -before running this OpenGL application.\n"; - -// The only depth-stencil formats currently supported by Direct3D -// Surface Format Depth Stencil Total Bits -// D3DFMT_D32 32 - 32 -// D3DFMT_D15S1 15 1 16 -// D3DFMT_D24S8 24 8 32 -// D3DFMT_D16 16 - 16 -// D3DFMT_D24X8 24 - 32 -// D3DFMT_D24X4S4 24 4 32 - -// This pixel format will be used as a template when compiling the list -// of pixel formats supported by the hardware. Many fields will be -// filled in at runtime. -// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM -static DGL_pixelFormat pfTemplateHW = -{ - { - sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure - 1, // Structure version - should be 1 - // Flags: - PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface. - PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM) - PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM) - PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing. - PFD_DOUBLEBUFFER | // The buffer is double-buffered. - 0, // Placeholder for easy commenting of above flags - PFD_TYPE_RGBA, // Pixel type RGBA. - 16, // Total colour bitplanes (excluding alpha bitplanes) - 5, 0, // Red bits, shift - 5, 0, // Green bits, shift - 5, 0, // Blue bits, shift - 0, 0, // Alpha bits, shift (destination alpha) - 0, // Accumulator bits (total) - 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha - 0, // Depth bits - 0, // Stencil bits - 0, // Number of auxiliary buffers - 0, // Layer type - 0, // Specifies the number of overlay and underlay planes. - 0, // Layer mask - 0, // Specifies the transparent color or index of an underlay plane. - 0 // Damage mask - }, - D3DFMT_UNKNOWN, // No depth/stencil buffer -}; - -//--------------------------------------------------------------------------- -// Vertex Shaders -//--------------------------------------------------------------------------- - -// Vertex Shader Declaration -static DWORD dwTwoSidedLightingDecl[] = -{ - D3DVSD_STREAM(0), - D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position - D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal - D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color - D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color - D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0 - D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1 - D3DVSD_END() -}; - -// Vertex Shader for two-sided lighting -static char *szTwoSidedLightingVS = -// This is a test shader! -"vs.1.0\n" -"m4x4 oPos,v0,c0\n" -"mov oD0,v2\n" -"mov oD1,v3\n" -"mov oT0,v4\n" -"mov oT1,v5\n" -; - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -typedef struct { - HINSTANCE hD3D8DLL; // Handle to d3d8.dll - FNDIRECT3DCREATE8 fnDirect3DCreate8; // Direct3DCreate8 function prototype - BOOL bDirect3D; // Persistant Direct3D8 exists - BOOL bDirect3DDevice; // Persistant Direct3DDevice8 exists - IDirect3D8 *pD3D; // Persistant Direct3D8 - IDirect3DDevice8 *pDev; // Persistant Direct3DDevice8 -} GLD_dx8_globals; - -// These are "global" to all DX8 contexts. KeithH -static GLD_dx8_globals dx8Globals; - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -BOOL gldGetDXErrorString_DX( - HRESULT hr, - char *buf, - int nBufSize) -{ - // - // Return a string describing the input HRESULT error code - // - - D3DXGetErrorString(hr, buf, nBufSize); - return TRUE; -} - -//--------------------------------------------------------------------------- - -static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType( - IDirect3D8 *pD3D8, - D3DFORMAT SurfaceFormat, - D3DDEVTYPE d3dDevType, - BOOL Windowed) -{ - int i; - HRESULT hr; - - if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE) - return D3DMULTISAMPLE_NONE; - - if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) { - // Find fastest multisample - for (i=2; i<17; i++) { - hr = IDirect3D8_CheckDeviceMultiSampleType( - pD3D8, - glb.dwAdapter, - d3dDevType, - SurfaceFormat, - Windowed, - (D3DMULTISAMPLE_TYPE)i); - if (SUCCEEDED(hr)) { - return (D3DMULTISAMPLE_TYPE)i; - } - } - } else { - // Find nicest multisample - for (i=16; i>1; i--) { - hr = IDirect3D8_CheckDeviceMultiSampleType( - pD3D8, - glb.dwAdapter, - d3dDevType, - SurfaceFormat, - Windowed, - (D3DMULTISAMPLE_TYPE)i); - if (SUCCEEDED(hr)) { - return (D3DMULTISAMPLE_TYPE)i; - } - } - } - - // Nothing found - return default - return D3DMULTISAMPLE_NONE; -} - -//--------------------------------------------------------------------------- - -void _gldDestroyPrimitiveBuffer( - GLD_pb_dx8 *gldVB) -{ - SAFE_RELEASE(gldVB->pVB); - - // Sanity check... - gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0; -} - -//--------------------------------------------------------------------------- - -HRESULT _gldCreatePrimitiveBuffer( - GLcontext *ctx, - GLD_driver_dx8 *lpCtx, - GLD_pb_dx8 *gldVB) -{ - HRESULT hResult; - char *szCreateVertexBufferFailed = "CreateVertexBuffer failed"; - DWORD dwMaxVertices; // Max number of vertices in vertex buffer - DWORD dwVBSize; // Total size of vertex buffer - - // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we - // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize. - // We'll use IMM_SIZE if it's larger (which it should not be). - dwMaxVertices = MAX_ARRAY_LOCK_SIZE; - - // Now calculate how many vertices to allow for in total - // 1 per point, 2 per line, 6 per quad = 9 - dwVBSize = dwMaxVertices * 9 * gldVB->dwStride; - - hResult = IDirect3DDevice8_CreateVertexBuffer( - lpCtx->pDev, - dwVBSize, - gldVB->dwUsage, - gldVB->dwFVF, - gldVB->dwPool, - &gldVB->pVB); - if (FAILED(hResult)) { - ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed); - return hResult; - } - - gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0; - gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL; - gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB - gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB - - return S_OK; -} - -//--------------------------------------------------------------------------- -// Function: _gldCreateVertexShaders -// Create DX8 Vertex Shaders. -//--------------------------------------------------------------------------- -/* -void _gldCreateVertexShaders( - GLD_driver_dx8 *gld) -{ - DWORD dwFlags; - LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer - HRESULT hr; - -#ifdef _DEBUG - dwFlags = D3DXASM_DEBUG; -#else - dwFlags = 0; // D3DXASM_SKIPVALIDATION; -#endif - - ddlogMessage(DDLOG_INFO, "Creating shaders...\n"); - - // Init the shader handle - gld->VStwosidelight.hShader = 0; - - if (gld->d3dCaps8.MaxStreams == 0) { - // Lame DX8 driver doesn't support streams - // Not fatal, as defaults will be used - ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n"); - return; - } - - // ** THIS DISABLES VERTEX SHADER SUPPORT ** -// return; - // ** THIS DISABLES VERTEX SHADER SUPPORT ** - - // - // Two-sided lighting - // - -#if 0 - // - // DEBUGGING: Load shader from a text file - // - { - LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer - hr = D3DXAssembleShaderFromFile( - "twoside.vsh", - dwFlags, - NULL, // No constants - &pVSOpcodeBuffer, - &pVSErrorBuffer); - if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)) - ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)); - SAFE_RELEASE(pVSErrorBuffer); - } -#else - { - LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer - // Assemble ascii shader text into shader opcodes - hr = D3DXAssembleShader( - szTwoSidedLightingVS, - strlen(szTwoSidedLightingVS), - dwFlags, - NULL, // No constants - &pVSOpcodeBuffer, - &pVSErrorBuffer); - if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)) - ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)); - SAFE_RELEASE(pVSErrorBuffer); - } -#endif - if (FAILED(hr)) { - ddlogError(DDLOG_WARN, "AssembleShader failed", hr); - SAFE_RELEASE(pVSOpcodeBuffer); - return; - } - -// This is for debugging. Remove to enable vertex shaders in HW -#define _GLD_FORCE_SW_VS 0 - - if (_GLD_FORCE_SW_VS) { - // _GLD_FORCE_SW_VS should be disabled for Final Release - ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n"); - } - - // Try and create shader in hardware. - // NOTE: The D3D Ref device appears to succeed when trying to - // create the device in hardware, but later complains - // when trying to set it with SetVertexShader(). Go figure. - if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) { - // Don't try and create a hardware shader with the Ref device - hr = E_FAIL; // COM error/fail result - } else { - gld->VStwosidelight.bHardware = TRUE; - hr = IDirect3DDevice8_CreateVertexShader( - gld->pDev, - dwTwoSidedLightingDecl, - pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer), - &gld->VStwosidelight.hShader, - 0); - } - if (FAILED(hr)) { - ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n"); - // Failed. Try and create shader for software processing - hr = IDirect3DDevice8_CreateVertexShader( - gld->pDev, - dwTwoSidedLightingDecl, - pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer), - &gld->VStwosidelight.hShader, - D3DUSAGE_SOFTWAREPROCESSING); - if (FAILED(hr)) { - gld->VStwosidelight.hShader = 0; // Sanity check - ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr); - return; - } - // Succeeded, but for software processing - gld->VStwosidelight.bHardware = FALSE; - } - - SAFE_RELEASE(pVSOpcodeBuffer); - - ddlogMessage(DDLOG_INFO, "... OK\n"); -} - -//--------------------------------------------------------------------------- - -void _gldDestroyVertexShaders( - GLD_driver_dx8 *gld) -{ - if (gld->VStwosidelight.hShader) { - IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader); - gld->VStwosidelight.hShader = 0; - } -} -*/ -//--------------------------------------------------------------------------- - -LPVOID lpOpaque1 = NULL; -LPVOID lpOpaque2 = NULL; - -BOOL gldCreateDrawable_DX( - DGL_ctx *ctx, -// BOOL bDefaultDriver, - BOOL bDirectDrawPersistant, - BOOL bPersistantBuffers) -{ - // - // bDirectDrawPersistant: applies to IDirect3D8 - // bPersistantBuffers: applies to IDirect3DDevice8 - // - - HRESULT hResult; - GLD_driver_dx8 *lpCtx = NULL; - D3DDEVTYPE d3dDevType; - D3DPRESENT_PARAMETERS d3dpp; - D3DDISPLAYMODE d3ddm; - DWORD dwBehaviourFlags; - D3DADAPTER_IDENTIFIER8 d3dIdent; - - // Error if context is NULL. - if (ctx == NULL) - return FALSE; - - if (ctx->glPriv) { - lpCtx = ctx->glPriv; - // Release any existing interfaces - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - } else { - lpCtx = (GLD_driver_dx8*)malloc(sizeof(GLD_driver_dx8)); - ZeroMemory(lpCtx, sizeof(lpCtx)); - } - - d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; - // TODO: Check this -// if (bDefaultDriver) -// d3dDevType = D3DDEVTYPE_REF; - - // Use persistant interface if needed - if (bDirectDrawPersistant && dx8Globals.bDirect3D) { - lpCtx->pD3D = dx8Globals.pD3D; - IDirect3D8_AddRef(lpCtx->pD3D); - goto SkipDirectDrawCreate; - } - - // Create Direct3D8 object - lpCtx->pD3D = dx8Globals.fnDirect3DCreate8(D3D_SDK_VERSION_DX8_SUPPORT_WIN95); - if (lpCtx->pD3D == NULL) { - MessageBox(NULL, "Unable to initialize Direct3D8", "GLDirect", MB_OK); - ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D8 interface"); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Cache Direct3D interface for subsequent GLRCs - if (bDirectDrawPersistant && !dx8Globals.bDirect3D) { - dx8Globals.pD3D = lpCtx->pD3D; - IDirect3D8_AddRef(dx8Globals.pD3D); - dx8Globals.bDirect3D = TRUE; - } -SkipDirectDrawCreate: - - // Get the display mode so we can make a compatible backbuffer - hResult = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hResult)) { - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Get device caps - hResult = IDirect3D8_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps8); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_GetDeviceCaps failed", hResult); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Check for hardware transform & lighting - lpCtx->bHasHWTnL = lpCtx->d3dCaps8.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE; - - // If this flag is present then we can't default to Mesa - // SW rendering between BeginScene() and EndScene(). - if (lpCtx->d3dCaps8.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) { - ddlogMessage(DDLOG_WARN, - "Warning : No 2D allowed during 3D scene.\n"); - } - - // - // Create the Direct3D context - // - - // Re-use original IDirect3DDevice if persistant buffers exist. - // Note that we test for persistant IDirect3D8 as well - // bDirectDrawPersistant == persistant IDirect3D8 (DirectDraw8 does not exist) - if (bDirectDrawPersistant && bPersistantBuffers && dx8Globals.pD3D && dx8Globals.pDev) { - lpCtx->pDev = dx8Globals.pDev; - IDirect3DDevice8_AddRef(dx8Globals.pDev); - goto skip_direct3ddevice_create; - } - - // Clear the presentation parameters (sets all members to zero) - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Recommended by MS; needed for MultiSample. - // Be careful if altering this for FullScreenBlit - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - d3dpp.BackBufferFormat = d3ddm.Format; - d3dpp.BackBufferCount = 1; - d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen); - d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData; - d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE; - - if (ctx->bFullscreen) { - ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen - d3dpp.Windowed = FALSE; - d3dpp.BackBufferWidth = d3ddm.Width; - d3dpp.BackBufferHeight = d3ddm.Height; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - - // Support for vertical retrace synchronisation. - // Set default presentation interval in case caps bits are missing - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - if (glb.bWaitForRetrace) { - if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE; - } else { - if (lpCtx->d3dCaps8.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - } - } else { - ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages - d3dpp.Windowed = TRUE; - d3dpp.BackBufferWidth = ctx->dwWidth; - d3dpp.BackBufferHeight = ctx->dwHeight; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = 0; - // FullScreen_PresentationInterval must be default for Windowed mode - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } - - // Decide if we can use hardware TnL - dwBehaviourFlags = (lpCtx->bHasHWTnL) ? - D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING; - // Add flag to tell D3D to be thread-safe - if (glb.bMultiThreaded) - dwBehaviourFlags |= D3DCREATE_MULTITHREADED; - // Add flag to tell D3D to be FPU-safe - if (!glb.bFastFPU) - dwBehaviourFlags |= D3DCREATE_FPU_PRESERVE; - hResult = IDirect3D8_CreateDevice(lpCtx->pD3D, - glb.dwAdapter, - d3dDevType, - ctx->hWnd, - dwBehaviourFlags, - &d3dpp, - &lpCtx->pDev); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D8_CreateDevice failed", hResult); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - if (bDirectDrawPersistant && bPersistantBuffers && dx8Globals.pD3D) { - dx8Globals.pDev = lpCtx->pDev; - dx8Globals.bDirect3DDevice = TRUE; - } - -/* - // See if DDraw interfaces are available (DaveM) - hResult = IDirect3D8_QueryInterface(lpCtx->pDev, - &IID_IDirectDraw7, (LPVOID*)&lpOpaque1); - if (FAILED(hResult) || lpOpaque1 == NULL) { - ddlogMessage(DDLOG_INFO, "DirectDraw QueryInterface unavailable\n"); - } - - hResult = IDirect3DDevice8_QueryInterface(lpCtx->pDev, - &IID_IDirectDrawSurface7, (LPVOID*)&lpOpaque2); - if (FAILED(hResult) || lpOpaque2 == NULL) { - ddlogMessage(DDLOG_INFO, "DirectDrawSurface QueryInterface unavialable\n"); - } -*/ - // Dump some useful stats - hResult = IDirect3D8_GetAdapterIdentifier( - lpCtx->pD3D, - glb.dwAdapter, - D3DENUM_NO_WHQL_LEVEL, // Avoids 1 to 2 second delay - &d3dIdent); - if (SUCCEEDED(hResult)) { - ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description); - ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]", - d3dIdent.Driver, - HIWORD(d3dIdent.DriverVersion.HighPart), - LOWORD(d3dIdent.DriverVersion.HighPart), - HIWORD(d3dIdent.DriverVersion.LowPart), - LOWORD(d3dIdent.DriverVersion.LowPart)); - ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]", - d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision); - } - - // Init projection matrix for D3D TnL - D3DXMatrixIdentity(&lpCtx->matProjection); - lpCtx->matModelView = lpCtx->matProjection; -// gld->bUseMesaProjection = TRUE; - -skip_direct3ddevice_create: - - // Create buffers to hold primitives - lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX; - lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM; - lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX); - lpCtx->PB2d.dwUsage = D3DUSAGE_DONOTCLIP | - D3DUSAGE_DYNAMIC | - D3DUSAGE_SOFTWAREPROCESSING | - D3DUSAGE_WRITEONLY; - hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d); - if (FAILED(hResult)) - goto return_with_error; - - lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX; - lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT; - lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX); - lpCtx->PB3d.dwUsage = D3DUSAGE_DYNAMIC | - D3DUSAGE_SOFTWAREPROCESSING | - D3DUSAGE_WRITEONLY; - hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d); - if (FAILED(hResult)) - goto return_with_error; - -/* // NOTE: A FVF code of zero indicates a non-FVF vertex buffer (for vertex shaders) - lpCtx->PBtwosidelight.dwFVF = 0; //GLD_FVF_TWOSIDED_VERTEX; - lpCtx->PBtwosidelight.dwPool = D3DPOOL_DEFAULT; - lpCtx->PBtwosidelight.dwStride = sizeof(GLD_TWOSIDED_VERTEX); - lpCtx->PBtwosidelight.dwUsage = D3DUSAGE_DONOTCLIP | - D3DUSAGE_DYNAMIC | - D3DUSAGE_SOFTWAREPROCESSING | - D3DUSAGE_WRITEONLY; - hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PBtwosidelight); - if (FAILED(hResult)) - goto return_with_error;*/ - - // Now try and create the DX8 Vertex Shaders -// _gldCreateVertexShaders(lpCtx); - - // Zero the pipeline usage counters - lpCtx->PipelineUsage.qwMesa.QuadPart = -// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart = - lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0; - - // Assign drawable to GL private - ctx->glPriv = lpCtx; - return TRUE; - -return_with_error: - // Clean up and bail - -// _gldDestroyVertexShaders(lpCtx); - -// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight); - _gldDestroyPrimitiveBuffer(&lpCtx->PB3d); - _gldDestroyPrimitiveBuffer(&lpCtx->PB2d); - - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - return FALSE; -} - -//--------------------------------------------------------------------------- - -BOOL gldResizeDrawable_DX( - DGL_ctx *ctx, - BOOL bDefaultDriver, - BOOL bPersistantInterface, - BOOL bPersistantBuffers) -{ - GLD_driver_dx8 *gld = NULL; - D3DDEVTYPE d3dDevType; - D3DPRESENT_PARAMETERS d3dpp; - D3DDISPLAYMODE d3ddm; - HRESULT hResult; - - // Error if context is NULL. - if (ctx == NULL) - return FALSE; - - gld = ctx->glPriv; - if (gld == NULL) - return FALSE; - - if (ctx->bSceneStarted) { - IDirect3DDevice8_EndScene(gld->pDev); - ctx->bSceneStarted = FALSE; - } - - d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; - if (!bDefaultDriver) - d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software) - - // Get the display mode so we can make a compatible backbuffer - hResult = IDirect3D8_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hResult)) { - nContextError = GLDERR_D3D; -// goto return_with_error; - return FALSE; - } - - // Destroy DX8 Vertex Shaders before Reset() -// _gldDestroyVertexShaders(gld); - - // Release POOL_DEFAULT objects before Reset() - if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) - _gldDestroyPrimitiveBuffer(&gld->PB2d); - if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) - _gldDestroyPrimitiveBuffer(&gld->PB3d); -// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) -// _gldDestroyPrimitiveBuffer(&gld->PBtwosidelight); - - // Clear the presentation parameters (sets all members to zero) - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Recommended by MS; needed for MultiSample. - // Be careful if altering this for FullScreenBlit - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - d3dpp.BackBufferFormat = d3ddm.Format; - d3dpp.BackBufferCount = 1; - d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen); - d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData; - d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE; - - // TODO: Sync to refresh - - if (ctx->bFullscreen) { - ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen - d3dpp.Windowed = FALSE; - d3dpp.BackBufferWidth = d3ddm.Width; - d3dpp.BackBufferHeight = d3ddm.Height; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - // Get better benchmark results? KeithH -// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED; - } else { - ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages - d3dpp.Windowed = TRUE; - d3dpp.BackBufferWidth = ctx->dwWidth; - d3dpp.BackBufferHeight = ctx->dwHeight; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = 0; - d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } - hResult = IDirect3DDevice8_Reset(gld->pDev, &d3dpp); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult); - return FALSE; - //goto cleanup_and_return_with_error; - } - - // Explicitly Clear resized surfaces (DaveM) - { - D3DVIEWPORT8 d3dvp1, d3dvp2; - IDirect3DDevice8_GetViewport(gld->pDev, &d3dvp1); - IDirect3DDevice8_GetViewport(gld->pDev, &d3dvp2); - d3dvp1.X = 0; - d3dvp1.Y = 0; - d3dvp1.Width = ctx->dwWidth; - d3dvp1.Height = ctx->dwHeight; - IDirect3DDevice8_SetViewport(gld->pDev, &d3dvp1); - IDirect3DDevice8_Clear(gld->pDev,0,NULL,D3DCLEAR_TARGET,0,0,0); - IDirect3DDevice8_SetViewport(gld->pDev, &d3dvp2); - } - - // - // Recreate POOL_DEFAULT objects - // - if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) { - _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d); - } - if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) { - _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d); - } -// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) { -// _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d); -// } - - // Recreate DX8 Vertex Shaders -// _gldCreateVertexShaders(gld); - - // Signal a complete state update - ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL); - - // Begin a new scene - IDirect3DDevice8_BeginScene(gld->pDev); - ctx->bSceneStarted = TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyDrawable_DX( - DGL_ctx *ctx) -{ - GLD_driver_dx8 *lpCtx = NULL; - - // Error if context is NULL. - if (!ctx) - return FALSE; - - // Error if the drawable does not exist. - if (!ctx->glPriv) - return FALSE; - - lpCtx = ctx->glPriv; - -#ifdef _DEBUG - // Dump out stats - ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X", - lpCtx->PipelineUsage.qwMesa.HighPart, - lpCtx->PipelineUsage.qwMesa.LowPart, - lpCtx->PipelineUsage.qwD3DFVF.HighPart, - lpCtx->PipelineUsage.qwD3DFVF.LowPart); -#endif - -// _gldDestroyVertexShaders(lpCtx); - -// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight); - _gldDestroyPrimitiveBuffer(&lpCtx->PB3d); - _gldDestroyPrimitiveBuffer(&lpCtx->PB2d); - - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - - // Free the private drawable data - free(ctx->glPriv); - ctx->glPriv = NULL; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldCreatePrivateGlobals_DX(void) -{ - ZeroMemory(&dx8Globals, sizeof(dx8Globals)); - - // Load d3d8.dll - dx8Globals.hD3D8DLL = LoadLibrary("D3D8.DLL"); - if (dx8Globals.hD3D8DLL == NULL) - return FALSE; - - // Now try and obtain Direct3DCreate8 - dx8Globals.fnDirect3DCreate8 = (FNDIRECT3DCREATE8)GetProcAddress(dx8Globals.hD3D8DLL, "Direct3DCreate8"); - if (dx8Globals.fnDirect3DCreate8 == NULL) { - FreeLibrary(dx8Globals.hD3D8DLL); - return FALSE; - } - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyPrivateGlobals_DX(void) -{ - if (dx8Globals.bDirect3DDevice) { - SAFE_RELEASE(dx8Globals.pDev); - dx8Globals.bDirect3DDevice = FALSE; - } - if (dx8Globals.bDirect3D) { - SAFE_RELEASE(dx8Globals.pD3D); - dx8Globals.bDirect3D = FALSE; - } - - FreeLibrary(dx8Globals.hD3D8DLL); - dx8Globals.hD3D8DLL = NULL; - dx8Globals.fnDirect3DCreate8 = NULL; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -static void _BitsFromDisplayFormat( - D3DFORMAT fmt, - BYTE *cColorBits, - BYTE *cRedBits, - BYTE *cGreenBits, - BYTE *cBlueBits, - BYTE *cAlphaBits) -{ - switch (fmt) { - case D3DFMT_X1R5G5B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 5; - *cBlueBits = 5; - *cAlphaBits = 0; - return; - case D3DFMT_R5G6B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 6; - *cBlueBits = 5; - *cAlphaBits = 0; - return; - case D3DFMT_X8R8G8B8: - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 0; - return; - case D3DFMT_A8R8G8B8: - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 8; - return; - } - - // Should not get here! - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 0; -} - -//--------------------------------------------------------------------------- - -static void _BitsFromDepthStencilFormat( - D3DFORMAT fmt, - BYTE *cDepthBits, - BYTE *cStencilBits) -{ - // NOTE: GL expects either 32 or 16 as depth bits. - switch (fmt) { - case D3DFMT_D32: - *cDepthBits = 32; - *cStencilBits = 0; - return; - case D3DFMT_D15S1: - *cDepthBits = 16; - *cStencilBits = 1; - return; - case D3DFMT_D24S8: - *cDepthBits = 32; - *cStencilBits = 8; - return; - case D3DFMT_D16: - *cDepthBits = 16; - *cStencilBits = 0; - return; - case D3DFMT_D24X8: - *cDepthBits = 32; - *cStencilBits = 0; - return; - case D3DFMT_D24X4S4: - *cDepthBits = 32; - *cStencilBits = 4; - return; - } -} - -//--------------------------------------------------------------------------- - -BOOL gldBuildPixelformatList_DX(void) -{ - D3DDISPLAYMODE d3ddm; - D3DFORMAT fmt[6]; - IDirect3D8 *pD3D = NULL; - HRESULT hr; - int nSupportedFormats = 0; - int i; - DGL_pixelFormat *pPF; - BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits; -// char buf[128]; -// char cat[8]; - - // Direct3D (SW or HW) - // These are arranged so that 'best' pixelformat - // is higher in the list (for ChoosePixelFormat). - const D3DFORMAT DepthStencil[6] = { - D3DFMT_D15S1, - D3DFMT_D16, - D3DFMT_D24X8, - D3DFMT_D24X4S4, - D3DFMT_D24S8, - D3DFMT_D32, - }; - - // Dump DX version - ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 8.0\n"); - - // Release any existing pixelformat list - if (glb.lpPF) { - free(glb.lpPF); - } - - glb.nPixelFormatCount = 0; - glb.lpPF = NULL; - - // - // Pixelformats for Direct3D (SW or HW) rendering - // - - // Get a Direct3D 8.0 interface - pD3D = dx8Globals.fnDirect3DCreate8(D3D_SDK_VERSION_DX8_SUPPORT_WIN95); - if (!pD3D) { - return FALSE; - } - - // We will use the display mode format when finding compliant - // rendertarget/depth-stencil surfaces. - hr = IDirect3D8_GetAdapterDisplayMode(pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hr)) { - IDirect3D8_Release(pD3D); - return FALSE; - } - - // Run through the possible formats and detect supported formats - for (i=0; i<6; i++) { - hr = IDirect3D8_CheckDeviceFormat( - pD3D, - glb.dwAdapter, - glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF, - d3ddm.Format, - D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, - DepthStencil[i]); - if (FAILED(hr)) - // A failure here is not fatal. - continue; - - // Verify that the depth format is compatible. - hr = IDirect3D8_CheckDepthStencilMatch( - pD3D, - glb.dwAdapter, - glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF, - d3ddm.Format, - d3ddm.Format, - DepthStencil[i]); - if (FAILED(hr)) - // A failure here is not fatal, just means depth-stencil - // format is not compatible with this display mode. - continue; - - fmt[nSupportedFormats++] = DepthStencil[i]; - } - - IDirect3D8_Release(pD3D); - - if (nSupportedFormats == 0) - return FALSE; // Bail: no compliant pixelformats - - // Total count of pixelformats is: - // (nSupportedFormats+1)*2 - glb.lpPF = (DGL_pixelFormat *)calloc((nSupportedFormats)*2, sizeof(DGL_pixelFormat)); - glb.nPixelFormatCount = (nSupportedFormats)*2; - if (glb.lpPF == NULL) { - glb.nPixelFormatCount = 0; - return FALSE; - } - - // Get a copy of pointer that we can alter - pPF = glb.lpPF; - - // Cache colour bits from display format - _BitsFromDisplayFormat(d3ddm.Format, &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits); - - // - // Add single-buffer formats - // - - // Single-buffer, no depth-stencil buffer -/* memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat)); - pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - pPF->pfd.cDepthBits = 0; - pPF->pfd.cStencilBits = 0; - pPF->dwDriverData = D3DFMT_UNKNOWN; - pPF++;*/ - - for (i=0; ipfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits); - pPF->dwDriverData = fmt[i]; - } - - // - // Add double-buffer formats - // - -/* memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat)); - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - pPF->pfd.cDepthBits = 0; - pPF->pfd.cStencilBits = 0; - pPF->dwDriverData = D3DFMT_UNKNOWN; - pPF++;*/ - - for (i=0; ipfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits); - pPF->dwDriverData = fmt[i]; - } - - // Popup warning message if non RGB color mode - { - // This is a hack. KeithH - HDC hdcDesktop = GetDC(NULL); - DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL); - ReleaseDC(0, hdcDesktop); - if (dwDisplayBitDepth <= 8) { - ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth); - MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING); - } - } - - // Mark list as 'current' - glb.bPixelformatsDirty = FALSE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldInitialiseMesa_DX( - DGL_ctx *lpCtx) -{ - GLD_driver_dx8 *gld = NULL; - int MaxTextureSize, TextureLevels; - BOOL bSoftwareTnL; - - if (lpCtx == NULL) - return FALSE; - - gld = lpCtx->glPriv; - if (gld == NULL) - return FALSE; - - if (glb.bMultitexture) { - lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps8.MaxSimultaneousTextures; - // Only support MAX_TEXTURE_UNITS texture units. - // ** If this is altered then the FVF formats must be reviewed **. - if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX8) - lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX8; - } else { - // Multitexture override - lpCtx->glCtx->Const.MaxTextureUnits = 1; - } - - // max texture size - MaxTextureSize = min(gld->d3dCaps8.MaxTextureHeight, gld->d3dCaps8.MaxTextureWidth); - if (MaxTextureSize == 0) - MaxTextureSize = 256; // Sanity check - - // - // HACK!! - if (MaxTextureSize > 1024) - MaxTextureSize = 1024; // HACK - CLAMP TO 1024 - // HACK!! - // - - // Got to set MAX_TEXTURE_SIZE as max levels. - // Who thought this stupid idea up? ;) - TextureLevels = 0; - // Calculate power-of-two. - while (MaxTextureSize) { - TextureLevels++; - MaxTextureSize >>= 1; - } - lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8; - lpCtx->glCtx->Const.MaxDrawBuffers = 1; - - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE); - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE); - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_DITHERENABLE, TRUE); - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SHADEMODE, D3DSHADE_GOURAUD); - - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_ZENABLE, - (lpCtx->lpPF->dwDriverData!=D3DFMT_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE); - - // Set the view matrix - { - D3DXMATRIX vm; -#if 1 - D3DXMatrixIdentity(&vm); -#else - D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f); - D3DXVECTOR3 At(0.0f, 0.0f, -1.0f); - D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f); - D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up); - vm._31 = -vm._31; - vm._32 = -vm._32; - vm._33 = -vm._33; - vm._34 = -vm._34; -#endif - IDirect3DDevice8_SetTransform(gld->pDev, D3DTS_VIEW, &vm); - } - - if (gld->bHasHWTnL) { - if (glb.dwTnL == GLDS_TNL_DEFAULT) - bSoftwareTnL = FALSE; // HW TnL - else { - bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE; - } - } else { - // No HW TnL, so no choice possible - bSoftwareTnL = TRUE; - } - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL); - -// Dump this in a Release build as well, now. -//#ifdef _DEBUG - ddlogPrintf(DDLOG_INFO, "HW TnL: %s", - gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable"); -//#endif - - gldEnableExtensions_DX8(lpCtx->glCtx); - gldInstallPipeline_DX8(lpCtx->glCtx); - gldSetupDriverPointers_DX8(lpCtx->glCtx); - - // Signal a complete state update - lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL); - - // Start a scene - IDirect3DDevice8_BeginScene(gld->pDev); - lpCtx->bSceneStarted = TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldSwapBuffers_DX( - DGL_ctx *ctx, - HDC hDC, - HWND hWnd) -{ - HRESULT hr; - GLD_driver_dx8 *gld = NULL; - - if (ctx == NULL) - return FALSE; - - gld = ctx->glPriv; - if (gld == NULL) - return FALSE; - - if (ctx->bSceneStarted) { - IDirect3DDevice8_EndScene(gld->pDev); - ctx->bSceneStarted = FALSE; - } - - // Swap the buffers. hWnd may override the hWnd used for CreateDevice() - hr = IDirect3DDevice8_Present(gld->pDev, NULL, NULL, hWnd, NULL); - - IDirect3DDevice8_BeginScene(gld->pDev); - ctx->bSceneStarted = TRUE; - - return (FAILED(hr)) ? FALSE : TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldGetDisplayMode_DX( - DGL_ctx *ctx, - GLD_displayMode *glddm) -{ - D3DDISPLAYMODE d3ddm; - HRESULT hr; - GLD_driver_dx8 *lpCtx = NULL; - BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits; - - if ((glddm == NULL) || (ctx == NULL)) - return FALSE; - - lpCtx = ctx->glPriv; - if (lpCtx == NULL) - return FALSE; - - if (lpCtx->pD3D == NULL) - return FALSE; - - hr = IDirect3D8_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hr)) - return FALSE; - - // Get info from the display format - _BitsFromDisplayFormat(d3ddm.Format, - &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits); - - glddm->Width = d3ddm.Width; - glddm->Height = d3ddm.Height; - glddm->BPP = cColorBits; - glddm->Refresh = d3ddm.RefreshRate; - - return TRUE; -} - -//--------------------------------------------------------------------------- - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c deleted file mode 100644 index c191564d6..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c +++ /dev/null @@ -1,1206 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Driver interface code to Mesa -* -****************************************************************************/ - -//#include -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx9.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -extern BOOL dglSwapBuffers(HDC hDC); - -// HACK: Hack the _33 member of the OpenGL perspective projection matrix -const float _fPersp_33 = 1.6f; - -//--------------------------------------------------------------------------- -// Internal functions -//--------------------------------------------------------------------------- - -void _gld_mesa_warning( - __GLcontext *gc, - char *str) -{ - // Intercept Mesa's internal warning mechanism - gldLogPrintf(GLDLOG_WARN, "Mesa warning: %s", str); -} - -//--------------------------------------------------------------------------- - -void _gld_mesa_fatal( - __GLcontext *gc, - char *str) -{ - // Intercept Mesa's internal fatal-message mechanism - gldLogPrintf(GLDLOG_CRITICAL, "Mesa FATAL: %s", str); - - // Mesa calls abort(0) here. - ddlogClose(); - exit(0); -} - -//--------------------------------------------------------------------------- - -D3DSTENCILOP _gldConvertStencilOp( - GLenum StencilOp) -{ - // Used by Stencil: pass, fail and zfail - - switch (StencilOp) { - case GL_KEEP: - return D3DSTENCILOP_KEEP; - case GL_ZERO: - return D3DSTENCILOP_ZERO; - case GL_REPLACE: - return D3DSTENCILOP_REPLACE; - case GL_INCR: - return D3DSTENCILOP_INCRSAT; - case GL_DECR: - return D3DSTENCILOP_DECRSAT; - case GL_INVERT: - return D3DSTENCILOP_INVERT; - case GL_INCR_WRAP_EXT: // GL_EXT_stencil_wrap - return D3DSTENCILOP_INCR; - case GL_DECR_WRAP_EXT: // GL_EXT_stencil_wrap - return D3DSTENCILOP_DECR; - } - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertStencilOp: Unknown StencilOp\n"); -#endif - - return D3DSTENCILOP_KEEP; -} - -//--------------------------------------------------------------------------- - -D3DCMPFUNC _gldConvertCompareFunc( - GLenum CmpFunc) -{ - // Used for Alpha func, depth func and stencil func. - - switch (CmpFunc) { - case GL_NEVER: - return D3DCMP_NEVER; - case GL_LESS: - return D3DCMP_LESS; - case GL_EQUAL: - return D3DCMP_EQUAL; - case GL_LEQUAL: - return D3DCMP_LESSEQUAL; - case GL_GREATER: - return D3DCMP_GREATER; - case GL_NOTEQUAL: - return D3DCMP_NOTEQUAL; - case GL_GEQUAL: - return D3DCMP_GREATEREQUAL; - case GL_ALWAYS: - return D3DCMP_ALWAYS; - }; - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertCompareFunc: Unknown CompareFunc\n"); -#endif - - return D3DCMP_ALWAYS; -} - -//--------------------------------------------------------------------------- - -D3DBLEND _gldConvertBlendFunc( - GLenum blend, - GLenum DefaultBlend) -{ - switch (blend) { - case GL_ZERO: - return D3DBLEND_ZERO; - case GL_ONE: - return D3DBLEND_ONE; - case GL_DST_COLOR: - return D3DBLEND_DESTCOLOR; - case GL_SRC_COLOR: - return D3DBLEND_SRCCOLOR; - case GL_ONE_MINUS_DST_COLOR: - return D3DBLEND_INVDESTCOLOR; - case GL_ONE_MINUS_SRC_COLOR: - return D3DBLEND_INVSRCCOLOR; - case GL_SRC_ALPHA: - return D3DBLEND_SRCALPHA; - case GL_ONE_MINUS_SRC_ALPHA: - return D3DBLEND_INVSRCALPHA; - case GL_DST_ALPHA: - return D3DBLEND_DESTALPHA; - case GL_ONE_MINUS_DST_ALPHA: - return D3DBLEND_INVDESTALPHA; - case GL_SRC_ALPHA_SATURATE: - return D3DBLEND_SRCALPHASAT; - } - -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "_gldConvertBlendFunc: Unknown BlendFunc\n"); -#endif - - return DefaultBlend; -} - -//--------------------------------------------------------------------------- -// Misc. functions -//--------------------------------------------------------------------------- - -void gld_Noop_DX9( - GLcontext *ctx) -{ -#ifdef _DEBUG - gldLogMessage(GLDLOG_ERROR, "gld_Noop called!\n"); -#endif -} - -//--------------------------------------------------------------------------- - -void gld_Error_DX9( - GLcontext *ctx) -{ -#ifdef _DEBUG - // Quite useless. -// gldLogMessage(GLDLOG_ERROR, "ctx->Driver.Error called!\n"); -#endif -} - -//--------------------------------------------------------------------------- -// Required Mesa functions -//--------------------------------------------------------------------------- - -static GLboolean gld_set_draw_buffer_DX9( - GLcontext *ctx, - GLenum mode) -{ - (void) ctx; - if ((mode==GL_FRONT_LEFT) || (mode == GL_BACK_LEFT)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - -//--------------------------------------------------------------------------- - -static void gld_set_read_buffer_DX9( - GLcontext *ctx, - GLframebuffer *buffer, - GLenum mode) -{ - /* separate read buffer not supported */ -/* - ASSERT(buffer == ctx->DrawBuffer); - ASSERT(mode == GL_FRONT_LEFT); -*/ -} - -//--------------------------------------------------------------------------- - -void gld_Clear_DX9( - GLcontext *ctx, - GLbitfield mask, - GLboolean all, - GLint x, - GLint y, - GLint width, - GLint height) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - DWORD dwFlags = 0; - D3DCOLOR Color = 0; - float Z = 0.0f; - DWORD Stencil = 0; - D3DRECT d3dClearRect; - - // TODO: Colourmask - const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; - - if (!gld->pDev) - return; - - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { - GLubyte col[4]; - CLAMPED_FLOAT_TO_UBYTE(col[0], ctx->Color.ClearColor[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], ctx->Color.ClearColor[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], ctx->Color.ClearColor[2]); - CLAMPED_FLOAT_TO_UBYTE(col[3], ctx->Color.ClearColor[3]); - dwFlags |= D3DCLEAR_TARGET; - Color = D3DCOLOR_RGBA(col[0], col[1], col[2], col[3]); - } - - if (mask & DD_DEPTH_BIT) { - // D3D8 will fail the Clear call if we try and clear a - // depth buffer and we haven't created one. - // Also, some apps try and clear a depth buffer, - // when a depth buffer hasn't been requested by the app. - if (ctx->Visual.depthBits == 0) { - mask &= ~DD_DEPTH_BIT; // Remove depth bit from mask - } else { - dwFlags |= D3DCLEAR_ZBUFFER; - Z = ctx->Depth.Clear; - } - } - - if (mask & DD_STENCIL_BIT) { - if (ctx->Visual.stencilBits == 0) { - // No stencil bits in depth buffer - mask &= ~DD_STENCIL_BIT; // Remove stencil bit from mask - } else { - dwFlags |= D3DCLEAR_STENCIL; - Stencil = ctx->Stencil.Clear; - } - } - - // Some apps do really weird things with the rect, such as Quake3. - if ((x < 0) || (y < 0) || (width <= 0) || (height <= 0)) { - all = GL_TRUE; - } - - if (!all) { - // Calculate clear subrect - d3dClearRect.x1 = x; - d3dClearRect.y1 = gldCtx->dwHeight - (y + height); - d3dClearRect.x2 = x + width; - d3dClearRect.y2 = d3dClearRect.y1 + height; -// gldLogPrintf(GLDLOG_INFO, "Rect %d,%d %d,%d", x,y,width,height); - } - - // dwFlags will be zero if there's nothing to clear - if (dwFlags) { - _GLD_DX9_DEV(Clear( - gld->pDev, - all ? 0 : 1, - all ? NULL : &d3dClearRect, - dwFlags, - Color, Z, Stencil)); - } - - if (mask & DD_ACCUM_BIT) { - // Clear accumulation buffer - } -} - -//--------------------------------------------------------------------------- - -// Mesa 5: Parameter change -static void gld_buffer_size_DX9( -// GLcontext *ctx, - GLframebuffer *fb, - GLuint *width, - GLuint *height) -{ -// GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - - *width = fb->Width; // gldCtx->dwWidth; - *height = fb->Height; // gldCtx->dwHeight; -} - -//--------------------------------------------------------------------------- - -static void gld_Finish_DX9( - GLcontext *ctx) -{ -} - -//--------------------------------------------------------------------------- - -static void gld_Flush_DX9( - GLcontext *ctx) -{ - GLD_context *gld = GLD_GET_CONTEXT(ctx); - - // TODO: Detect apps that glFlush() then SwapBuffers() ? - - if (gld->EmulateSingle) { - // Emulating a single-buffered context. - // [Direct3D doesn't allow rendering to front buffer] - dglSwapBuffers(gld->hDC); - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_STENCIL( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - // Two-sided stencil. New for Mesa 5 - const GLuint uiFace = 0UL; - - struct gl_stencil_attrib *pStencil = &ctx->Stencil; - - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILENABLE, pStencil->Enabled ? TRUE : FALSE)); - if (pStencil->Enabled) { - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFUNC, _gldConvertCompareFunc(pStencil->Function[uiFace]))); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILREF, pStencil->Ref[uiFace])); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILMASK, pStencil->ValueMask[uiFace])); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILWRITEMASK, pStencil->WriteMask[uiFace])); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILFAIL, _gldConvertStencilOp(pStencil->FailFunc[uiFace]))); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILZFAIL, _gldConvertStencilOp(pStencil->ZFailFunc[uiFace]))); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_STENCILPASS, _gldConvertStencilOp(pStencil->ZPassFunc[uiFace]))); - } -} - -//--------------------------------------------------------------------------- - -void gld_NEW_COLOR( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - DWORD dwFlags = 0; - D3DBLEND src; - D3DBLEND dest; - - // Alpha func - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, _gldConvertCompareFunc(ctx->Color.AlphaFunc))); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHAREF, (DWORD)ctx->Color.AlphaRef)); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, ctx->Color.AlphaEnabled)); - - // Blend func - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ALPHABLENDENABLE, ctx->Color.BlendEnabled)); - src = _gldConvertBlendFunc(ctx->Color.BlendSrcRGB, GL_ONE); - dest = _gldConvertBlendFunc(ctx->Color.BlendDstRGB, GL_ZERO); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SRCBLEND, src)); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_DESTBLEND, dest)); - - // Color mask - if (ctx->Color.ColorMask[0]) dwFlags |= D3DCOLORWRITEENABLE_RED; - if (ctx->Color.ColorMask[1]) dwFlags |= D3DCOLORWRITEENABLE_GREEN; - if (ctx->Color.ColorMask[2]) dwFlags |= D3DCOLORWRITEENABLE_BLUE; - if (ctx->Color.ColorMask[3]) dwFlags |= D3DCOLORWRITEENABLE_ALPHA; - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_COLORWRITEENABLE, dwFlags)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_DEPTH( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZENABLE, ctx->Depth.Test ? D3DZB_TRUE : D3DZB_FALSE)); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZFUNC, _gldConvertCompareFunc(ctx->Depth.Func))); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_ZWRITEENABLE, ctx->Depth.Mask ? TRUE : FALSE)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_POLYGON( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DFILLMODE d3dFillMode = D3DFILL_SOLID; - D3DCULL d3dCullMode = D3DCULL_NONE; - float fOffset = 0; // Changed from int to float for DX9 - - // Fillmode - switch (ctx->Polygon.FrontMode) { - case GL_POINT: - d3dFillMode = D3DFILL_POINT; - break; - case GL_LINE: - d3dFillMode = D3DFILL_WIREFRAME; - break; - case GL_FILL: - d3dFillMode = D3DFILL_SOLID; - break; - } - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FILLMODE, d3dFillMode)); - - if (ctx->Polygon.CullFlag) { - switch (ctx->Polygon.CullFaceMode) { - case GL_BACK: - if (ctx->Polygon.FrontFace == GL_CCW) - d3dCullMode = D3DCULL_CW; - else - d3dCullMode = D3DCULL_CCW; - break; - case GL_FRONT: - if (ctx->Polygon.FrontFace == GL_CCW) - d3dCullMode = D3DCULL_CCW; - else - d3dCullMode = D3DCULL_CW; - break; - case GL_FRONT_AND_BACK: - d3dCullMode = D3DCULL_NONE; - break; - default: - break; - } - } else { - d3dCullMode = D3DCULL_NONE; - } -// d3dCullMode = D3DCULL_NONE; // FOR DEBUGGING - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CULLMODE, d3dCullMode)); - - // Polygon offset - // ZBIAS ranges from 0 to 16 and can only move towards the viewer - // Mesa5: ctx->Polygon._OffsetAny removed - if (ctx->Polygon.OffsetFill) { - fOffset = ctx->Polygon.OffsetUnits; -// if (iOffset < 0.0f) -// iOffset = -iOffset; -// else -// iOffset = 0.0f; // D3D can't push away - } - // NOTE: SetRenderState() required a DWORD, so need to cast - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_DEPTHBIAS, *((DWORD*)&fOffset))); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_FOG( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DCOLOR d3dFogColour; - D3DFOGMODE d3dFogMode = D3DFOG_LINEAR; - - // TODO: Fog is calculated seperately in the Mesa pipeline - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, FALSE)); - return; - - // Fog enable - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGENABLE, ctx->Fog.Enabled)); - if (!ctx->Fog.Enabled) { - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, D3DFOG_NONE)); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE)); - return; // If disabled, don't bother setting any fog state - } - - // Fog colour - d3dFogColour = D3DCOLOR_COLORVALUE( ctx->Fog.Color[0], - ctx->Fog.Color[1], - ctx->Fog.Color[2], - ctx->Fog.Color[3]); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGCOLOR, d3dFogColour)); - - // Fog density - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGDENSITY, *((DWORD*) (&ctx->Fog.Density)))); - - // Fog start - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGSTART, *((DWORD*) (&ctx->Fog.Start)))); - - // Fog end - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGEND, *((DWORD*) (&ctx->Fog.End)))); - - // Fog mode - switch (ctx->Fog.Mode) { - case GL_LINEAR: - d3dFogMode = D3DFOG_LINEAR; - break; - case GL_EXP: - d3dFogMode = D3DFOG_EXP; - break; - case GL_EXP2: - d3dFogMode = D3DFOG_EXP2; - break; - } - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGTABLEMODE, d3dFogMode)); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_FOGVERTEXMODE, D3DFOG_NONE)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_LIGHT( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - DWORD dwSpecularEnable; - - // Shademode - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SHADEMODE, (ctx->Light.ShadeModel == GL_SMOOTH) ? D3DSHADE_GOURAUD : D3DSHADE_FLAT)); - - // Separate specular colour - if (ctx->Light.Enabled) - dwSpecularEnable = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TRUE: FALSE; - else - dwSpecularEnable = FALSE; - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SPECULARENABLE, dwSpecularEnable)); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_MODELVIEW( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DMATRIX m; - //GLfloat *pM = ctx->ModelView.m; - // Mesa5: Model-view is now a stack - GLfloat *pM = ctx->ModelviewMatrixStack.Top->m; - m._11 = pM[0]; - m._12 = pM[1]; - m._13 = pM[2]; - m._14 = pM[3]; - m._21 = pM[4]; - m._22 = pM[5]; - m._23 = pM[6]; - m._24 = pM[7]; - m._31 = pM[8]; - m._32 = pM[9]; - m._33 = pM[10]; - m._34 = pM[11]; - m._41 = pM[12]; - m._42 = pM[13]; - m._43 = pM[14]; - m._44 = pM[15]; - - gld->matModelView = m; -} - -//--------------------------------------------------------------------------- - -void gld_NEW_PROJECTION( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DMATRIX m; - //GLfloat *pM = ctx->ProjectionMatrix.m; - // Mesa 5: Now a stack - GLfloat *pM = ctx->ProjectionMatrixStack.Top->m; - m._11 = pM[0]; - m._12 = pM[1]; - m._13 = pM[2]; - m._14 = pM[3]; - - m._21 = pM[4]; - m._22 = pM[5]; - m._23 = pM[6]; - m._24 = pM[7]; - - m._31 = pM[8]; - m._32 = pM[9]; - m._33 = pM[10] / _fPersp_33; // / 1.6f; - m._34 = pM[11]; - - m._41 = pM[12]; - m._42 = pM[13]; - m._43 = pM[14] / 2.0f; - m._44 = pM[15]; - - gld->matProjection = m; -} - -//--------------------------------------------------------------------------- -/* -void gldFrustumHook_DX9( - GLdouble left, - GLdouble right, - GLdouble bottom, - GLdouble top, - GLdouble nearval, - GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - // Pass values on to Mesa first (in case we mess with them) - _mesa_Frustum(left, right, bottom, top, nearval, farval); - - _fPersp_33 = farval / (nearval - farval); - -// ddlogPrintf(GLDLOG_SYSTEM, "Frustum: %f", farval/nearval); -} - -//--------------------------------------------------------------------------- - -void gldOrthoHook_DX9( - GLdouble left, - GLdouble right, - GLdouble bottom, - GLdouble top, - GLdouble nearval, - GLdouble farval) -{ - GET_CURRENT_CONTEXT(ctx); - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - // Pass values on to Mesa first (in case we mess with them) - _mesa_Ortho(left, right, bottom, top, nearval, farval); - - _fPersp_33 = 1.6f; - -// ddlogPrintf(GLDLOG_SYSTEM, "Ortho: %f", farval/nearval); -} -*/ -//--------------------------------------------------------------------------- - -void gld_NEW_VIEWPORT( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DVIEWPORT9 d3dvp; -// GLint x, y; -// GLsizei w, h; - - // Set depth range - _GLD_DX9_DEV(GetViewport(gld->pDev, &d3dvp)); - // D3D can't do Quake1/Quake2 z-trick - if (ctx->Viewport.Near <= ctx->Viewport.Far) { - d3dvp.MinZ = ctx->Viewport.Near; - d3dvp.MaxZ = ctx->Viewport.Far; - } else { - d3dvp.MinZ = ctx->Viewport.Far; - d3dvp.MaxZ = ctx->Viewport.Near; - } -/* x = ctx->Viewport.X; - y = ctx->Viewport.Y; - w = ctx->Viewport.Width; - h = ctx->Viewport.Height; - if (x < 0) x = 0; - if (y < 0) y = 0; - if (w > gldCtx->dwWidth) w = gldCtx->dwWidth; - if (h > gldCtx->dwHeight) h = gldCtx->dwHeight; - // Ditto for D3D viewport dimensions - if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x; - if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y; - d3dvp.X = x; - d3dvp.Y = gldCtx->dwHeight - (y + h); - d3dvp.Width = w; - d3dvp.Height = h;*/ - _GLD_DX9_DEV(SetViewport(gld->pDev, &d3dvp)); - -// gld->fFlipWindowY = (float)gldCtx->dwHeight; -} - -//--------------------------------------------------------------------------- - -void gld_NEW_SCISSOR( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - // Bail if IHV driver cannot scissor - if (!gld->bCanScissor) - return; - - // Set scissor rect - if (ctx->Scissor.Enabled) { - RECT rcRect; - // Keep in mind that RECT's need an extra row and column - rcRect.left = ctx->Scissor.X; - rcRect.right = ctx->Scissor.X + ctx->Scissor.Width; // + 1; - rcRect.top = gldCtx->dwHeight - (ctx->Scissor.Y + ctx->Scissor.Height); - rcRect.bottom = rcRect.top + ctx->Scissor.Height; - IDirect3DDevice9_SetScissorRect(gld->pDev, &rcRect); - } - - // Enable/disable scissor as required - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SCISSORTESTENABLE, ctx->Scissor.Enabled)); -} - -//--------------------------------------------------------------------------- - -__inline BOOL _gldAnyEvalEnabled( - GLcontext *ctx) -{ - struct gl_eval_attrib *eval = &ctx->Eval; - - if ((eval->AutoNormal) || - (eval->Map1Color4) || - (eval->Map1Index) || - (eval->Map1Normal) || - (eval->Map1TextureCoord1) || - (eval->Map1TextureCoord2) || - (eval->Map1TextureCoord3) || - (eval->Map1TextureCoord4) || - (eval->Map1Vertex3) || - (eval->Map1Vertex4) || - (eval->Map2Color4) || - (eval->Map2Index) || - (eval->Map2Normal) || - (eval->Map2TextureCoord1) || - (eval->Map2TextureCoord2) || - (eval->Map2TextureCoord3) || - (eval->Map2TextureCoord4) || - (eval->Map2Vertex3) || - (eval->Map2Vertex4) - ) - return TRUE; - - return FALSE; -} - -//--------------------------------------------------------------------------- - -BOOL _gldChooseInternalPipeline( - GLcontext *ctx, - GLD_driver_dx9 *gld) -{ -// return TRUE; // DEBUGGING: ALWAYS USE MESA -// return FALSE; // DEBUGGING: ALWAYS USE D3D - - if ((glb.dwTnL == GLDS_TNL_MESA) || (gld->bHasHWTnL == FALSE)) - { - gld->PipelineUsage.qwMesa.QuadPart++; - return TRUE; // Force Mesa TnL - } - - if ((ctx->Light.Enabled) || - (1) || - (ctx->Texture._TexGenEnabled) || - (ctx->Texture._TexMatEnabled) || -// (ctx->Transform._AnyClip) || - (ctx->Scissor.Enabled) || - _gldAnyEvalEnabled(ctx) // Put this last so we can early-out - ) - { - gld->PipelineUsage.qwMesa.QuadPart++; - return TRUE; - } - - gld->PipelineUsage.qwD3DFVF.QuadPart++; - return FALSE; - -/* // Force Mesa pipeline? - if (glb.dwTnL == GLDS_TNL_MESA) { - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - - // Test for functionality not exposed in the D3D pathways - if ((ctx->Texture._GenFlags)) { - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - - // Now decide if vertex shader can be used. - // If two sided lighting is enabled then we must either - // use Mesa TnL or the vertex shader - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { - if (gld->VStwosidelight.hShader && !ctx->Fog.Enabled) { - // Use Vertex Shader - gld->PipelineUsage.dwD3D2SVS.QuadPart++; - return GLD_PIPELINE_D3D_VS_TWOSIDE; - } else { - // Use Mesa TnL - gld->PipelineUsage.dwMesa.QuadPart++; - return GLD_PIPELINE_MESA; - } - } - - // Must be D3D fixed-function pipeline - gld->PipelineUsage.dwD3DFVF.QuadPart++; - return GLD_PIPELINE_D3D_FVF; -*/ -} - -//--------------------------------------------------------------------------- - -void gld_update_state_DX9( - GLcontext *ctx, - GLuint new_state) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLD_pb_dx9 *gldPB; - - if (!gld || !gld->pDev) - return; - - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - - // SetupIndex will be used in the pipelines for choosing setup function - if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) || - (ctx->Fog.Enabled)) - { - if (ctx->_TriangleCaps & DD_FLATSHADE) - gld->iSetupFunc = GLD_SI_FLAT_EXTRAS; - else - gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS; - } else { - if (ctx->_TriangleCaps & DD_FLATSHADE) - gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture - else - gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture - } - - gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld); - if (gld->bUseMesaTnL) { - gldPB = &gld->PB2d; - _GLD_DX9_DEV(SetSoftwareVertexProcessing(gld->pDev, TRUE)); - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, FALSE)); - _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL)); - _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF)); - } else { - gldPB = &gld->PB3d; - _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE)); -// if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) { -// _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware)); -// _GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader)); -// } else { -// _GLD_DX9_DEV(SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL)); - _GLD_DX9_DEV(SetSoftwareVertexProcessing(gld->pDev, !gld->bHasHWTnL)); - _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL)); - _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF)); -// } - } - -#define _GLD_TEST_STATE(a) \ - if (new_state & (a)) { \ - gld##a(ctx); \ - new_state &= ~(a); \ - } - -#define _GLD_TEST_STATE_DX9(a) \ - if (new_state & (a)) { \ - gld##a##_DX9(ctx); \ - new_state &= ~(a); \ - } - -#define _GLD_IGNORE_STATE(a) new_state &= ~(a); - -// if (!gld->bUseMesaTnL) { - // Not required if Mesa is doing the TnL. - // Problem: If gld->bUseMesaTnL is TRUE when these are signaled, - // then we'll miss updating the D3D TnL pipeline. - // Therefore, don't test for gld->bUseMesaTnL - _GLD_TEST_STATE(_NEW_MODELVIEW); - _GLD_TEST_STATE(_NEW_PROJECTION); -// } - - _GLD_TEST_STATE_DX9(_NEW_TEXTURE); // extern, so guard with _DX9 - _GLD_TEST_STATE(_NEW_COLOR); - _GLD_TEST_STATE(_NEW_DEPTH); - _GLD_TEST_STATE(_NEW_POLYGON); - _GLD_TEST_STATE(_NEW_STENCIL); - _GLD_TEST_STATE(_NEW_FOG); - _GLD_TEST_STATE(_NEW_LIGHT); - _GLD_TEST_STATE(_NEW_VIEWPORT); - - _GLD_IGNORE_STATE(_NEW_TRANSFORM); - - // Scissor Test: New for DX9 - _GLD_TEST_STATE(_NEW_SCISSOR); - -// Stubs for future use. -/* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX); - _GLD_TEST_STATE(_NEW_COLOR_MATRIX); - _GLD_TEST_STATE(_NEW_ACCUM); - _GLD_TEST_STATE(_NEW_EVAL); - _GLD_TEST_STATE(_NEW_HINT); - _GLD_TEST_STATE(_NEW_LINE); - _GLD_TEST_STATE(_NEW_PIXEL); - _GLD_TEST_STATE(_NEW_POINT); - _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE); - _GLD_TEST_STATE(_NEW_PACKUNPACK); - _GLD_TEST_STATE(_NEW_ARRAY); - _GLD_TEST_STATE(_NEW_RENDERMODE); - _GLD_TEST_STATE(_NEW_BUFFERS); - _GLD_TEST_STATE(_NEW_MULTISAMPLE); -*/ - -// For debugging. -#if 0 -#define _GLD_TEST_UNHANDLED_STATE(a) \ - if (new_state & (a)) { \ - gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \ - } - _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX); - _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX); - _GLD_TEST_UNHANDLED_STATE(_NEW_ACCUM); - _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL); - _GLD_TEST_UNHANDLED_STATE(_NEW_HINT); - _GLD_TEST_UNHANDLED_STATE(_NEW_LINE); - _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL); - _GLD_TEST_UNHANDLED_STATE(_NEW_POINT); - _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE); -// _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR); - _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK); - _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY); - _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE); - _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS); - _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE); -#undef _GLD_UNHANDLED_STATE -#endif - -#undef _GLD_TEST_STATE -} - -//--------------------------------------------------------------------------- -// Viewport -//--------------------------------------------------------------------------- - -void gld_Viewport_DX9( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei w, - GLsizei h) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DVIEWPORT9 d3dvp; - - if (!gld || !gld->pDev) - return; - - // This is a hack. When the app is minimized, Mesa passes - // w=1 and h=1 for viewport dimensions. Without this test - // we get a GPF in gld_wgl_resize_buffers(). - if ((w==1) && (h==1)) - return; - - // Call ResizeBuffersMESA. This function will early-out - // if no resize is needed. - //ctx->Driver.ResizeBuffersMESA(ctx); - // Mesa 5: Changed parameters - ctx->Driver.ResizeBuffers(gldCtx->glBuffer); - -#if 0 - ddlogPrintf(GLDLOG_SYSTEM, ">> Viewport x=%d y=%d w=%d h=%d", x,y,w,h); -#endif - - // ** D3D viewport must not be outside the render target surface ** - // Sanity check the GL viewport dimensions - if (x < 0) x = 0; - if (y < 0) y = 0; - if (w > gldCtx->dwWidth) w = gldCtx->dwWidth; - if (h > gldCtx->dwHeight) h = gldCtx->dwHeight; - // Ditto for D3D viewport dimensions - if (w+x > gldCtx->dwWidth) w = gldCtx->dwWidth-x; - if (h+y > gldCtx->dwHeight) h = gldCtx->dwHeight-y; - - d3dvp.X = x; - d3dvp.Y = gldCtx->dwHeight - (y + h); - d3dvp.Width = w; - d3dvp.Height = h; - if (ctx->Viewport.Near <= ctx->Viewport.Far) { - d3dvp.MinZ = ctx->Viewport.Near; - d3dvp.MaxZ = ctx->Viewport.Far; - } else { - d3dvp.MinZ = ctx->Viewport.Far; - d3dvp.MaxZ = ctx->Viewport.Near; - } - - // TODO: DEBUGGING -// d3dvp.MinZ = 0.0f; -// d3dvp.MaxZ = 1.0f; - - _GLD_DX9_DEV(SetViewport(gld->pDev, &d3dvp)); - -} - -//--------------------------------------------------------------------------- - -extern BOOL dglWglResizeBuffers(GLcontext *ctx, BOOL bDefaultDriver); - -// Mesa 5: Parameter change -void gldResizeBuffers_DX9( -// GLcontext *ctx) - GLframebuffer *fb) -{ - GET_CURRENT_CONTEXT(ctx); - dglWglResizeBuffers(ctx, TRUE); -} - -//--------------------------------------------------------------------------- -#ifdef _DEBUG -// This is only for debugging. -// To use, plug into ctx->Driver.Enable pointer below. -void gld_Enable( - GLcontext *ctx, - GLenum e, - GLboolean b) -{ - char buf[1024]; - sprintf(buf, "Enable: %s (%s)\n", _mesa_lookup_enum_by_nr(e), b?"TRUE":"FALSE"); - ddlogMessage(DDLOG_SYSTEM, buf); -} -#endif -//--------------------------------------------------------------------------- -// Driver pointer setup -//--------------------------------------------------------------------------- - -extern const GLubyte* _gldGetStringGeneric(GLcontext*, GLenum); - -void gldSetupDriverPointers_DX9( - GLcontext *ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - TNLcontext *tnl = TNL_CONTEXT(ctx); - - // Mandatory functions - ctx->Driver.GetString = _gldGetStringGeneric; - ctx->Driver.UpdateState = gld_update_state_DX9; - ctx->Driver.Clear = gld_Clear_DX9; - ctx->Driver.DrawBuffer = gld_set_draw_buffer_DX9; - ctx->Driver.GetBufferSize = gld_buffer_size_DX9; - ctx->Driver.Finish = gld_Finish_DX9; - ctx->Driver.Flush = gld_Flush_DX9; - ctx->Driver.Error = gld_Error_DX9; - - // Hardware accumulation buffer - ctx->Driver.Accum = NULL; // TODO: gld_Accum; - - // Bitmap functions - ctx->Driver.CopyPixels = gld_CopyPixels_DX9; - ctx->Driver.DrawPixels = gld_DrawPixels_DX9; - ctx->Driver.ReadPixels = gld_ReadPixels_DX9; - ctx->Driver.Bitmap = gld_Bitmap_DX9; - - // Buffer resize - ctx->Driver.ResizeBuffers = gldResizeBuffers_DX9; - - // Texture image functions - ctx->Driver.ChooseTextureFormat = gld_ChooseTextureFormat_DX9; - ctx->Driver.TexImage1D = gld_TexImage1D_DX9; - ctx->Driver.TexImage2D = gld_TexImage2D_DX9; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = gld_TexSubImage1D_DX9; - ctx->Driver.TexSubImage2D = gld_TexSubImage2D_DX9; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - - ctx->Driver.CopyTexImage1D = gldCopyTexImage1D_DX9; //NULL; - ctx->Driver.CopyTexImage2D = gldCopyTexImage2D_DX9; //NULL; - ctx->Driver.CopyTexSubImage1D = gldCopyTexSubImage1D_DX9; //NULL; - ctx->Driver.CopyTexSubImage2D = gldCopyTexSubImage2D_DX9; //NULL; - ctx->Driver.CopyTexSubImage3D = gldCopyTexSubImage3D_DX9; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - // Texture object functions - ctx->Driver.BindTexture = NULL; - ctx->Driver.NewTextureObject = NULL; // Not yet implemented by Mesa!; - ctx->Driver.DeleteTexture = gld_DeleteTexture_DX9; - ctx->Driver.PrioritizeTexture = NULL; - - // Imaging functionality - ctx->Driver.CopyColorTable = NULL; - ctx->Driver.CopyColorSubTable = NULL; - ctx->Driver.CopyConvolutionFilter1D = NULL; - ctx->Driver.CopyConvolutionFilter2D = NULL; - - // State changing functions - ctx->Driver.AlphaFunc = NULL; //gld_AlphaFunc; - ctx->Driver.BlendFuncSeparate = NULL; //gld_BlendFunc; - ctx->Driver.ClearColor = NULL; //gld_ClearColor; - ctx->Driver.ClearDepth = NULL; //gld_ClearDepth; - ctx->Driver.ClearStencil = NULL; //gld_ClearStencil; - ctx->Driver.ColorMask = NULL; //gld_ColorMask; - ctx->Driver.CullFace = NULL; //gld_CullFace; - ctx->Driver.ClipPlane = NULL; //gld_ClipPlane; - ctx->Driver.FrontFace = NULL; //gld_FrontFace; - ctx->Driver.DepthFunc = NULL; //gld_DepthFunc; - ctx->Driver.DepthMask = NULL; //gld_DepthMask; - ctx->Driver.DepthRange = NULL; - ctx->Driver.Enable = NULL; //gld_Enable; - ctx->Driver.Fogfv = NULL; //gld_Fogfv; - ctx->Driver.Hint = NULL; //gld_Hint; - ctx->Driver.Lightfv = NULL; //gld_Lightfv; - ctx->Driver.LightModelfv = NULL; //gld_LightModelfv; - ctx->Driver.LineStipple = NULL; //gld_LineStipple; - ctx->Driver.LineWidth = NULL; //gld_LineWidth; - ctx->Driver.LogicOpcode = NULL; //gld_LogicOpcode; - ctx->Driver.PointParameterfv = NULL; //gld_PointParameterfv; - ctx->Driver.PointSize = NULL; //gld_PointSize; - ctx->Driver.PolygonMode = NULL; //gld_PolygonMode; - ctx->Driver.PolygonOffset = NULL; //gld_PolygonOffset; - ctx->Driver.PolygonStipple = NULL; //gld_PolygonStipple; - ctx->Driver.RenderMode = NULL; //gld_RenderMode; - ctx->Driver.Scissor = NULL; //gld_Scissor; - ctx->Driver.ShadeModel = NULL; //gld_ShadeModel; - ctx->Driver.StencilFunc = NULL; //gld_StencilFunc; - ctx->Driver.StencilMask = NULL; //gld_StencilMask; - ctx->Driver.StencilOp = NULL; //gld_StencilOp; - ctx->Driver.TexGen = NULL; //gld_TexGen; - ctx->Driver.TexEnv = NULL; - ctx->Driver.TexParameter = NULL; - ctx->Driver.TextureMatrix = NULL; //gld_TextureMatrix; - ctx->Driver.Viewport = gld_Viewport_DX9; - - _swsetup_Wakeup(ctx); - - tnl->Driver.RunPipeline = _tnl_run_pipeline; - tnl->Driver.Render.ResetLineStipple = gld_ResetLineStipple_DX9; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; - - // Hook into glFrustum() and glOrtho() -// ctx->Exec->Frustum = gldFrustumHook_DX9; -// ctx->Exec->Ortho = gldOrthoHook_DX9; - -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h deleted file mode 100644 index aec40ac9d..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dx9.h +++ /dev/null @@ -1,327 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect Direct3D 9.0 header file -* -****************************************************************************/ - -#ifndef _GLD_DX9_H -#define _GLD_DX9_H - -//--------------------------------------------------------------------------- -// Windows includes -//--------------------------------------------------------------------------- - -//#ifndef STRICT -//#define STRICT -//#endif - -//#define WIN32_LEAN_AND_MEAN -//#include -#include -#include - -// MS screwed up with the DX8.1 SDK - there's no compile-time -// method of compiling for 8.0 via the 8.1 SDK unless you -// "make sure you don't use any 8.1 interfaces". -// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces. -// -// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95). -// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95). -// -//#define D3D_SDK_VERSION_DX9_SUPPORT_WIN95 120 -//#define D3D_SDK_VERSION_DX91 220 - -// Typedef for obtaining function from d3d8.dll -typedef IDirect3D9* (WINAPI *FNDIRECT3DCREATE9) (UINT); - - -//--------------------------------------------------------------------------- -// Defines -//--------------------------------------------------------------------------- - -#ifdef _DEBUG -#define _GLD_TEST_HRESULT(h) \ -{ \ - HRESULT _hr = (h); \ - if (FAILED(_hr)) { \ - gldLogError(GLDLOG_ERROR, #h, _hr); \ - } \ -} -#define _GLD_DX9(func) _GLD_TEST_HRESULT(IDirect3D9_##func##) -#define _GLD_DX9_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice9_##func##) -#define _GLD_DX9_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer9_##func##) -#define _GLD_DX9_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture9_##func##) -#else -#define _GLD_DX9(func) IDirect3D9_##func -#define _GLD_DX9_DEV(func) IDirect3DDevice9_##func -#define _GLD_DX9_VB(func) IDirect3DVertexBuffer9_##func -#define _GLD_DX9_TEX(func) IDirect3DTexture9_##func -#endif - -#define SAFE_RELEASE(p) \ -{ \ - if (p) { \ - (p)->lpVtbl->Release(p); \ - (p) = NULL; \ - } \ -} - -#define SAFE_RELEASE_VB9(p) \ -{ \ - if (p) { \ - IDirect3DVertexBuffer9_Release((p)); \ - (p) = NULL; \ - } \ -} - -#define SAFE_RELEASE_SURFACE9(p) \ -{ \ - if (p) { \ - IDirect3DSurface9_Release((p)); \ - (p) = NULL; \ - } \ -} - -// Setup index. -enum { - GLD_SI_FLAT = 0, - GLD_SI_SMOOTH = 1, - GLD_SI_FLAT_EXTRAS = 2, - GLD_SI_SMOOTH_EXTRAS = 3, -}; -/* -// Internal pipeline -typedef enum { - GLD_PIPELINE_MESA = 0, // Mesa pipeline - GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline - GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader -} GLD_tnl_pipeline; -*/ -//--------------------------------------------------------------------------- -// Vertex definitions for Fixed-Function pipeline -//--------------------------------------------------------------------------- - -// -// NOTE: If the number of texture units is altered then most of -// the texture code will need to be revised. -// - -#define GLD_MAX_TEXTURE_UNITS_DX9 2 - -// -// 2D vertex transformed by Mesa -// -#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \ - D3DFVF_DIFFUSE | \ - D3DFVF_SPECULAR | \ - D3DFVF_TEX2) -typedef struct { - FLOAT x, y; // 2D raster coords - FLOAT sz; // Screen Z (depth) - FLOAT rhw; // Reciprocal homogenous W - DWORD diffuse; // Diffuse colour - DWORD specular; // For separate-specular support - FLOAT t0_u, t0_v; // 1st set of texture coords - FLOAT t1_u, t1_v; // 2nd set of texture coords -} GLD_2D_VERTEX; - - -// -// 3D vertex transformed by Direct3D -// -#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \ - D3DFVF_DIFFUSE | \ - D3DFVF_TEX2) - -typedef struct { - D3DXVECTOR3 Position; // XYZ Vector in object space - D3DCOLOR Diffuse; // Diffuse colour - D3DXVECTOR2 TexUnit0; // Texture unit 0 - D3DXVECTOR2 TexUnit1; // Texture unit 1 -} GLD_3D_VERTEX; - -//--------------------------------------------------------------------------- -// Vertex Shaders -//--------------------------------------------------------------------------- -/* -// DX8 Vertex Shader -typedef struct { - DWORD hShader; // If NULL, shader is invalid and cannot be used - BOOL bHardware; // If TRUE then shader was created for hardware, - // otherwise shader was created for software. -} GLD_vertexShader; -*/ -//--------------------------------------------------------------------------- -// Structs -//--------------------------------------------------------------------------- - -// This keeps a count of how many times we choose each individual internal -// pathway. Useful for seeing if a certain pathway was ever used by an app, and -// how much each pathway is biased. -// Zero the members at context creation and dump stats at context deletion. -typedef struct { - // Note: DWORD is probably too small - ULARGE_INTEGER qwMesa; // Mesa TnL pipeline - ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline -// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline -} GLD_pipeline_usage; - -// GLDirect Primitive Buffer (points, lines, triangles and quads) -typedef struct { - // Data for IDirect3DDevice9::CreateVertexBuffer() - DWORD dwStride; // Stride of vertex - DWORD dwUsage; // Usage flags - DWORD dwFVF; // Direct3D Flexible Vertex Format - DWORD dwPool; // Pool flags - - IDirect3DVertexBuffer9 *pVB; // Holds points, lines, tris and quads. - - // Point list is assumed to be at start of buffer - DWORD iFirstLine; // Index of start of line list - DWORD iFirstTriangle; // Index of start of triangle list - - BYTE *pPoints; // Pointer to next free point - BYTE *pLines; // Pointer to next free line - BYTE *pTriangles; // Pointer to next free triangle - - DWORD nPoints; // Number of points ready to render - DWORD nLines; // Number of lines ready to render - DWORD nTriangles; // Number of triangles ready to render -} GLD_pb_dx9; - -// GLDirect DX9 driver data -typedef struct { - // GLDirect vars - BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered) - BOOL bDepthStencil; // Depth buffer needed (stencil optional) - D3DFORMAT RenderFormat; // Format of back/front buffer - D3DFORMAT DepthFormat; // Format of depth/stencil -// float fFlipWindowY; // Value for flipping viewport Y coord - - // Direct3D vars - D3DCAPS9 d3dCaps9; - BOOL bHasHWTnL; // Device has Hardware Transform/Light? - IDirect3D9 *pD3D; // Base Direct3D9 interface - IDirect3DDevice9 *pDev; // Direct3D9 Device interface - GLD_pb_dx9 PB2d; // Vertices transformed by Mesa - GLD_pb_dx9 PB3d; // Vertices transformed by Direct3D - D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type - D3DXMATRIX matProjection; // Projection matrix for D3D TnL - D3DXMATRIX matModelView; // Model/View matrix for D3D TnL - int iSetupFunc; // Which setup functions to use - BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL - - // Direct3D vars for two-sided lighting -// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting -// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders - - -// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline - GLD_pipeline_usage PipelineUsage; - - BOOL bCanScissor; // Scissor test - new for DX9 -} GLD_driver_dx9; - -#define GLD_GET_DX9_DRIVER(c) (GLD_driver_dx9*)(c)->glPriv - -//--------------------------------------------------------------------------- -// Function prototypes -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_DX9(LPCSTR a); -void gldEnableExtensions_DX9(GLcontext *ctx); -void gldInstallPipeline_DX9(GLcontext *ctx); -void gldSetupDriverPointers_DX9(GLcontext *ctx); -//void gldResizeBuffers_DX9(GLcontext *ctx); -void gldResizeBuffers_DX9(GLframebuffer *fb); - - -// Texture functions - -void gldCopyTexImage1D_DX9(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -void gldCopyTexImage2D_DX9(GLcontext *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -void gldCopyTexSubImage1D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ); -void gldCopyTexSubImage2D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); -void gldCopyTexSubImage3D_DX9(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); - -void gld_NEW_TEXTURE_DX9(GLcontext *ctx); -void gld_DrawPixels_DX9(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels); -void gld_ReadPixels_DX9(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest); -void gld_CopyPixels_DX9(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type); -void gld_Bitmap_DX9(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap); -const struct gl_texture_format* gld_ChooseTextureFormat_DX9(GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType); -void gld_TexImage2D_DX9(GLcontext *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 *tObj, struct gl_texture_image *texImage); -void gld_TexImage1D_DX9(GLcontext *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 ); -void gld_TexSubImage2D_DX9( GLcontext *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 ); -void gld_TexSubImage1D_DX9(GLcontext *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); -void gld_DeleteTexture_DX9(GLcontext *ctx, struct gl_texture_object *tObj); -void gld_ResetLineStipple_DX9(GLcontext *ctx); - -// 2D primitive functions - -void gld_Points2D_DX9(GLcontext *ctx, GLuint first, GLuint last); - -void gld_Line2DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Line2DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1); - -void gld_Triangle2DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DFlatExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmoothExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); - -void gld_Quad2DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DFlatExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmoothExtras_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -// 3D primitive functions - -void gld_Points3D_DX9(GLcontext *ctx, GLuint first, GLuint last); -void gld_Line3DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle3DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad3DFlat_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Line3DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle3DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad3DSmooth_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -// Primitive functions for Two-sided-lighting Vertex Shader - -void gld_Points2DTwoside_DX9(GLcontext *ctx, GLuint first, GLuint last); -void gld_Line2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Line2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1); -void gld_Triangle2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Triangle2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2); -void gld_Quad2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -void gld_Quad2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3); - -#endif diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h deleted file mode 100644 index 1d6b7b1c7..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_dxerr9.h +++ /dev/null @@ -1,77 +0,0 @@ -/*==========================================================================; - * - * - * File: dxerr9.h - * Content: DirectX Error Library Include File - * - ****************************************************************************/ - -#ifndef _GLD_DXERR9_H_ -#define _GLD_DXERR9_H_ - - -#include - -// -// DXGetErrorString9 -// -// Desc: Converts an DirectX HRESULT to a string -// -// Args: HRESULT hr Can be any error code from -// DPLAY D3D8 D3DX8 DMUSIC DSOUND -// -// Return: Converted string -// -const char* __stdcall DXGetErrorString9A(HRESULT hr); -const WCHAR* __stdcall DXGetErrorString9W(HRESULT hr); - -#ifdef UNICODE - #define DXGetErrorString9 DXGetErrorString9W -#else - #define DXGetErrorString9 DXGetErrorString9A -#endif - - -// -// DXTrace -// -// Desc: Outputs a formatted error message to the debug stream -// -// Args: CHAR* strFile The current file, typically passed in using the -// __FILE__ macro. -// DWORD dwLine The current line number, typically passed in using the -// __LINE__ macro. -// HRESULT hr An HRESULT that will be traced to the debug stream. -// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) -// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. -// -// Return: The hr that was passed in. -// -//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE ); -//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE ); -HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox); -HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox); - -#ifdef UNICODE - #define DXTrace DXTraceW -#else - #define DXTrace DXTraceA -#endif - - -// -// Helper macros -// -#if defined(DEBUG) | defined(_DEBUG) - #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) - #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) - #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) -#else - #define DXTRACE_MSG(str) (0L) - #define DXTRACE_ERR(str,hr) (hr) - #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr) -#endif - - -#endif - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c deleted file mode 100644 index e8c73a6ff..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c +++ /dev/null @@ -1,344 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GL extensions -* -****************************************************************************/ - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "../gld_settings.h" - -#include -#define GL_GLEXT_PROTOTYPES -#include -#include - -//#include "ddlog.h" -//#include "gld_dx8.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -#include "dglcontext.h" -#include "extensions.h" - -// For some reason this is not defined in an above header... -extern void _mesa_enable_imaging_extensions(GLcontext *ctx); - -//--------------------------------------------------------------------------- -// Hack for the SGIS_multitexture extension that was removed from Mesa -// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel - - // NOTE: Quake2 ran *slower* with this enabled, so I've - // disabled it for now. - // To enable, uncomment: - // _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0); - -//--------------------------------------------------------------------------- - -enum { - /* Quake2 GL_SGIS_multitexture */ - GL_SELECTED_TEXTURE_SGIS = 0x835B, - GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C, - GL_MAX_TEXTURES_SGIS = 0x835D, - GL_TEXTURE0_SGIS = 0x835E, - GL_TEXTURE1_SGIS = 0x835F, - GL_TEXTURE2_SGIS = 0x8360, - GL_TEXTURE3_SGIS = 0x8361, - GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363, -}; - -//--------------------------------------------------------------------------- - -void APIENTRY gldSelectTextureSGIS( - GLenum target) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glActiveTextureARB(ARB_target); -} - -//--------------------------------------------------------------------------- - -void APIENTRY gldMTexCoord2fSGIS( - GLenum target, - GLfloat s, - GLfloat t) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glMultiTexCoord2fARB(ARB_target, s, t); -} - -//--------------------------------------------------------------------------- - -void APIENTRY gldMTexCoord2fvSGIS( - GLenum target, - const GLfloat *v) -{ - GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS); - glMultiTexCoord2fvARB(ARB_target, v); -} - -//--------------------------------------------------------------------------- -// Extensions -//--------------------------------------------------------------------------- - -typedef struct { - PROC proc; - char *name; -} GLD_extension; - -GLD_extension GLD_extList[] = { -#ifdef GL_EXT_polygon_offset - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, -#endif - { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, - { (PROC)glBlendColorEXT, "glBlendColorExt" }, - { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, - { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, - { (PROC)glColorPointerEXT, "glColorPointerEXT" }, - { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, - { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, - { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, - { (PROC)glGetPointervEXT, "glGetPointervEXT" }, - { (PROC)glArrayElementEXT, "glArrayElementEXT" }, - { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, - { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, - { (PROC)glBindTextureEXT, "glBindTextureEXT" }, - { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, - { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, - { (PROC)glIsTextureEXT, "glIsTextureEXT" }, - { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, - { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, - { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, - { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, - { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, - { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, - - { (PROC)glLockArraysEXT, "glLockArraysEXT" }, - { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" }, - { NULL, "\0" } -}; - -GLD_extension GLD_multitexList[] = { -/* - { (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" }, - { (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" }, - { (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" }, - { (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" }, - { (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" }, - { (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" }, - { (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" }, - { (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" }, - { (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" }, - { (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" }, - { (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" }, - { (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" }, - { (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" }, - { (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" }, - { (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" }, - { (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" }, - { (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" }, - { (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" }, - { (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" }, - { (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" }, - { (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" }, - { (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" }, - { (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" }, - { (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" }, - { (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" }, - { (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" }, - { (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" }, - { (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" }, - { (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" }, - { (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" }, - { (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" }, - { (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" }, - { (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" }, - { (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" }, - { (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" }, -*/ - { (PROC)glActiveTextureARB, "glActiveTextureARB" }, - { (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" }, - { (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" }, - { (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" }, - { (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" }, - { (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" }, - { (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" }, - { (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" }, - { (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" }, - { (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" }, - { (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" }, - { (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" }, - { (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" }, - { (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" }, - { (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" }, - { (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" }, - { (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" }, - { (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" }, - { (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" }, - { (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" }, - { (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" }, - { (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" }, - { (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" }, - { (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" }, - { (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" }, - { (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" }, - { (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" }, - { (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" }, - { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" }, - { (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" }, - { (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" }, - { (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" }, - { (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" }, - { (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" }, - - // Descent3 doesn't use correct string, hence this hack - { (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" }, - - // Quake2 SGIS multitexture - { (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" }, - { (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" }, - { (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" }, - - { NULL, "\0" } -}; - -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_DX( - LPCSTR a) -{ - int i; - PROC proc = NULL; - - for (i=0; GLD_extList[i].proc; i++) { - if (!strcmp(a, GLD_extList[i].name)) { - proc = GLD_extList[i].proc; - break; - } - } - - if (glb.bMultitexture) { - for (i=0; GLD_multitexList[i].proc; i++) { - if (!strcmp(a, GLD_multitexList[i].name)) { - proc = GLD_multitexList[i].proc; - break; - } - } - } - - gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed"); - - return proc; -} - -//--------------------------------------------------------------------------- - -void gldEnableExtensions_DX9( - GLcontext *ctx) -{ - GLuint i; - - // Mesa enables some extensions by default. - // This table decides which ones we want to switch off again. - - // NOTE: GL_EXT_compiled_vertex_array appears broken. - - const char *gld_disable_extensions[] = { -// "GL_ARB_transpose_matrix", -// "GL_EXT_compiled_vertex_array", -// "GL_EXT_polygon_offset", -// "GL_EXT_rescale_normal", - "GL_EXT_texture3D", -// "GL_NV_texgen_reflection", - NULL - }; - - const char *gld_multitex_extensions[] = { - "GL_ARB_multitexture", // Quake 3 - NULL - }; - - // Quake 2 engines - const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture"; - - const char *gld_enable_extensions[] = { - "GL_EXT_texture_env_add", // Quake 3 - "GL_ARB_texture_env_add", // Quake 3 - NULL - }; - - for (i=0; gld_disable_extensions[i]; i++) { - _mesa_disable_extension(ctx, gld_disable_extensions[i]); - } - - for (i=0; gld_enable_extensions[i]; i++) { - _mesa_enable_extension(ctx, gld_enable_extensions[i]); - } - - if (glb.bMultitexture) { - for (i=0; gld_multitex_extensions[i]; i++) { - _mesa_enable_extension(ctx, gld_multitex_extensions[i]); - } - - // GL_SGIS_multitexture - // NOTE: Quake2 ran *slower* with this enabled, so I've - // disabled it for now. - // Fair bit slower on GeForce256, - // Much slower on 3dfx Voodoo5 5500. -// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0); - - } - - _mesa_enable_imaging_extensions(ctx); - _mesa_enable_1_3_extensions(ctx); - _mesa_enable_1_4_extensions(ctx); -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c deleted file mode 100644 index 2b272aa62..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_pipeline_dx9.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Mesa transformation pipeline with GLDirect fastpath -* -****************************************************************************/ - -//#include "../GLDirect.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx9.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -//--------------------------------------------------------------------------- - -extern struct tnl_pipeline_stage _gld_d3d_render_stage; -extern struct tnl_pipeline_stage _gld_mesa_render_stage; - -static const struct tnl_pipeline_stage *gld_pipeline[] = { - &_gld_d3d_render_stage, // Direct3D TnL - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */ - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_point_attenuation_stage, - &_gld_mesa_render_stage, // Mesa TnL, D3D rendering - 0, -}; - -//--------------------------------------------------------------------------- - -void gldInstallPipeline_DX9( - GLcontext *ctx) -{ - // Remove any existing pipeline stages, - // then install GLDirect pipeline stages. - - _tnl_destroy_pipeline(ctx); - _tnl_install_pipeline(ctx, gld_pipeline); -} - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c deleted file mode 100644 index 403a9d5f8..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c +++ /dev/null @@ -1,1446 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Primitive (points/lines/tris/quads) rendering -* -****************************************************************************/ - -//#include "../GLDirect.h" - -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx9.h" - -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast_setup/ss_context.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_lines.h" -#include "swrast/s_triangle.h" -#include "swrast/s_trispan.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -// Disable compiler complaints about unreferenced local variables -#pragma warning (disable:4101) - -//--------------------------------------------------------------------------- -// Helper defines for primitives -//--------------------------------------------------------------------------- - -//static const float ooZ = 1.0f / 65536.0f; // One over Z - -#define GLD_COLOUR (D3DCOLOR_RGBA(swv->color[0], swv->color[1], swv->color[2], swv->color[3])) -#define GLD_SPECULAR (D3DCOLOR_RGBA(swv->specular[0], swv->specular[1], swv->specular[2], swv->specular[3])) -#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y)) - -//--------------------------------------------------------------------------- -// 2D vertex setup -//--------------------------------------------------------------------------- - -#define GLD_SETUP_2D_VARS_POINTS \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pPoints; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour - -#define GLD_SETUP_2D_VARS_LINES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pLines; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour - -#define GLD_SETUP_2D_VARS_TRIANGLES \ - BOOL bFog = ctx->Fog.Enabled; \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \ - GLD_2D_VERTEX *pV = (GLD_2D_VERTEX*)gld->PB2d.pTriangles; \ - SScontext *ss = SWSETUP_CONTEXT(ctx); \ - SWvertex *swv; \ - DWORD dwSpecularColour; \ - DWORD dwFlatColour; \ - GLuint facing = 0; \ - struct vertex_buffer *VB; \ - GLchan (*vbcolor)[4]; \ - GLchan (*vbspec)[4] - -#define GLD_SETUP_GET_SWVERT(s) \ - swv = &ss->verts[##s] - -#define GLD_SETUP_2D_VERTEX \ - pV->x = swv->win[0]; \ - pV->y = GLD_FLIP_Y(swv->win[1]); \ - pV->rhw = swv->win[3] - -#define GLD_SETUP_SMOOTH_COLOUR \ - pV->diffuse = GLD_COLOUR - -#define GLD_SETUP_GET_FLAT_COLOUR \ - dwFlatColour = GLD_COLOUR -#define GLD_SETUP_GET_FLAT_FOG_COLOUR \ - dwFlatColour = _gldComputeFog(ctx, swv) - -#define GLD_SETUP_USE_FLAT_COLOUR \ - pV->diffuse = dwFlatColour - -#define GLD_SETUP_GET_FLAT_SPECULAR \ - dwSpecularColour= GLD_SPECULAR - -#define GLD_SETUP_USE_FLAT_SPECULAR \ - pV->specular = dwSpecularColour - -#define GLD_SETUP_DEPTH \ - pV->sz = swv->win[2] / ctx->DepthMaxF -// pV->z = swv->win[2] * ooZ; - -#define GLD_SETUP_SPECULAR \ - pV->specular = GLD_SPECULAR - -#define GLD_SETUP_FOG \ - pV->diffuse = _gldComputeFog(ctx, swv) - -#define GLD_SETUP_TEX0 \ - pV->t0_u = swv->texcoord[0][0]; \ - pV->t0_v = swv->texcoord[0][1] - -#define GLD_SETUP_TEX1 \ - pV->t1_u = swv->texcoord[1][0]; \ - pV->t1_v = swv->texcoord[1][1] - -#define GLD_SETUP_LIGHTING(v) \ - if (facing == 1) { \ - pV->diffuse = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \ - if (vbspec) { \ - pV->specular = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \ - } \ - } else { \ - if (bFog) \ - GLD_SETUP_FOG; \ - else \ - GLD_SETUP_SMOOTH_COLOUR; \ - GLD_SETUP_SPECULAR; \ - } - -#define GLD_SETUP_GET_FLAT_LIGHTING(v) \ - if (facing == 1) { \ - dwFlatColour = D3DCOLOR_RGBA(vbcolor[##v][0], vbcolor[##v][1], vbcolor[##v][2], vbcolor[##v][3]); \ - if (vbspec) { \ - dwSpecularColour = D3DCOLOR_RGBA(vbspec[##v][0], vbspec[##v][1], vbspec[##v][2], vbspec[##v][3]); \ - } \ - } - -#define GLD_SETUP_TWOSIDED_LIGHTING \ - /* Two-sided lighting */ \ - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { \ - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; \ - SWvertex *v[3]; \ - GLfloat ex,ey,fx,fy,cc; \ - /* Get vars for later */ \ - VB = &TNL_CONTEXT(ctx)->vb; \ - vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ - if (VB->SecondaryColorPtr[1]) { \ - vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ - } else { \ - vbspec = NULL; \ - } \ - v[0] = &verts[v0]; \ - v[1] = &verts[v1]; \ - v[2] = &verts[v2]; \ - ex = v[0]->win[0] - v[2]->win[0]; \ - ey = v[0]->win[1] - v[2]->win[1]; \ - fx = v[1]->win[0] - v[2]->win[0]; \ - fy = v[1]->win[1] - v[2]->win[1]; \ - cc = ex*fy - ey*fx; \ - facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; \ - } - -//--------------------------------------------------------------------------- -// 3D vertex setup -//--------------------------------------------------------------------------- - -#define GLD_SETUP_3D_VARS_POINTS \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pPoints; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VARS_LINES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pLines; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VARS_TRIANGLES \ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); \ - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); \ - GLD_3D_VERTEX *pV = (GLD_3D_VERTEX*)gld->PB3d.pTriangles; \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - GLfloat (*p4f)[4]; \ - GLfloat (*tc)[4]; \ - DWORD dwColor; - -#define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ - pV->Position.x = p4f[##v][0]; \ - pV->Position.y = p4f[##v][1]; \ - pV->Position.z = p4f[##v][2]; - -#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ - pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); - - -#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ - dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); - -#define GLD_SETUP_USE_FLAT_COLOUR_3D \ - pV->Diffuse = dwColor; - -#define GLD_SETUP_TEX0_3D(v) \ - if (VB->TexCoordPtr[0]) { \ - tc = VB->TexCoordPtr[0]->data; \ - pV->TexUnit0.x = tc[##v][0]; \ - pV->TexUnit0.y = tc[##v][1]; \ - } - -#define GLD_SETUP_TEX1_3D(v) \ - if (VB->TexCoordPtr[1]) { \ - tc = VB->TexCoordPtr[1]->data; \ - pV->TexUnit1.x = tc[##v][0]; \ - pV->TexUnit1.y = tc[##v][1]; \ - } - -//--------------------------------------------------------------------------- -// Helper functions -//--------------------------------------------------------------------------- - -__inline DWORD _gldComputeFog( - GLcontext *ctx, - SWvertex *swv) -{ - // Full fog calculation. - // Based on Mesa code. - - GLchan rFog, gFog, bFog; - GLchan fR, fG, fB; - const GLfloat f = swv->fog; - const GLfloat g = 1.0 - f; - - UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]); - fR = f * swv->color[0] + g * rFog; - fG = f * swv->color[1] + g * gFog; - fB = f * swv->color[2] + g * bFog; - return D3DCOLOR_RGBA(fR, fG, fB, swv->color[3]); -} - -//--------------------------------------------------------------------------- - -void gld_ResetLineStipple_DX9( - GLcontext *ctx) -{ - // TODO: Fake stipple with a 32x32 texture. -} - -//--------------------------------------------------------------------------- -// 2D (post-transformed) primitives -//--------------------------------------------------------------------------- - -void gld_Points2D_DX9( - GLcontext *ctx, - GLuint first, - GLuint last) -{ - GLD_SETUP_2D_VARS_POINTS; - - unsigned i; - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - // _Size is already clamped to MaxPointSize and MinPointSize - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size)); - - if (VB->Elts) { - for (i=first; iClipMask[VB->Elts[i]] == 0) { -// _swrast_Point( ctx, &verts[VB->Elts[i]] ); - GLD_SETUP_GET_SWVERT(VB->Elts[i]); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - } - } - } else { - GLD_SETUP_GET_SWVERT(first); - for (i=first; iClipMask[i] == 0) { -// _swrast_Point( ctx, &verts[i] ); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - } - } - } - - gld->PB2d.pPoints = (BYTE*)pV; - gld->PB2d.nPoints += (last-first); -} - -//--------------------------------------------------------------------------- - -void gld_Line2DFlat_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_2D_VARS_LINES; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pLines = (BYTE*)pV; - gld->PB2d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Line2DSmooth_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_2D_VARS_LINES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_SPECULAR; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_SPECULAR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pLines = (BYTE*)pV; - gld->PB2d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlat_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - pV++;; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmooth_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlatExtras_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v2); - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - if (bFog) - GLD_SETUP_GET_FLAT_FOG_COLOUR; - else - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_GET_FLAT_LIGHTING(v2); - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmoothExtras_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v0); - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v1); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlat_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmooth_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_SMOOTH_COLOUR; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlatExtras_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v3); - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - if (bFog) - GLD_SETUP_GET_FLAT_FOG_COLOUR; - else - GLD_SETUP_GET_FLAT_COLOUR; - GLD_SETUP_GET_FLAT_SPECULAR; - GLD_SETUP_GET_FLAT_LIGHTING(v3); - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_USE_FLAT_COLOUR; - GLD_SETUP_USE_FLAT_SPECULAR; - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmoothExtras_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_2D_VARS_TRIANGLES; - - GLD_SETUP_TWOSIDED_LIGHTING(v0); - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - GLD_SETUP_GET_SWVERT(v1); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v1); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - GLD_SETUP_GET_SWVERT(v2); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v2); - pV++; - - GLD_SETUP_GET_SWVERT(v3); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v3); - pV++; - - GLD_SETUP_GET_SWVERT(v0); - GLD_SETUP_2D_VERTEX; - GLD_SETUP_DEPTH; - GLD_SETUP_TEX0; - GLD_SETUP_TEX1; - GLD_SETUP_LIGHTING(v0); - pV++; - - gld->PB2d.pTriangles = (BYTE*)pV; - gld->PB2d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- -// 3D (pre-transformed) primitives -//--------------------------------------------------------------------------- - -void gld_Points3D_DX9( - GLcontext *ctx, - GLuint first, - GLuint last) -{ - GLD_SETUP_3D_VARS_POINTS - - unsigned i; -// struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - // _Size is already clamped to MaxPointSize and MinPointSize - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_POINTSIZE, *((DWORD*)&ctx->Point._Size)); - - if (VB->Elts) { - for (i=first; iClipMask[VB->Elts[i]] == 0) { -// _swrast_Point( ctx, &verts[VB->Elts[i]] ); -// GLD_SETUP_GET_SWVERT(VB->Elts[i]); - GLD_SETUP_3D_VERTEX(VB->Elts[i]) - GLD_SETUP_SMOOTH_COLOUR_3D(i) - GLD_SETUP_TEX0_3D(i) - GLD_SETUP_TEX1_3D(i) - } - } - } else { -// GLD_SETUP_GET_SWVERT(first); - for (i=first; iClipMask[i] == 0) { -// _swrast_Point( ctx, &verts[i] ); - GLD_SETUP_3D_VERTEX(i) - GLD_SETUP_SMOOTH_COLOUR_3D(i) - GLD_SETUP_TEX0_3D(i) - GLD_SETUP_TEX1_3D(i) - } - } - } -/* - for (i=first; iPB3d.pPoints = (BYTE*)pV; - gld->PB3d.nPoints += (last-first); -} - -//--------------------------------------------------------------------------- -// Line functions -//--------------------------------------------------------------------------- - -void gld_Line3DFlat_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_3D_VARS_LINES - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_GET_FLAT_COLOUR_3D(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pLines = (BYTE*)pV; - gld->PB3d.nLines++; -} - -//--------------------------------------------------------------------------- - -void gld_Line3DSmooth_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1) -{ - GLD_SETUP_3D_VARS_LINES - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pLines = (BYTE*)pV; - gld->PB3d.nLines++; -} - -//--------------------------------------------------------------------------- -// Triangle functions -//--------------------------------------------------------------------------- - -void gld_Triangle3DFlat_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - GLD_SETUP_GET_FLAT_COLOUR_3D(v2) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Triangle3DSmooth_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles++; -} - -//--------------------------------------------------------------------------- -// Quad functions -//--------------------------------------------------------------------------- - -void gld_Quad3DFlat_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_GET_FLAT_COLOUR_3D(v3) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_USE_FLAT_COLOUR_3D - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad3DSmooth_DX9( - GLcontext *ctx, - GLuint v0, - GLuint v1, - GLuint v2, - GLuint v3) -{ - GLD_SETUP_3D_VARS_TRIANGLES - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - GLD_SETUP_3D_VERTEX(v1) - GLD_SETUP_SMOOTH_COLOUR_3D(v1) - GLD_SETUP_TEX0_3D(v1) - GLD_SETUP_TEX1_3D(v1) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v2) - GLD_SETUP_SMOOTH_COLOUR_3D(v2) - GLD_SETUP_TEX0_3D(v2) - GLD_SETUP_TEX1_3D(v2) - pV++; - - GLD_SETUP_3D_VERTEX(v3) - GLD_SETUP_SMOOTH_COLOUR_3D(v3) - GLD_SETUP_TEX0_3D(v3) - GLD_SETUP_TEX1_3D(v3) - pV++; - - GLD_SETUP_3D_VERTEX(v0) - GLD_SETUP_SMOOTH_COLOUR_3D(v0) - GLD_SETUP_TEX0_3D(v0) - GLD_SETUP_TEX1_3D(v0) - pV++; - - gld->PB3d.pTriangles = (BYTE*)pV; - gld->PB3d.nTriangles += 2; -} - -//--------------------------------------------------------------------------- -// Vertex setup for two-sided-lighting vertex shader -//--------------------------------------------------------------------------- - -/* - -void gld_Points2DTwoside_DX9(GLcontext *ctx, GLuint first, GLuint last) -{ - // NOTE: Two-sided lighting does not apply to Points -} - -//--------------------------------------------------------------------------- - -void gld_Line2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1) -{ - // NOTE: Two-sided lighting does not apply to Lines -} - -//--------------------------------------------------------------------------- - -void gld_Line2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1) -{ - // NOTE: Two-sided lighting does not apply to Lines -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2) -{ -} - -//--------------------------------------------------------------------------- - -void gld_Triangle2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles++; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DFlatTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 4th vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 5th vert - swv = &ss->verts[v3]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 6th vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -void gld_Quad2DSmoothTwoside_DX9(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - GLD_TWOSIDED_VERTEX *pV = (GLD_TWOSIDED_VERTEX*)gld->PBtwosidelight.pTriangles; - SScontext *ss = SWSETUP_CONTEXT(ctx); - SWvertex *swv; - DWORD dwSpecularColour; - DWORD dwFlatColour; - GLuint facing = 0; - struct vertex_buffer *VB; - GLchan (*vbcolor)[4]; - GLchan (*vbspec)[4]; - - // Reciprocal of DepthMax - const float ooDepthMax = 1.0f / ctx->DepthMaxF; - - // 1st vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 2nd vert - swv = &ss->verts[v1]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 3rd vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 4th vert - swv = &ss->verts[v2]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 5th vert - swv = &ss->verts[v3]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - // 6th vert - swv = &ss->verts[v0]; - pV->Position.x = swv->win[0]; - pV->Position.y = GLD_FLIP_Y(swv->win[1]); - pV->Position.z = swv->win[2] * ooDepthMax; - pV->Position.w = swv->win[3]; - pV->TexUnit0.x = swv->texcoord[0][0]; - pV->TexUnit0.y = swv->texcoord[0][1]; - pV->TexUnit1.x = swv->texcoord[1][0]; - pV->TexUnit1.y = swv->texcoord[1][1]; - pV->FrontDiffuse = GLD_COLOUR; - pV->FrontSpecular = GLD_SPECULAR; - pV++; - - gld->PBtwosidelight.pTriangles = (BYTE*)pV; - gld->PBtwosidelight.nTriangles += 2; -} - -//--------------------------------------------------------------------------- - -*/ diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c deleted file mode 100644 index 5a8223561..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_texture_dx9.c +++ /dev/null @@ -1,2104 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Texture / Bitmap functions -* -****************************************************************************/ - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx9.h" - -#include - -#include "texformat.h" -#include "colormac.h" -#include "texstore.h" -#include "image.h" -// #include "mem.h" - -//--------------------------------------------------------------------------- - -#define GLD_FLIP_HEIGHT(y,h) (gldCtx->dwHeight - (y) - (h)) - -//--------------------------------------------------------------------------- -// 1D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + (i) * (sz)) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (i) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (i)) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + (i)) - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_1d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// 2D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz)) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + ((t)->Width * (j) + (i))) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i))) - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_2d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// 3D texture fetch -//--------------------------------------------------------------------------- - -#define CHAN_SRC( t, i, j, k, sz ) \ - (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i)) * (sz) -#define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i))) -#define FLOAT_SRC( t, i, j, k ) \ - ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \ - (t)->Width + (i))) - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - GLchan *rgba = (GLchan *)texel; - rgba[RCOMP] = src[2]; - rgba[GCOMP] = src[1]; - rgba[BCOMP] = src[0]; - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X8R8G8B8( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf8) * 255 / 0xf8 ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X1R5G5B5( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 10) & 0xf8) * 255 / 0xf8 ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 5) & 0xf8) * 255 / 0xf8 ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf8) * 255 / 0xf8 ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLchan *rgba = (GLchan *) texel; GLushort s = *src; - rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); - rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); - rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); - rgba[ACOMP] = CHAN_MAX; -} - -//--------------------------------------------------------------------------- - -static void gld_fetch_3d_texel_f_X4R4G4B4( - const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = USHORT_SRC( texImage, i, j, k ); - GLushort s = *src; - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf) * 255 / 0xf ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 4) & 0xf) * 255 / 0xf ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s ) & 0xf) * 255 / 0xf ); - texel[ACOMP] = 1.f; -} - -//--------------------------------------------------------------------------- - -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef FLOAT_SRC - -//--------------------------------------------------------------------------- -// Direct3D texture formats that have no Mesa equivalent -//--------------------------------------------------------------------------- - -const struct gl_texture_format _gld_texformat_X8R8G8B8 = { - MESA_FORMAT_ARGB8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X8R8G8B8, /* FetchTexel1D */ - gld_fetch_2d_texel_X8R8G8B8, /* FetchTexel2D */ - gld_fetch_3d_texel_X8R8G8B8, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X8R8G8B8, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X8R8G8B8, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X8R8G8B8, /* FetchTexel3Df */ -}; - -const struct gl_texture_format _gld_texformat_X1R5G5B5 = { - MESA_FORMAT_ARGB1555, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X1R5G5B5, /* FetchTexel1D */ - gld_fetch_2d_texel_X1R5G5B5, /* FetchTexel2D */ - gld_fetch_3d_texel_X1R5G5B5, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X1R5G5B5, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X1R5G5B5, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X1R5G5B5, /* FetchTexel3Df */ -}; - -const struct gl_texture_format _gld_texformat_X4R4G4B4 = { - MESA_FORMAT_ARGB4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - gld_fetch_1d_texel_X4R4G4B4, /* FetchTexel1D */ - gld_fetch_2d_texel_X4R4G4B4, /* FetchTexel2D */ - gld_fetch_3d_texel_X4R4G4B4, /* FetchTexel3D */ - gld_fetch_1d_texel_f_X4R4G4B4, /* FetchTexel1Df */ - gld_fetch_2d_texel_f_X4R4G4B4, /* FetchTexel2Df */ - gld_fetch_3d_texel_f_X4R4G4B4, /* FetchTexel3Df */ -}; - -//--------------------------------------------------------------------------- -// Texture unit constants -//--------------------------------------------------------------------------- - -// List of possible combinations of texture environments. -// Example: GLD_TEXENV_MODULATE_RGBA means -// GL_MODULATE, GL_RGBA base internal format. -#define GLD_TEXENV_DECAL_RGB 0 -#define GLD_TEXENV_DECAL_RGBA 1 -#define GLD_TEXENV_DECAL_ALPHA 2 -#define GLD_TEXENV_REPLACE_RGB 3 -#define GLD_TEXENV_REPLACE_RGBA 4 -#define GLD_TEXENV_REPLACE_ALPHA 5 -#define GLD_TEXENV_MODULATE_RGB 6 -#define GLD_TEXENV_MODULATE_RGBA 7 -#define GLD_TEXENV_MODULATE_ALPHA 8 -#define GLD_TEXENV_BLEND_RGB 9 -#define GLD_TEXENV_BLEND_RGBA 10 -#define GLD_TEXENV_BLEND_ALPHA 11 -#define GLD_TEXENV_ADD_RGB 12 -#define GLD_TEXENV_ADD_RGBA 13 -#define GLD_TEXENV_ADD_ALPHA 14 - -// Per-stage (i.e. per-unit) texture environment -typedef struct { - DWORD ColorArg1; // Colour argument 1 - D3DTEXTUREOP ColorOp; // Colour operation - DWORD ColorArg2; // Colour argument 2 - DWORD AlphaArg1; // Alpha argument 1 - D3DTEXTUREOP AlphaOp; // Alpha operation - DWORD AlphaArg2; // Alpha argument 2 -} GLD_texenv; - -// TODO: Do we really need to set ARG1 and ARG2 every time? -// They seem to always be TEXTURE and CURRENT respectively. - -// C = Colour out -// A = Alpha out -// Ct = Colour from Texture -// Cf = Colour from fragment (diffuse) -// At = Alpha from Texture -// Af = Alpha from fragment (diffuse) -// Cc = GL_TEXTURE_ENV_COLOUR (GL_BLEND) -const GLD_texenv gldTexEnv[] = { - // DECAL_RGB: C=Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // DECAL_RGBA: C=Cf(1-At)+CtAt, A=Af - {D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // DECAL_ALPHA: use DECAL_RGB - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - - // REPLACE_RGB: C=Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // REPLACE_RGBA: C=Ct, A=At - {D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT}, - // REPLACE_ALPHA: C=Cf, A=At - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG1, D3DTA_CURRENT}, - - // MODULATE_RGB: C=CfCt, A=Af - {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // MODULATE_RGBA: C=CfCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // MODULATE_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - - // BLEND_RGB: C=Cf(1-Ct)+CcCt, A=Af - {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // BLEND_RGBA: C=Cf(1-Ct)+CcCt, A=AfAt - {D3DTA_TEXTURE, D3DTOP_LERP, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // BLEND_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - - // ADD_RGB: C=Cf+Ct, A=Af - {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT}, - // ADD_RGBA: C=Cf+Ct, A=AfAt - {D3DTA_TEXTURE, D3DTOP_ADD, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, - // ADD_ALPHA: C=Cf, A=AfAt - {D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_CURRENT, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT}, -}; - -//--------------------------------------------------------------------------- - -D3DTEXTUREADDRESS _gldConvertWrap( - GLenum wrap) -{ - return (wrap == GL_CLAMP) ? D3DTADDRESS_CLAMP : D3DTADDRESS_WRAP; -} - -//--------------------------------------------------------------------------- - -D3DTEXTUREFILTERTYPE _gldConvertMagFilter( - GLenum magfilter) -{ - return (magfilter == GL_LINEAR) ? D3DTEXF_LINEAR : D3DTEXF_POINT; -} - -//--------------------------------------------------------------------------- - -void _gldConvertMinFilter( - GLenum minfilter, - D3DTEXTUREFILTERTYPE *min_filter, - D3DTEXTUREFILTERTYPE *mip_filter) -{ - switch (minfilter) { - case GL_NEAREST: - *min_filter = D3DTEXF_POINT; - *mip_filter = D3DTEXF_NONE; - break; - case GL_LINEAR: - *min_filter = D3DTEXF_LINEAR; - *mip_filter = D3DTEXF_NONE; - break; - case GL_NEAREST_MIPMAP_NEAREST: - *min_filter = D3DTEXF_POINT; - *mip_filter = D3DTEXF_POINT; - break; - case GL_LINEAR_MIPMAP_NEAREST: - *min_filter = D3DTEXF_LINEAR; - *mip_filter = D3DTEXF_POINT; - break; - case GL_NEAREST_MIPMAP_LINEAR: - *min_filter = D3DTEXF_POINT; - *mip_filter = D3DTEXF_LINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - *min_filter = D3DTEXF_LINEAR; - *mip_filter = D3DTEXF_LINEAR; - break; - } -} - -//--------------------------------------------------------------------------- - -D3DFORMAT _gldGLFormatToD3DFormat( - GLenum internalFormat) -{ - switch (internalFormat) { - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - // LUNIMANCE != INTENSITY, but D3D doesn't have I8 textures - return D3DFMT_L8; - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return D3DFMT_L8; - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return D3DFMT_A8; - 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 D3DFMT_X8R8G8B8; - 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 D3DFMT_A8L8; - case GL_R3_G3_B2: - // TODO: Mesa does not support RGB332 internally - return D3DFMT_X4R4G4B4; //D3DFMT_R3G3B2; - case GL_RGB4: - return D3DFMT_X4R4G4B4; - case GL_RGB5: - return D3DFMT_X1R5G5B5; - case 3: - case GL_RGB: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return D3DFMT_R8G8B8; - case GL_RGBA4: - return D3DFMT_A4R4G4B4; - case 4: - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return D3DFMT_A8R8G8B8; - case GL_RGB5_A1: - return D3DFMT_A1R5G5B5; - } - - // Return an acceptable default - return D3DFMT_A8R8G8B8; -} - -//--------------------------------------------------------------------------- - -GLenum _gldDecodeBaseFormat( - IDirect3DTexture9 *pTex) -{ - // Examine Direct3D texture and return base OpenGL internal texture format - // NOTE: We can't use any base format info from Mesa because D3D might have - // used a different texture format when we used D3DXCreateTexture(). - - // Base internal format is one of (Red Book p355): - // GL_ALPHA, - // GL_LUMINANCE, - // GL_LUMINANCE_ALPHA, - // GL_INTENSITY, - // GL_RGB, - // GL_RGBA - - // NOTE: INTENSITY not used (not supported by Direct3D) - // LUMINANCE has same texture functions as RGB - // LUMINANCE_ALPHA has same texture functions as RGBA - - // TODO: cache format instead of using GetLevelDesc() - D3DSURFACE_DESC desc; - _GLD_DX9_TEX(GetLevelDesc(pTex, 0, &desc)); - - switch (desc.Format) { - case D3DFMT_R8G8B8: - case D3DFMT_X8R8G8B8: - case D3DFMT_R5G6B5: - case D3DFMT_X1R5G5B5: - case D3DFMT_R3G3B2: - case D3DFMT_X4R4G4B4: - case D3DFMT_P8: - case D3DFMT_L8: - return GL_RGB; - case D3DFMT_A8R8G8B8: - case D3DFMT_A1R5G5B5: - case D3DFMT_A4R4G4B4: - case D3DFMT_A8R3G3B2: - case D3DFMT_A8P8: - case D3DFMT_A8L8: - case D3DFMT_A4L4: - return GL_RGBA; - case D3DFMT_A8: - return GL_ALPHA; - // Compressed texture formats. Need to check these... - case D3DFMT_DXT1: - return GL_RGBA; - case D3DFMT_DXT2: - return GL_RGB; - case D3DFMT_DXT3: - return GL_RGBA; - case D3DFMT_DXT4: - return GL_RGB; - case D3DFMT_DXT5: - return GL_RGBA; - } - - // Fell through. Return arbitary default. - return GL_RGBA; -} - -//--------------------------------------------------------------------------- - -const struct gl_texture_format* _gldMesaFormatForD3DFormat( - D3DFORMAT d3dfmt) -{ - switch (d3dfmt) { - case D3DFMT_A8R8G8B8: - return &_mesa_texformat_argb8888; - case D3DFMT_R8G8B8: - return &_mesa_texformat_rgb888; - case D3DFMT_R5G6B5: - return &_mesa_texformat_rgb565; - case D3DFMT_A4R4G4B4: - return &_mesa_texformat_argb4444; - case D3DFMT_A1R5G5B5: - return &_mesa_texformat_argb1555; - case D3DFMT_A8L8: - return &_mesa_texformat_al88; - case D3DFMT_R3G3B2: - return &_mesa_texformat_rgb332; - case D3DFMT_A8: - return &_mesa_texformat_a8; - case D3DFMT_L8: - return &_mesa_texformat_l8; - case D3DFMT_X8R8G8B8: - return &_gld_texformat_X8R8G8B8; - case D3DFMT_X1R5G5B5: - return &_gld_texformat_X1R5G5B5; - case D3DFMT_X4R4G4B4: - return &_gld_texformat_X4R4G4B4; - } - - // If we reach here then we've made an error somewhere else - // by allowing a format that is not supported. - assert(0); - - return NULL; // Shut up compiler warning -} - -//--------------------------------------------------------------------------- -// Copy* functions -//--------------------------------------------------------------------------- - -void gldCopyTexImage1D_DX9( - GLcontext *ctx, - GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLint border ) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexImage2D_DX9( - GLcontext *ctx, - GLenum target, - GLint level, - GLenum internalFormat, - GLint x, - GLint y, - GLsizei width, - GLsizei height, - GLint border) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage1D_DX9( - GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage2D_DX9( - GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint x, - GLint y, - GLsizei width, - GLsizei height) -{ - // TODO -} - -//--------------------------------------------------------------------------- - -void gldCopyTexSubImage3D_DX9( - GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint zoffset, - GLint x, - GLint y, - GLsizei width, - GLsizei height ) -{ - // TODO ? -} - -//--------------------------------------------------------------------------- -// Bitmap/Pixel functions -//--------------------------------------------------------------------------- - -#define GLD_FLIP_Y(y) (gldCtx->dwHeight - (y)) - -#define _GLD_FVF_IMAGE (D3DFVF_XYZRHW | D3DFVF_TEX1) - -typedef struct { - FLOAT x, y; // 2D raster coords - FLOAT z; // depth value - FLOAT rhw; // reciprocal homogenous W (always 1.0f) - FLOAT tu, tv; // texture coords -} _GLD_IMAGE_VERTEX; - -//--------------------------------------------------------------------------- - -HRESULT _gldDrawPixels( - GLcontext *ctx, - BOOL bChromakey, // Alpha test for glBitmap() images - GLint x, // GL x position - GLint y, // GL y position (needs flipping) - GLsizei width, // Width of input image - GLsizei height, // Height of input image - IDirect3DSurface9 *pImage) -{ - // - // Draw input image as texture implementing PixelZoom and clipping. - // Any fragment operations currently enabled will be used. - // - - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - IDirect3DTexture9 *pTexture; - D3DSURFACE_DESC d3dsd; - IDirect3DSurface9 *pSurface; - _GLD_IMAGE_VERTEX v[4]; - HRESULT hr; - - float ZoomWidth, ZoomHeight; - float ScaleWidth, ScaleHeight; - - // Create a texture to hold image - hr = D3DXCreateTexture( - gld->pDev, - width, height, - 1, // miplevels - 0, // usage - D3DFMT_A8R8G8B8, // format - D3DPOOL_MANAGED, // pool - &pTexture); - if (FAILED(hr)) - return hr; - - hr = IDirect3DTexture9_GetSurfaceLevel(pTexture, 0, &pSurface); - if (FAILED(hr)) { - IDirect3DTexture9_Release(pTexture); - return hr; - } - - // Copy image into texture - hr = D3DXLoadSurfaceFromSurface( - pSurface, NULL, NULL, // Dest surface - pImage, NULL, NULL, // Src surface - D3DX_FILTER_NONE, - 0); - IDirect3DSurface9_Release(pSurface); - if (FAILED(hr)) { - IDirect3DTexture9_Release(pTexture); - return hr; - } - - // - // Set up the quad like this (ascii-art ahead!) - // - // 3--2 - // | | - // 0--1 - // - // - - // Set depth - v[0].z = v[1].z = v[2].z = v[3].z = ctx->Current.RasterPos[2]; - // Set Reciprocal Homogenous W - v[0].rhw = v[1].rhw = v[2].rhw = v[3].rhw = 1.0f; - - // Set texcoords - // Examine texture size - if different to input width and height - // then we'll need to munge the texcoords to fit. - IDirect3DTexture9_GetLevelDesc(pTexture, 0, &d3dsd); - ScaleWidth = (float)width / (float)d3dsd.Width; - ScaleHeight = (float)height / (float)d3dsd.Height; - v[0].tu = 0.0f; v[0].tv = 0.0f; - v[1].tu = ScaleWidth; v[1].tv = 0.0f; - v[2].tu = ScaleWidth; v[2].tv = ScaleHeight; - v[3].tu = 0.0f; v[3].tv = ScaleHeight; - - // Set raster positions - ZoomWidth = (float)width * ctx->Pixel.ZoomX; - ZoomHeight = (float)height * ctx->Pixel.ZoomY; - - v[0].x = x; v[0].y = GLD_FLIP_Y(y); - v[1].x = x+ZoomWidth; v[1].y = GLD_FLIP_Y(y); - v[2].x = x+ZoomWidth; v[2].y = GLD_FLIP_Y(y+ZoomHeight); - v[3].x = x; v[3].y = GLD_FLIP_Y(y+ZoomHeight); - - // Draw image with full HW acceleration - // NOTE: Be nice to use a State Block for all this state... - IDirect3DDevice9_SetTexture(gld->pDev, 0, pTexture); - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE); - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CLIPPING, TRUE); - -// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MINFILTER, D3DTEXF_POINT); -// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT); -// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT); -// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP); -// IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP); - IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MINFILTER, D3DTEXF_POINT); - IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); - IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); - IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); - IDirect3DDevice9_SetSamplerState(gld->pDev, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); - - IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - IDirect3DDevice9_SetTextureStageState(gld->pDev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - IDirect3DDevice9_SetTextureStageState(gld->pDev, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - IDirect3DDevice9_SetTextureStageState(gld->pDev, 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - IDirect3DDevice9_SetVertexShader(gld->pDev, NULL); - IDirect3DDevice9_SetFVF(gld->pDev, _GLD_FVF_IMAGE); - - // - // Emulate Chromakey with an Alpha Test. - // [Alpha Test is more widely supported anyway] - // - if (bChromakey) { - // Switch on alpha testing - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHATESTENABLE, TRUE); - // Fragment passes is alpha is greater than reference value - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHAFUNC, D3DCMP_GREATER); - // Set alpha reference value between Bitmap alpha values of - // zero (transparent) and one (opaque). - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ALPHAREF, 0x7f); - } - - IDirect3DDevice9_DrawPrimitiveUP(gld->pDev, D3DPT_TRIANGLEFAN, 2, &v, sizeof(_GLD_IMAGE_VERTEX)); - - // Release texture - IDirect3DDevice9_SetTexture(gld->pDev, 0, NULL); - IDirect3DTexture9_Release(pTexture); - - // Reset state to before we messed it up - FLUSH_VERTICES(ctx, _NEW_ALL); - - return S_OK; -} - -//--------------------------------------------------------------------------- - -void gld_DrawPixels_DX9( - GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - GLD_context *gldCtx; - GLD_driver_dx9 *gld; - - IDirect3DSurface9 *pImage; - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - - const struct gl_texture_format *MesaFormat; - - MesaFormat = _mesa_choose_tex_format(ctx, format, format, type); - - // Mesa does not currently handle this format. - if (format == GL_BGR) - return; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX9_DRIVER(gldCtx); - - hr = IDirect3DDevice9_CreateOffscreenPlainSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - D3DPOOL_SCRATCH, - &pImage, - NULL); - if (FAILED(hr)) { - return; - } - - // - // Use Mesa to fill in image - // - - // Lock all of surface - hr = IDirect3DSurface9_LockRect(pImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pImage); - return; - } - - // unpack image, apply transfer ops and store directly in texture - MesaFormat->StoreImage( - ctx, - 2, - GL_RGBA, - &_mesa_texformat_argb8888, - d3dLockedRect.pBits, - width, height, 1, 0, 0, 0, - d3dLockedRect.Pitch, - 0, /* dstImageStride */ - format, type, pixels, unpack); - - IDirect3DSurface9_UnlockRect(pImage); - - _gldDrawPixels(ctx, FALSE, x, y, width, height, pImage); - - IDirect3DSurface9_Release(pImage); -} - -//--------------------------------------------------------------------------- - -void gld_ReadPixels_DX9( - GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest) -{ - - GLD_context *gldCtx; - GLD_driver_dx9 *gld; - - IDirect3DSurface9 *pBackbuffer = NULL; - IDirect3DSurface9 *pNativeImage = NULL; - IDirect3DSurface9 *pCanonicalImage = NULL; - - D3DSURFACE_DESC d3dsd; - RECT rcSrc; // Source rect - POINT ptDst; // Dest point - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - struct gl_pixelstore_attrib srcPacking; - int i; - GLint DstRowStride; - const struct gl_texture_format *MesaFormat; - - switch (format) { - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - return; - } - - MesaFormat = _mesa_choose_tex_format(ctx, format, format, type); - DstRowStride = _mesa_image_row_stride(pack, width, format, type); - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX9_DRIVER(gldCtx); - - // Get backbuffer - hr = IDirect3DDevice9_GetBackBuffer( - gld->pDev, - 0, // First swapchain - 0, // First backbuffer - D3DBACKBUFFER_TYPE_MONO, - &pBackbuffer); - if (FAILED(hr)) - return; - - // Get backbuffer description - hr = IDirect3DSurface9_GetDesc(pBackbuffer, &d3dsd); - if (FAILED(hr)) { - goto gld_ReadPixels_DX9_return; - } - - // Create a surface compatible with backbuffer - hr = IDirect3DDevice9_CreateOffscreenPlainSurface( - gld->pDev, - width, - height, - d3dsd.Format, - D3DPOOL_SCRATCH, - &pNativeImage, - NULL); - if (FAILED(hr)) { - goto gld_ReadPixels_DX9_return; - } - - // Compute source rect and dest point - SetRect(&rcSrc, 0, 0, width, height); - OffsetRect(&rcSrc, x, GLD_FLIP_HEIGHT(y, height)); - ptDst.x = ptDst.y = 0; - - // Get source pixels. - // - // This intermediate surface ensure that we can use CopyRects() - // instead of relying on D3DXLoadSurfaceFromSurface(), which may - // try and lock the backbuffer. This way seems safer. - // - // CopyRects has been removed for DX9. - // -/* hr = IDirect3DDevice9_CopyRects( - gld->pDev, - pBackbuffer, - &rcSrc, - 1, - pNativeImage, - &ptDst);*/ - hr = D3DXLoadSurfaceFromSurface( - pNativeImage, // Dest surface - NULL, // Dest palette - &rcSrc, // Dest rect - pBackbuffer, // Src surface - NULL, // Src palette - &rcSrc, // Src rect - D3DX_FILTER_NONE, // Filter - 0 // Colorkey (0=no colorkey) - ); - if (FAILED(hr)) { - goto gld_ReadPixels_DX9_return; - } - - // Create an RGBA8888 surface - hr = IDirect3DDevice9_CreateOffscreenPlainSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - D3DPOOL_SCRATCH, - &pCanonicalImage, - NULL); - if (FAILED(hr)) { - goto gld_ReadPixels_DX9_return; - } - - // Convert to RGBA8888 - hr = D3DXLoadSurfaceFromSurface( - pCanonicalImage, // Dest surface - NULL, NULL, // Dest palette, RECT - pNativeImage, // Src surface - NULL, NULL, // Src palette, RECT - D3DX_FILTER_NONE, // Filter - 0); // Colourkey - if (FAILED(hr)) { - goto gld_ReadPixels_DX9_return; - } - - srcPacking.Alignment = 1; - srcPacking.ImageHeight = height; - srcPacking.LsbFirst = GL_FALSE; - srcPacking.RowLength = 0; - srcPacking.SkipImages = 0; - srcPacking.SkipPixels = 0; - srcPacking.SkipRows = 0; - srcPacking.SwapBytes = GL_FALSE; - - // Lock all of image - hr = IDirect3DSurface9_LockRect(pCanonicalImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - goto gld_ReadPixels_DX9_return; - } - - // We need to flip the data. Yuck. - // Perhaps Mesa has a span packer we can use in future... - for (i=0; iStoreImage( - ctx, - 2, - GL_RGBA, // base format - MesaFormat, // dst format - pDestRow, // dest addr - width, 1, 1, 0, 0, 0, // src x,y,z & dst offsets x,y,z - DstRowStride, // dst row stride - 0, // dstImageStride - GL_BGRA, // src format - GL_UNSIGNED_BYTE, // src type - pSrcRow, // src addr - &srcPacking); // packing params of source image - } - - IDirect3DSurface9_UnlockRect(pCanonicalImage); - -gld_ReadPixels_DX9_return: - SAFE_RELEASE_SURFACE9(pCanonicalImage); - SAFE_RELEASE_SURFACE9(pNativeImage); - SAFE_RELEASE_SURFACE9(pBackbuffer); -} - -//--------------------------------------------------------------------------- - -void gld_CopyPixels_DX9( - GLcontext *ctx, - GLint srcx, - GLint srcy, - GLsizei width, - GLsizei height, - GLint dstx, - GLint dsty, - GLenum type) -{ - // - // NOTE: Not allowed to copy vidmem to vidmem! - // Therefore we use an intermediate image surface. - // - - GLD_context *gldCtx; - GLD_driver_dx9 *gld; - - IDirect3DSurface9 *pBackbuffer; - D3DSURFACE_DESC d3dsd; - IDirect3DSurface9 *pImage; - RECT rcSrc; // Source rect - POINT ptDst; // Dest point - HRESULT hr; - - // Only backbuffer - if (type != GL_COLOR) - return; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX9_DRIVER(gldCtx); - - // Get backbuffer - hr = IDirect3DDevice9_GetBackBuffer( - gld->pDev, - 0, // First swapchain - 0, // First backbuffer - D3DBACKBUFFER_TYPE_MONO, - &pBackbuffer); - if (FAILED(hr)) - return; - - // Get backbuffer description - hr = IDirect3DSurface9_GetDesc(pBackbuffer, &d3dsd); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pBackbuffer); - return; - } - - // Create a surface compatible with backbuffer - hr = IDirect3DDevice9_CreateOffscreenPlainSurface( - gld->pDev, - width, - height, - d3dsd.Format, - D3DPOOL_SCRATCH, - &pImage, - NULL); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pBackbuffer); - return; - } - - // Compute source rect and dest point - SetRect(&rcSrc, 0, 0, width, height); - OffsetRect(&rcSrc, srcx, GLD_FLIP_HEIGHT(srcy, height)); - ptDst.x = ptDst.y = 0; - - // Get source pixels -/* hr = IDirect3DDevice8_CopyRects( - gld->pDev, - pBackbuffer, - &rcSrc, - 1, - pImage, - &ptDst);*/ - hr = D3DXLoadSurfaceFromSurface( - pImage, // Dest surface - NULL, // Dest palette - &rcSrc, // Dest rect - pBackbuffer, // Src surface - NULL, // Src palette - &rcSrc, // Src rect - D3DX_FILTER_NONE, // Filter - 0 // Colorkey (0=no colorkey) - ); - IDirect3DSurface9_Release(pBackbuffer); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pImage); - return; - } - - _gldDrawPixels(ctx, FALSE, dstx, dsty, width, height, pImage); - - IDirect3DSurface9_Release(pImage); -} - -//--------------------------------------------------------------------------- - -void gld_Bitmap_DX9( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei width, - GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - GLD_context *gldCtx; - GLD_driver_dx9 *gld; - - IDirect3DSurface9 *pImage; - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - BYTE *pTempBitmap; - D3DCOLOR clBitmapOne, clBitmapZero; - D3DCOLOR *pBits; - const GLubyte *src; - int i, j, k; - - gldCtx = GLD_GET_CONTEXT(ctx); - gld = GLD_GET_DX9_DRIVER(gldCtx); - - // A NULL bitmap is valid, but merely advances the raster position - if ((bitmap == NULL) || (width == 0) || (height == 0)) - return; - - clBitmapZero = D3DCOLOR_RGBA(0,0,0,0); // NOTE: Alpha is Zero - clBitmapOne = D3DCOLOR_COLORVALUE( - ctx->Current.RasterColor[0], - ctx->Current.RasterColor[1], - ctx->Current.RasterColor[2], - 1.0f); // NOTE: Alpha is One - - hr = IDirect3DDevice9_CreateOffscreenPlainSurface( - gld->pDev, - width, - height, - D3DFMT_A8R8G8B8, - D3DPOOL_SCRATCH, - &pImage, - NULL); - if (FAILED(hr)) { - return; - } - - // Lock all of surface - hr = IDirect3DSurface9_LockRect(pImage, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pImage); - return; - } - - pTempBitmap = _mesa_unpack_bitmap(width, height, bitmap, unpack); - if (pTempBitmap == NULL) { - IDirect3DSurface9_Release(pImage); - return; - } - - pBits = (D3DCOLOR*)d3dLockedRect.pBits; - - for (i=0; iDefaultPacking, pTempBitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, - 0, i, 0); - for (j=0; j<(width>>3); j++) { - byte = *src++; - for (k=0; k<8; k++) { - *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero; - byte <<= 1; - } - } - // Fill remaining bits from bitmap - if (width & 7) { - byte = *src; - for (k=0; k<(width & 7); k++) { - *pBits++ = (byte & 128) ? clBitmapOne : clBitmapZero; - byte <<= 1; - } - } - } - - FREE(pTempBitmap); - -/* - // unpack image, apply transfer ops and store directly in texture - texImage->TexFormat->StoreImage( - ctx, - 2, - GL_BITMAP, - &_mesa_texformat_argb8888, - d3dLockedRect.pBits, - width, height, 1, 0, 0, 0, - d3dLockedRect.Pitch, - 0, // dstImageStride - GL_BITMAP, GL_COLOR_INDEX, bitmap, unpack); -*/ - IDirect3DSurface9_UnlockRect(pImage); - - _gldDrawPixels(ctx, TRUE, x, y, width, height, pImage); - - IDirect3DSurface9_Release(pImage); -} - -//--------------------------------------------------------------------------- -// Texture functions -//--------------------------------------------------------------------------- - -void _gldAllocateTexture( - GLcontext *ctx, - struct gl_texture_object *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - IDirect3DTexture9 *pTex; - D3DFORMAT d3dFormat; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture9*)tObj->DriverData; - if (pTex) { - // Decide whether we can keep existing D3D texture - // by examining top-level surface. - D3DSURFACE_DESC d3dsd; - _GLD_DX9_TEX(GetLevelDesc(pTex, 0, &d3dsd)); - // Release existing texture if not compatible - if ((d3dsd.Width == texImage->Width) || - (d3dsd.Height == texImage->Height)) - { - return; // Keep the existing texture - } - tObj->DriverData = NULL; - _GLD_DX9_TEX(Release(pTex)); - } - - d3dFormat = _gldGLFormatToD3DFormat(texImage->IntFormat); - D3DXCreateTexture( - gld->pDev, - texImage->Width, - texImage->Height, - // TODO: Re-evaluate mipmapping - (glb.bUseMipmaps) ? D3DX_DEFAULT : 1, - 0, // Usage - d3dFormat, - D3DPOOL_MANAGED, - &pTex); - tObj->DriverData = pTex; -} - -//--------------------------------------------------------------------------- - -const struct gl_texture_format* gld_ChooseTextureFormat_DX9( - GLcontext *ctx, - GLint internalFormat, - GLenum srcFormat, - GLenum srcType) -{ - // [Based on mesa_choose_tex_format()] - // - // We will choose only texture formats that are supported - // by Direct3D. If the hardware doesn't support a particular - // texture format, then the D3DX texture calls that we use - // will automatically use a HW supported format. - // - // The most critical aim is to reduce copying; if we can use - // texture-image data directly then it will be a big performance assist. - // - - switch (internalFormat) { - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return &_mesa_texformat_l8; // D3DFMT_L8 - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return &_mesa_texformat_l8; // D3DFMT_L8 - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return &_mesa_texformat_a8; // D3DFMT_A8 - 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 &_mesa_texformat_rgb565; // D3DFMT_R5G6B5 - // Mesa will convert this for us later... - // return &_mesa_texformat_ci8; // D3DFMT_R5G6B5 - 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 &_mesa_texformat_al88; // D3DFMT_A8L8 - case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; // D3DFMT_R3G3B2 - case GL_RGB4: - case GL_RGBA4: - case GL_RGBA2: - return &_mesa_texformat_argb4444; // D3DFMT_A4R4G4B4 - case 3: - case GL_RGB: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return &_mesa_texformat_rgb565; - case 4: - case GL_RGBA: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return &_mesa_texformat_argb8888; - case GL_RGB5_A1: - return &_mesa_texformat_argb1555; - default: - _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat"); - return NULL; - } -} - -//--------------------------------------------------------------------------- - -/* -// Safer(?), slower version. -void gld_TexImage2D_DX9( - GLcontext *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 *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - IDirect3DTexture9 *pTex; - IDirect3DSurface9 *pSurface; - RECT rcSrcRect; - HRESULT hr; - GLint texelBytes = 4; - GLvoid *tempImage; - - if (!tObj || !texImage) - return; - - if (level == 0) { - _gldAllocateTexture(ctx, tObj, texImage); - } - - pTex = (IDirect3DTexture9*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture9_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - IDirect3DSurface9_Release(pSurface); - return; - } - // unpack image, apply transfer ops and store in tempImage - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - &_mesa_texformat_argb8888, // dest format - tempImage, - width, height, 1, 0, 0, 0, - width * texelBytes, - 0, // dstImageStride - format, type, pixels, packing); - - SetRect(&rcSrcRect, 0, 0, width, height); - D3DXLoadSurfaceFromMemory( - pSurface, - NULL, - NULL, - tempImage, - D3DFMT_A8R8G8B8, - width * texelBytes, - NULL, - &rcSrcRect, - D3DX_FILTER_NONE, - 0); - - FREE(tempImage); - IDirect3DSurface9_Release(pSurface); -} -*/ - -//--------------------------------------------------------------------------- - -// Faster, more efficient version. -// Copies subimage straight to dest texture -void gld_TexImage2D_DX9( - GLcontext *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 *tObj, - struct gl_texture_image *texImage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - IDirect3DTexture9 *pTex; - IDirect3DSurface9 *pSurface; - HRESULT hr; - D3DLOCKED_RECT d3dLockedRect; - D3DSURFACE_DESC d3dsd; - - if (!tObj || !texImage) - return; - - // GLQUAKE FIX - // Test for input alpha data with non-alpha internalformat - if (((internalFormat==3) || (internalFormat==GL_RGB)) && (format==GL_RGBA)) { - // Input format has alpha, but a non-alpha format has been requested. - texImage->IntFormat = GL_RGBA; - internalFormat = GL_RGBA; - } - - if (level == 0) { - _gldAllocateTexture(ctx, tObj, texImage); - } - - pTex = (IDirect3DTexture9*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture9_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - IDirect3DSurface9_GetDesc(pSurface, &d3dsd); - - // Lock all of surface - hr = IDirect3DSurface9_LockRect(pSurface, &d3dLockedRect, NULL, 0); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store directly in texture - texImage->TexFormat->StoreImage( - ctx, - 2, - texImage->Format, - _gldMesaFormatForD3DFormat(d3dsd.Format), - d3dLockedRect.pBits, - width, height, 1, 0, 0, 0, - d3dLockedRect.Pitch, - 0, // dstImageStride - format, type, pixels, packing); - - IDirect3DSurface9_UnlockRect(pSurface); - IDirect3DSurface9_Release(pSurface); -} - -//--------------------------------------------------------------------------- - -void gld_TexImage1D_DX9(GLcontext *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 ) -{ - // A 1D texture is a 2D texture with a height of zero - gld_TexImage2D_DX9(ctx, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage); -} - -//--------------------------------------------------------------------------- - -/* -void gld_TexSubImage2D( GLcontext *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 *tObj, - struct gl_texture_image *texImage ) -{ - GLD_GET_CONTEXT - IDirect3DTexture9 *pTex; - IDirect3DSurface9 *pSurface; - D3DFORMAT d3dFormat; - HRESULT hr; - GLint texelBytes = 4; - GLvoid *tempImage; - RECT rcSrcRect; - RECT rcDstRect; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture9*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= _GLD_DX9_TEX(GetLevelCount(pTex)) - return; // Level does not exist - hr = _GLD_DX9_TEX(GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - d3dFormat = _gldGLFormatToD3DFormat(texImage->Format); - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - IDirect3DSurface9_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store in tempImage - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - &_mesa_texformat_argb8888, // dest format - tempImage, - width, height, 1, 0, 0, 0, - width * texelBytes, - 0, // dstImageStride - format, type, pixels, packing); - - // Source rectangle is whole of input image - SetRect(&rcSrcRect, 0, 0, width, height); - - // Dest rectangle must be offset to dest image - SetRect(&rcDstRect, 0, 0, width, height); - OffsetRect(&rcDstRect, xoffset, yoffset); - - D3DXLoadSurfaceFromMemory( - pSurface, - NULL, - &rcDstRect, - tempImage, - D3DFMT_A8R8G8B8, - width * texelBytes, - NULL, - &rcSrcRect, - D3DX_FILTER_NONE, - 0); - - FREE(tempImage); - IDirect3DSurface9_Release(pSurface); -} -*/ - -//--------------------------------------------------------------------------- - -// Faster, more efficient version. -// Copies subimage straight to dest texture -void gld_TexSubImage2D_DX9( GLcontext *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 *tObj, - struct gl_texture_image *texImage ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - IDirect3DTexture9 *pTex; - IDirect3DSurface9 *pSurface; - HRESULT hr; - RECT rcDstRect; - D3DLOCKED_RECT d3dLockedRect; - D3DSURFACE_DESC d3dsd; - - if (!tObj || !texImage) - return; - - pTex = (IDirect3DTexture9*)tObj->DriverData; - if (!pTex) - return; // Texture has not been created - if (level >= IDirect3DTexture9_GetLevelCount(pTex)) - return; // Level does not exist - hr = IDirect3DTexture9_GetSurfaceLevel(pTex, level, &pSurface); - if (FAILED(hr)) - return; // Surface level doesn't exist (or just a plain error) - - IDirect3DSurface9_GetDesc(pSurface, &d3dsd); - - // Dest rectangle must be offset to dest image - SetRect(&rcDstRect, 0, 0, width, height); - OffsetRect(&rcDstRect, xoffset, yoffset); - - // Lock sub-rect of surface - hr = IDirect3DSurface9_LockRect(pSurface, &d3dLockedRect, &rcDstRect, 0); - if (FAILED(hr)) { - IDirect3DSurface9_Release(pSurface); - return; - } - - // unpack image, apply transfer ops and store directly in texture - texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, - _gldMesaFormatForD3DFormat(d3dsd.Format), - d3dLockedRect.pBits, - width, height, 1, - 0, 0, 0, // NOTE: d3dLockedRect.pBits is already offset!!! - d3dLockedRect.Pitch, - 0, // dstImageStride - format, type, pixels, packing); - - - IDirect3DSurface9_UnlockRect(pSurface); - IDirect3DSurface9_Release(pSurface); -} - -//--------------------------------------------------------------------------- - -void gld_TexSubImage1D_DX9( GLcontext *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 ) -{ - gld_TexSubImage2D_DX9(ctx, target, level, xoffset, 0, width, 1, format, type, pixels, packing, texObj, texImage); -} - -//--------------------------------------------------------------------------- - -void gld_DeleteTexture_DX9( - GLcontext *ctx, - struct gl_texture_object *tObj) -{ - GLD_context *gld = (GLD_context*)(ctx->DriverCtx); - - if (tObj) { - IDirect3DTexture9 *pTex = (IDirect3DTexture9*)tObj->DriverData; - if (pTex) { -/* // Make sure texture is not bound to a stage before releasing it - for (int i=0; iCurrentTexture[i] == pTex) { - gld->pDev->SetTexture(i, NULL); - gld->CurrentTexture[i] = NULL; - } - }*/ - _GLD_DX9_TEX(Release(pTex)); - tObj->DriverData = NULL; - } - } -} - -//--------------------------------------------------------------------------- - -__inline void _gldSetColorOps( - const GLD_driver_dx9 *gld, - GLuint unit, - DWORD ColorArg1, - D3DTEXTUREOP ColorOp, - DWORD ColorArg2) -{ - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG1, ColorArg1)); - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLOROP, ColorOp)); - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG2, ColorArg2)); -} - -//--------------------------------------------------------------------------- - -__inline void _gldSetAlphaOps( - const GLD_driver_dx9 *gld, - GLuint unit, - DWORD AlphaArg1, - D3DTEXTUREOP AlphaOp, - DWORD AlphaArg2) -{ - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG1, AlphaArg1)); - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAOP, AlphaOp)); - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ALPHAARG2, AlphaArg2)); -} - -//--------------------------------------------------------------------------- - -void gldUpdateTextureUnit( - GLcontext *ctx, - GLuint unit, - BOOL bPassThrough) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - D3DTEXTUREFILTERTYPE minfilter; - D3DTEXTUREFILTERTYPE mipfilter; - GLenum BaseFormat; - DWORD dwColorArg0; - int iTexEnv = 0; - GLD_texenv *pTexenv; - - // NOTE: If bPassThrough is FALSE then texture stage can be - // disabled otherwise it must pass-through it's current fragment. - - const struct gl_texture_unit *pUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = pUnit->_Current; - - IDirect3DTexture9 *pTex = NULL; - if (tObj) { - pTex = (IDirect3DTexture9*)tObj->DriverData; - } - - // Enable texturing if unit is enabled and a valid D3D texture exists - // Mesa 5: TEXTUREn_x altered to TEXTURE_nD_BIT - //if (pTex && (pUnit->Enabled & (TEXTURE0_1D | TEXTURE0_2D))) { - if (pTex && (pUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT))) { - // Enable texturing - _GLD_DX9_DEV(SetTexture(gld->pDev, unit, pTex)); - } else { - // Disable texturing, then return - _GLD_DX9_DEV(SetTexture(gld->pDev, unit, NULL)); - if (bPassThrough) { - _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE); - _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_SELECTARG2, D3DTA_DIFFUSE); - } else { - _gldSetColorOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE); - _gldSetAlphaOps(gld, unit, D3DTA_TEXTURE, D3DTOP_DISABLE, D3DTA_DIFFUSE); - } - return; - } - - // Texture parameters - _gldConvertMinFilter(tObj->MinFilter, &minfilter, &mipfilter); -// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MINFILTER, minfilter)); -// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MIPFILTER, mipfilter)); -// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter))); -// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSU, _gldConvertWrap(tObj->WrapS))); -// _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_ADDRESSV, _gldConvertWrap(tObj->WrapT))); - _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MINFILTER, minfilter)); - _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MIPFILTER, mipfilter)); - _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_MAGFILTER, _gldConvertMagFilter(tObj->MagFilter))); - _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_ADDRESSU, _gldConvertWrap(tObj->WrapS))); - _GLD_DX9_DEV(SetSamplerState(gld->pDev, unit, D3DSAMP_ADDRESSV, _gldConvertWrap(tObj->WrapT))); - - // Texture priority - _GLD_DX9_TEX(SetPriority(pTex, (DWORD)(tObj->Priority*65535.0f))); - - // Texture environment - // TODO: Examine input texture for alpha and use specific alpha/non-alpha ops. - // See Page 355 of the Red Book. - BaseFormat = _gldDecodeBaseFormat(pTex); - - switch (BaseFormat) { - case GL_RGB: - iTexEnv = 0; - break; - case GL_RGBA: - iTexEnv = 1; - break; - case GL_ALPHA: - iTexEnv = 2; - break; - } - - switch (pUnit->EnvMode) { - case GL_DECAL: - iTexEnv += 0; - break; - case GL_REPLACE: - iTexEnv += 3; - break; - case GL_MODULATE: - iTexEnv += 6; - break; - case GL_BLEND: - // Set blend colour - dwColorArg0 = D3DCOLOR_COLORVALUE(pUnit->EnvColor[0], pUnit->EnvColor[1], pUnit->EnvColor[2], pUnit->EnvColor[3]); - _GLD_DX9_DEV(SetTextureStageState(gld->pDev, unit, D3DTSS_COLORARG0, dwColorArg0)); - iTexEnv += 9; - break; - case GL_ADD: - iTexEnv += 12; - break; - } - pTexenv = (GLD_texenv*)&gldTexEnv[iTexEnv]; - _gldSetColorOps(gld, unit, pTexenv->ColorArg1, pTexenv->ColorOp, pTexenv->ColorArg2); - _gldSetAlphaOps(gld, unit, pTexenv->AlphaArg1, pTexenv->AlphaOp, pTexenv->AlphaArg2); -} - -//--------------------------------------------------------------------------- - -void gld_NEW_TEXTURE_DX9( - GLcontext *ctx) -{ - // TODO: Support for three (ATI Radeon) or more (nVidia GeForce3) texture units - - BOOL bUnit0Enabled; - BOOL bUnit1Enabled; - - if (!ctx) - return; // Sanity check - - if (ctx->Const.MaxTextureUnits == 1) { - gldUpdateTextureUnit(ctx, 0, TRUE); - return; - } - - // - // NOTE: THE FOLLOWING RELATES TO TWO TEXTURE UNITS, AND TWO ONLY!! - // - - // Mesa 5: Texture Units altered - //bUnit0Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) ? TRUE : FALSE; - //bUnit1Enabled = (ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D)) ? TRUE : FALSE; - bUnit0Enabled = (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE; - bUnit1Enabled = (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) ? TRUE : FALSE; - - // If Unit0 is disabled and Unit1 is enabled then we must pass-though - gldUpdateTextureUnit(ctx, 0, (!bUnit0Enabled && bUnit1Enabled) ? TRUE : FALSE); - // We can always disable the last texture unit - gldUpdateTextureUnit(ctx, 1, FALSE); - -#ifdef _DEBUG -#if 0 - { - // Find out whether device supports current renderstates - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); -// GLD_context *gld = GLD_GET_CONTEXT(ctx); - - DWORD dwPasses; - _GLD_DX9_DEV(ValidateDevice(gld->pDev, &dwPasses)); -// if (FAILED(hr)) { -// gldLogError(GLDLOG_ERROR, "ValidateDevice failed", hr); -// } - if (dwPasses != 1) { - gldLogMessage(GLDLOG_ERROR, "ValidateDevice: Can't do in one pass\n"); - } - } -#endif -#endif -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c deleted file mode 100644 index 4fa6bcaf1..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c +++ /dev/null @@ -1,263 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect fastpath pipeline stage -* -****************************************************************************/ - -//--------------------------------------------------------------------------- - -//#include "../GLDirect.h" -//#include "../gld_log.h" -//#include "gld_dx8.h" - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx9.h" - -//--------------------------------------------------------------------------- - -#include "glheader.h" -#include "context.h" -#include "macros.h" -// #include "mem.h" -#include "mtypes.h" -//#include "mmath.h" - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "tnl/t_pipeline.h" - -//--------------------------------------------------------------------------- - -__inline void _gldSetVertexShaderConstants( - GLcontext *ctx, - GLD_driver_dx9 *gld) -{ - D3DXMATRIX mat, matView, matProj; - GLfloat *pM; - - // Mesa 5: Altered to a Stack - //pM = ctx->ModelView.m; - pM = ctx->ModelviewMatrixStack.Top->m; - matView._11 = pM[0]; - matView._12 = pM[1]; - matView._13 = pM[2]; - matView._14 = pM[3]; - matView._21 = pM[4]; - matView._22 = pM[5]; - matView._23 = pM[6]; - matView._24 = pM[7]; - matView._31 = pM[8]; - matView._32 = pM[9]; - matView._33 = pM[10]; - matView._34 = pM[11]; - matView._41 = pM[12]; - matView._42 = pM[13]; - matView._43 = pM[14]; - matView._44 = pM[15]; - - // Mesa 5: Altered to a Stack - //pM = ctx->ProjectionMatrix.m; - pM = ctx->ProjectionMatrixStack.Top->m; - matProj._11 = pM[0]; - matProj._12 = pM[1]; - matProj._13 = pM[2]; - matProj._14 = pM[3]; - matProj._21 = pM[4]; - matProj._22 = pM[5]; - matProj._23 = pM[6]; - matProj._24 = pM[7]; - matProj._31 = pM[8]; - matProj._32 = pM[9]; - matProj._33 = pM[10]; - matProj._34 = pM[11]; - matProj._41 = pM[12]; - matProj._42 = pM[13]; - matProj._43 = pM[14]; - matProj._44 = pM[15]; - - D3DXMatrixMultiply( &mat, &matView, &matProj ); - D3DXMatrixTranspose( &mat, &mat ); - - _GLD_DX9_DEV(SetVertexShaderConstantF(gld->pDev, 0, (float*)&mat, 4)); -} - -//--------------------------------------------------------------------------- - -static GLboolean gld_d3d_render_stage_run( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - TNLcontext *tnl; - struct vertex_buffer *VB; - tnl_render_func *tab; - GLint pass; - GLD_pb_dx9 *gldPB = &gld->PB3d; -/* - static int count = 0; - count++; - if (count != 2) - return GL_FALSE; -*/ - // The "check" function should disable this stage, - // but we'll test gld->bUseMesaTnL anyway. - if (gld->bUseMesaTnL) { - // Do nothing in this stage, but continue pipeline - return GL_TRUE; - } - - tnl = TNL_CONTEXT(ctx); - VB = &tnl->vb; - pass = 0; - - tnl->Driver.Render.Start( ctx ); - -#if 0 - // For debugging: Useful to see if an app passes colour data in - // an unusual format. - switch (VB->ColorPtr[0]->Type) { - case GL_FLOAT: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); - break; - case GL_UNSIGNED_BYTE: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n"); - break; - default: - ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n"); - break; - } -#endif - - tnl->Driver.Render.Points = gld_Points3D_DX9; - if (ctx->_TriangleCaps & DD_FLATSHADE) { - tnl->Driver.Render.Line = gld_Line3DFlat_DX9; - tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX9; - tnl->Driver.Render.Quad = gld_Quad3DFlat_DX9; - } else { - tnl->Driver.Render.Line = gld_Line3DSmooth_DX9; - tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX9; - tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX9; - } - - _GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD)); - gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0; - // Allocate primitive pointers - // gldPB->pPoints is always first - gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine); - gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts); - - do { - GLuint i, length, flags = 0; - for (i = 0 ; !(flags & PRIM_END) ; i += length) - { - flags = VB->Primitive[i].mode; - length= VB->Primitive[i].count; - ASSERT(length || (flags & PRIM_END)); - ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); - if (length) - tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - _GLD_DX9_VB(Unlock(gldPB->pVB)); - - _GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride)); - - _GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection)); - _GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView)); - - if (gldPB->nPoints) { - _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints)); - gldPB->nPoints = 0; - } - - if (gldPB->nLines) { - _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines)); - gldPB->nLines = 0; - } - - if (gldPB->nTriangles) { - _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles)); - gldPB->nTriangles = 0; - } - - return GL_FALSE; /* finished the pipe */ -} - -//--------------------------------------------------------------------------- - -static void gld_d3d_render_stage_check( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - // Is this thread safe? - stage->active = (gld->bUseMesaTnL) ? GL_FALSE : GL_TRUE; - return; -} - - -//--------------------------------------------------------------------------- - -const struct tnl_pipeline_stage _gld_d3d_render_stage = -{ - "gld_d3d_render_stage", - NULL, - NULL, - NULL, - NULL, - gld_d3d_render_stage_run /* run */ -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c deleted file mode 100644 index 64acab2d2..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c +++ /dev/null @@ -1,443 +0,0 @@ - -/* - * 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. - * - * Authors: - * Keith Whitwell - */ - - -/* - * Render whole vertex buffers, including projection of vertices from - * clip space and clipping of primitives. - * - * This file makes calls to project vertices and to the point, line - * and triangle rasterizers via the function pointers: - * - * context->Driver.Render.* - * - */ - - -//--------------------------------------------------------------------------- - -#include "dglcontext.h" -#include "ddlog.h" -#include "gld_dx9.h" - -//--------------------------------------------------------------------------- - -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" -//#include "mmath.h" - -#include "math/m_matrix.h" -#include "math/m_xform.h" - -#include "tnl/t_pipeline.h" - -/**********************************************************************/ -/* Clip single primitives */ -/**********************************************************************/ - - -#if defined(USE_IEEE) -#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31)) -//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31)) -#else -#define NEGATIVE(x) (x < 0) -//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0) -/* Could just use (x*y<0) except for the flatshading requirements. - * Maybe there's a better way? - */ -#endif - - -#define W(i) coord[i][3] -#define Z(i) coord[i][2] -#define Y(i) coord[i][1] -#define X(i) coord[i][0] -#define SIZE 4 -#define TAG(x) x##_4 -#include "tnl/t_vb_cliptmp.h" - - - -/**********************************************************************/ -/* Clip and render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, with the possibility of clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte ormask = c1|c2; \ - if (!ormask) \ - LineFunc( ctx, v1, v2 ); \ - else if (!(c1 & c2 & 0x3f)) \ - clip_line_4( ctx, v1, v2, ormask ); \ -} while (0) - -#define RENDER_TRI( v1, v2, v3 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \ - GLubyte ormask = c1|c2|c3; \ - if (!ormask) \ - TriangleFunc( ctx, v1, v2, v3 ); \ - else if (!(c1 & c2 & c3 & 0x3f)) \ - clip_tri_4( ctx, v1, v2, v3, ormask ); \ -} while (0) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ -do { \ - GLubyte c1 = mask[v1], c2 = mask[v2]; \ - GLubyte c3 = mask[v3], c4 = mask[v4]; \ - GLubyte ormask = c1|c2|c3|c4; \ - if (!ormask) \ - QuadFunc( ctx, v1, v2, v3, v4 ); \ - else if (!(c1 & c2 & c3 & c4 & 0x3f)) \ - clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \ -} while (0) - - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const GLubyte *mask = VB->ClipMask; \ - const GLuint sz = VB->ClipPtr->size; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; (void) mask; (void) sz; (void) stipple; - -#define TAG(x) clip_##x##_verts -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx ) -#define PRESERVE_VB_DEFS -#include "tnl/t_vb_rendertmp.h" - - - -/* Elts, with the possibility of clipping. - */ -#undef ELT -#undef TAG -#define ELT(x) elt[x] -#define TAG(x) clip_##x##_elts -#include "tnl/t_vb_rendertmp.h" - -/* TODO: do this for all primitives, verts and elts: - */ -static void clip_elt_triangles( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES]; - struct vertex_buffer *VB = &tnl->vb; - const GLuint * const elt = VB->Elts; - GLubyte *mask = VB->ClipMask; - GLuint last = count-2; - GLuint j; - (void) flags; - - tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES ); - - for (j=start; j < last; j+=3 ) { - GLubyte c1 = mask[elt[j]]; - GLubyte c2 = mask[elt[j+1]]; - GLubyte c3 = mask[elt[j+2]]; - GLubyte ormask = c1|c2|c3; - if (ormask) { - if (start < j) - render_tris( ctx, start, j, 0 ); - if (!(c1&c2&c3&0x3f)) - clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask ); - start = j+3; - } - } - - if (start < j) - render_tris( ctx, start, j, 0 ); -} - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - -#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED) -#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx] -#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val - - -/* Vertices, no clipping. - */ -#define RENDER_POINTS( start, count ) \ - tnl->Driver.Render.Points( ctx, start, count ) - -#define RENDER_LINE( v1, v2 ) \ - LineFunc( ctx, v1, v2 ) - -#define RENDER_TRI( v1, v2, v3 ) \ - TriangleFunc( ctx, v1, v2, v3 ) - -#define RENDER_QUAD( v1, v2, v3, v4 ) \ - QuadFunc( ctx, v1, v2, v3, v4 ) - -#define TAG(x) _gld_tnl_##x##_verts - -#define LOCAL_VARS \ - TNLcontext *tnl = TNL_CONTEXT(ctx); \ - struct vertex_buffer *VB = &tnl->vb; \ - const GLuint * const elt = VB->Elts; \ - const tnl_line_func LineFunc = tnl->Driver.Render.Line; \ - const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \ - const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \ - (void) (LineFunc && TriangleFunc && QuadFunc); \ - (void) elt; - -#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx ) -#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x ) -#define RENDER_TAB_QUALIFIER -#define PRESERVE_VB_DEFS -#include "tnl/t_vb_rendertmp.h" - - -/* Elts, no clipping. - */ -#undef ELT -#define TAG(x) _gld_tnl_##x##_elts -#define ELT(x) elt[x] -#include "tnl/t_vb_rendertmp.h" - - -/**********************************************************************/ -/* Helper functions for drivers */ -/**********************************************************************/ -/* -void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint *tmp = VB->Elts; - - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; -} - -void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} -*/ - - -/**********************************************************************/ -/* Clip and render whole vertex buffers */ -/**********************************************************************/ - -tnl_points_func _gldSetupPoints[4] = { - gld_Points2D_DX9, - gld_Points2D_DX9, - gld_Points2D_DX9, - gld_Points2D_DX9 -}; -tnl_line_func _gldSetupLine[4] = { - gld_Line2DFlat_DX9, - gld_Line2DSmooth_DX9, - gld_Line2DFlat_DX9, - gld_Line2DSmooth_DX9, -}; -tnl_triangle_func _gldSetupTriangle[4] = { - gld_Triangle2DFlat_DX9, - gld_Triangle2DSmooth_DX9, - gld_Triangle2DFlatExtras_DX9, - gld_Triangle2DSmoothExtras_DX9 -}; -tnl_quad_func _gldSetupQuad[4] = { - gld_Quad2DFlat_DX9, - gld_Quad2DSmooth_DX9, - gld_Quad2DFlatExtras_DX9, - gld_Quad2DSmoothExtras_DX9 -}; - -//--------------------------------------------------------------------------- - -static GLboolean _gld_mesa_render_stage_run( - GLcontext *ctx, - struct tnl_pipeline_stage *stage) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx); - - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - tnl_render_func *tab; - GLint pass = 0; - GLD_pb_dx9 *gldPB; - - /* Allow the drivers to lock before projected verts are built so - * that window coordinates are guarenteed not to change before - * rendering. - */ - ASSERT(tnl->Driver.Render.Start); - - tnl->Driver.Render.Start( ctx ); - - // NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets - // stream, indices and shader to default values of NULL or 0. -/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) && - gld->VStwosidelight.hShader && - !ctx->Fog.Enabled) - { - IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware); - _GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader)); - gldPB = &gld->PBtwosidelight; - tnl->Driver.Render.Points = gld_Points2DTwoside_DX9; - if (ctx->_TriangleCaps & DD_FLATSHADE) { - tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX9; - tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX9; - tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX9; - } else { - tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX9; - tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX9; - tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX9; - } - } else {*/ -// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE); - IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, TRUE); - gldPB = &gld->PB2d; - _GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL)); - _GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF)); - tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc]; - tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc]; - tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc]; - tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc]; -// } - - _GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD)); - gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0; - // Allocate primitive pointers - // gldPB->pPoints is always first - gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine); - gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle); - - ASSERT(tnl->Driver.Render.BuildVertices); - ASSERT(tnl->Driver.Render.PrimitiveNotify); - ASSERT(tnl->Driver.Render.Points); - ASSERT(tnl->Driver.Render.Line); - ASSERT(tnl->Driver.Render.Triangle); - ASSERT(tnl->Driver.Render.Quad); - ASSERT(tnl->Driver.Render.ResetLineStipple); - ASSERT(tnl->Driver.Render.Interp); - ASSERT(tnl->Driver.Render.CopyPV); - ASSERT(tnl->Driver.Render.ClippedLine); - ASSERT(tnl->Driver.Render.ClippedPolygon); - ASSERT(tnl->Driver.Render.Finish); - - tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 ); - - if (VB->ClipOrMask) { - tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts; - clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles; - } - else { - tab = (VB->Elts ? - tnl->Driver.Render.PrimTabElts : - tnl->Driver.Render.PrimTabVerts); - } - - do { - GLuint i, length, flags = 0; - for (i = 0 ; !(flags & PRIM_END) ; i += length) { - flags = VB->Primitive[i].mode; - length= VB->Primitive[i].count; - ASSERT(length || (flags & PRIM_END)); - ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); - if (length) - tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); - } - } while (tnl->Driver.Render.Multipass && - tnl->Driver.Render.Multipass( ctx, ++pass )); - - -// tnl->Driver.Render.Finish( ctx ); - - _GLD_DX9_VB(Unlock(gldPB->pVB)); - - _GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride)); - - if (gldPB->nPoints) { - _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints)); - gldPB->nPoints = 0; - } - - if (gldPB->nLines) { - _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines)); - gldPB->nLines = 0; - } - - if (gldPB->nTriangles) { - _GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles)); - gldPB->nTriangles = 0; - } - - return GL_FALSE; /* finished the pipe */ -} - - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - - - -const struct tnl_pipeline_stage _gld_mesa_render_stage = -{ - "gld_mesa_render_stage", - NULL, - NULL, - NULL, - NULL, - _gld_mesa_render_stage_run /* run */ -}; - -//--------------------------------------------------------------------------- diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c b/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c deleted file mode 100644 index a03b865bb..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c +++ /dev/null @@ -1,1346 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: GLDirect Direct3D 8.x WGL (WindowsGL) -* -****************************************************************************/ - -#include "dglcontext.h" -#include "gld_driver.h" -#include "gld_dxerr9.h" -#include "gld_dx9.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" - -// Copied from dglcontect.c -#define GLDERR_NONE 0 -#define GLDERR_MEM 1 -#define GLDERR_DDRAW 2 -#define GLDERR_D3D 3 -#define GLDERR_BPP 4 -#define GLDERR_DDS 5 -// This external var keeps track of any error -extern int nContextError; - -#define DDLOG_CRITICAL_OR_WARN DDLOG_CRITICAL - -extern void _gld_mesa_warning(GLcontext *, char *); -extern void _gld_mesa_fatal(GLcontext *, char *); - -//--------------------------------------------------------------------------- - -static char szColorDepthWarning[] = -"GLDirect does not support the current desktop\n\ -color depth.\n\n\ -You may need to change the display resolution to\n\ -16 bits per pixel or higher color depth using\n\ -the Windows Display Settings control panel\n\ -before running this OpenGL application.\n"; - -// The only depth-stencil formats currently supported by Direct3D -// Surface Format Depth Stencil Total Bits -// D3DFMT_D32 32 - 32 -// D3DFMT_D15S1 15 1 16 -// D3DFMT_D24S8 24 8 32 -// D3DFMT_D16 16 - 16 -// D3DFMT_D24X8 24 - 32 -// D3DFMT_D24X4S4 24 4 32 - -// This pixel format will be used as a template when compiling the list -// of pixel formats supported by the hardware. Many fields will be -// filled in at runtime. -// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM -static DGL_pixelFormat pfTemplateHW = -{ - { - sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure - 1, // Structure version - should be 1 - // Flags: - PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface. - PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM) - PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM) - PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing. - PFD_DOUBLEBUFFER | // The buffer is double-buffered. - 0, // Placeholder for easy commenting of above flags - PFD_TYPE_RGBA, // Pixel type RGBA. - 16, // Total colour bitplanes (excluding alpha bitplanes) - 5, 0, // Red bits, shift - 5, 0, // Green bits, shift - 5, 0, // Blue bits, shift - 0, 0, // Alpha bits, shift (destination alpha) - 0, // Accumulator bits (total) - 0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha - 0, // Depth bits - 0, // Stencil bits - 0, // Number of auxiliary buffers - 0, // Layer type - 0, // Specifies the number of overlay and underlay planes. - 0, // Layer mask - 0, // Specifies the transparent color or index of an underlay plane. - 0 // Damage mask - }, - D3DFMT_UNKNOWN, // No depth/stencil buffer -}; - -//--------------------------------------------------------------------------- -// Vertex Shaders -//--------------------------------------------------------------------------- -/* -// Vertex Shader Declaration -static DWORD dwTwoSidedLightingDecl[] = -{ - D3DVSD_STREAM(0), - D3DVSD_REG(0, D3DVSDT_FLOAT3), // XYZ position - D3DVSD_REG(1, D3DVSDT_FLOAT3), // XYZ normal - D3DVSD_REG(2, D3DVSDT_D3DCOLOR), // Diffuse color - D3DVSD_REG(3, D3DVSDT_D3DCOLOR), // Specular color - D3DVSD_REG(4, D3DVSDT_FLOAT2), // 2D texture unit 0 - D3DVSD_REG(5, D3DVSDT_FLOAT2), // 2D texture unit 1 - D3DVSD_END() -}; - -// Vertex Shader for two-sided lighting -static char *szTwoSidedLightingVS = -// This is a test shader! -"vs.1.0\n" -"m4x4 oPos,v0,c0\n" -"mov oD0,v2\n" -"mov oD1,v3\n" -"mov oT0,v4\n" -"mov oT1,v5\n" -; -*/ -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -typedef struct { - HINSTANCE hD3D9DLL; // Handle to d3d9.dll - FNDIRECT3DCREATE9 fnDirect3DCreate9; // Direct3DCreate9 function prototype - BOOL bDirect3D; // Persistant Direct3D9 exists - BOOL bDirect3DDevice; // Persistant Direct3DDevice9 exists - IDirect3D9 *pD3D; // Persistant Direct3D9 - IDirect3DDevice9 *pDev; // Persistant Direct3DDevice9 -} GLD_dx9_globals; - -// These are "global" to all DX9 contexts. KeithH -static GLD_dx9_globals dx9Globals; - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -BOOL gldGetDXErrorString_DX( - HRESULT hr, - char *buf, - int nBufSize) -{ - // - // Return a string describing the input HRESULT error code - // - - const char *pStr = DXGetErrorString9(hr); - - if (pStr == NULL) - return FALSE; - - if (strlen(pStr) > nBufSize) - strncpy(buf, pStr, nBufSize); - else - strcpy(buf, pStr); - -// D3DXGetErrorString(hr, buf, nBufSize); - - return TRUE; -} - -//--------------------------------------------------------------------------- - -static D3DMULTISAMPLE_TYPE _gldGetDeviceMultiSampleType( - IDirect3D9 *pD3D9, - D3DFORMAT SurfaceFormat, - D3DDEVTYPE d3dDevType, - BOOL Windowed) -{ - int i; - HRESULT hr; - - if (glb.dwMultisample == GLDS_MULTISAMPLE_NONE) - return D3DMULTISAMPLE_NONE; - - if (glb.dwMultisample == GLDS_MULTISAMPLE_FASTEST) { - // Find fastest multisample - for (i=2; i<17; i++) { - hr = IDirect3D9_CheckDeviceMultiSampleType( - pD3D9, - glb.dwAdapter, - d3dDevType, - SurfaceFormat, - Windowed, - (D3DMULTISAMPLE_TYPE)i, - NULL); - if (SUCCEEDED(hr)) { - return (D3DMULTISAMPLE_TYPE)i; - } - } - } else { - // Find nicest multisample - for (i=16; i>1; i--) { - hr = IDirect3D9_CheckDeviceMultiSampleType( - pD3D9, - glb.dwAdapter, - d3dDevType, - SurfaceFormat, - Windowed, - (D3DMULTISAMPLE_TYPE)i, - NULL); - if (SUCCEEDED(hr)) { - return (D3DMULTISAMPLE_TYPE)i; - } - } - } - - // Nothing found - return default - return D3DMULTISAMPLE_NONE; -} - -//--------------------------------------------------------------------------- - -void _gldDestroyPrimitiveBuffer( - GLD_pb_dx9 *gldVB) -{ - SAFE_RELEASE(gldVB->pVB); - - // Sanity check... - gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0; -} - -//--------------------------------------------------------------------------- - -HRESULT _gldCreatePrimitiveBuffer( - GLcontext *ctx, - GLD_driver_dx9 *lpCtx, - GLD_pb_dx9 *gldVB) -{ - HRESULT hResult; - char *szCreateVertexBufferFailed = "CreateVertexBuffer failed"; - DWORD dwMaxVertices; // Max number of vertices in vertex buffer - DWORD dwVBSize; // Total size of vertex buffer - - // If CVA (Compiled Vertex Array) is used by an OpenGL app, then we - // will need enough vertices to cater for Mesa::Const.MaxArrayLockSize. - // We'll use IMM_SIZE if it's larger (which it should not be). - dwMaxVertices = MAX_ARRAY_LOCK_SIZE; - - // Now calculate how many vertices to allow for in total - // 1 per point, 2 per line, 6 per quad = 9 - dwVBSize = dwMaxVertices * 9 * gldVB->dwStride; - - hResult = IDirect3DDevice9_CreateVertexBuffer( - lpCtx->pDev, - dwVBSize, - gldVB->dwUsage, - gldVB->dwFVF, - gldVB->dwPool, - &gldVB->pVB, - NULL); - if (FAILED(hResult)) { - ddlogMessage(DDLOG_CRITICAL_OR_WARN, szCreateVertexBufferFailed); - return hResult; - } - - gldVB->nLines = gldVB->nPoints = gldVB->nTriangles = 0; - gldVB->pPoints = gldVB->pLines = gldVB->pTriangles = NULL; - gldVB->iFirstLine = dwMaxVertices; // Index of first line in VB - gldVB->iFirstTriangle = dwMaxVertices*3; // Index of first triangle in VB - - return S_OK; -} - -//--------------------------------------------------------------------------- -// Function: _gldCreateVertexShaders -// Create DX9 Vertex Shaders. -//--------------------------------------------------------------------------- -/* -void _gldCreateVertexShaders( - GLD_driver_dx9 *gld) -{ - DWORD dwFlags; - LPD3DXBUFFER pVSOpcodeBuffer; // Vertex Shader opcode buffer - HRESULT hr; - -#ifdef _DEBUG - dwFlags = D3DXASM_DEBUG; -#else - dwFlags = 0; // D3DXASM_SKIPVALIDATION; -#endif - - ddlogMessage(DDLOG_INFO, "Creating shaders...\n"); - - // Init the shader handle - gld->VStwosidelight.hShader = 0; - - if (gld->d3dCaps8.MaxStreams == 0) { - // Lame DX8 driver doesn't support streams - // Not fatal, as defaults will be used - ddlogMessage(DDLOG_WARN, "Driver doesn't support Vertex Shaders (MaxStreams==0)\n"); - return; - } - - // ** THIS DISABLES VERTEX SHADER SUPPORT ** -// return; - // ** THIS DISABLES VERTEX SHADER SUPPORT ** - - // - // Two-sided lighting - // - -#if 0 - // - // DEBUGGING: Load shader from a text file - // - { - LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer - hr = D3DXAssembleShaderFromFile( - "twoside.vsh", - dwFlags, - NULL, // No constants - &pVSOpcodeBuffer, - &pVSErrorBuffer); - if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)) - ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)); - SAFE_RELEASE(pVSErrorBuffer); - } -#else - { - LPD3DXBUFFER pVSErrorBuffer; // Vertex Shader error buffer - // Assemble ascii shader text into shader opcodes - hr = D3DXAssembleShader( - szTwoSidedLightingVS, - strlen(szTwoSidedLightingVS), - dwFlags, - NULL, // No constants - &pVSOpcodeBuffer, - &pVSErrorBuffer); - if (pVSErrorBuffer && pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)) - ddlogMessage(DDLOG_INFO, pVSErrorBuffer->lpVtbl->GetBufferPointer(pVSErrorBuffer)); - SAFE_RELEASE(pVSErrorBuffer); - } -#endif - if (FAILED(hr)) { - ddlogError(DDLOG_WARN, "AssembleShader failed", hr); - SAFE_RELEASE(pVSOpcodeBuffer); - return; - } - -// This is for debugging. Remove to enable vertex shaders in HW -#define _GLD_FORCE_SW_VS 0 - - if (_GLD_FORCE_SW_VS) { - // _GLD_FORCE_SW_VS should be disabled for Final Release - ddlogMessage(DDLOG_SYSTEM, "[Forcing shaders in SW]\n"); - } - - // Try and create shader in hardware. - // NOTE: The D3D Ref device appears to succeed when trying to - // create the device in hardware, but later complains - // when trying to set it with SetVertexShader(). Go figure. - if (_GLD_FORCE_SW_VS || glb.dwDriver == GLDS_DRIVER_REF) { - // Don't try and create a hardware shader with the Ref device - hr = E_FAIL; // COM error/fail result - } else { - gld->VStwosidelight.bHardware = TRUE; - hr = IDirect3DDevice8_CreateVertexShader( - gld->pDev, - dwTwoSidedLightingDecl, - pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer), - &gld->VStwosidelight.hShader, - 0); - } - if (FAILED(hr)) { - ddlogMessage(DDLOG_INFO, "... HW failed, trying SW...\n"); - // Failed. Try and create shader for software processing - hr = IDirect3DDevice8_CreateVertexShader( - gld->pDev, - dwTwoSidedLightingDecl, - pVSOpcodeBuffer->lpVtbl->GetBufferPointer(pVSOpcodeBuffer), - &gld->VStwosidelight.hShader, - D3DUSAGE_SOFTWAREPROCESSING); - if (FAILED(hr)) { - gld->VStwosidelight.hShader = 0; // Sanity check - ddlogError(DDLOG_WARN, "CreateVertexShader failed", hr); - return; - } - // Succeeded, but for software processing - gld->VStwosidelight.bHardware = FALSE; - } - - SAFE_RELEASE(pVSOpcodeBuffer); - - ddlogMessage(DDLOG_INFO, "... OK\n"); -} - -//--------------------------------------------------------------------------- - -void _gldDestroyVertexShaders( - GLD_driver_dx9 *gld) -{ - if (gld->VStwosidelight.hShader) { - IDirect3DDevice8_DeleteVertexShader(gld->pDev, gld->VStwosidelight.hShader); - gld->VStwosidelight.hShader = 0; - } -} -*/ -//--------------------------------------------------------------------------- - -BOOL gldCreateDrawable_DX( - DGL_ctx *ctx, -// BOOL bDefaultDriver, - BOOL bDirectDrawPersistant, - BOOL bPersistantBuffers) -{ - // - // bDirectDrawPersistant: applies to IDirect3D9 - // bPersistantBuffers: applies to IDirect3DDevice9 - // - - HRESULT hResult; - GLD_driver_dx9 *lpCtx = NULL; - D3DDEVTYPE d3dDevType; - D3DPRESENT_PARAMETERS d3dpp; - D3DDISPLAYMODE d3ddm; - DWORD dwBehaviourFlags; - D3DADAPTER_IDENTIFIER9 d3dIdent; - - // Error if context is NULL. - if (ctx == NULL) - return FALSE; - - if (ctx->glPriv) { - lpCtx = ctx->glPriv; - // Release any existing interfaces - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - } else { - lpCtx = (GLD_driver_dx9*)malloc(sizeof(GLD_driver_dx9)); - ZeroMemory(lpCtx, sizeof(lpCtx)); - } - - d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; - // TODO: Check this -// if (bDefaultDriver) -// d3dDevType = D3DDEVTYPE_REF; - - // Use persistant interface if needed - if (bDirectDrawPersistant && dx9Globals.bDirect3D) { - lpCtx->pD3D = dx9Globals.pD3D; - IDirect3D9_AddRef(lpCtx->pD3D); - goto SkipDirectDrawCreate; - } - - // Create Direct3D9 object - lpCtx->pD3D = dx9Globals.fnDirect3DCreate9(D3D_SDK_VERSION); - if (lpCtx->pD3D == NULL) { - MessageBox(NULL, "Unable to initialize Direct3D9", "GLDirect", MB_OK); - ddlogMessage(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D9 interface"); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Cache Direct3D interface for subsequent GLRCs - if (bDirectDrawPersistant && !dx9Globals.bDirect3D) { - dx9Globals.pD3D = lpCtx->pD3D; - IDirect3D9_AddRef(dx9Globals.pD3D); - dx9Globals.bDirect3D = TRUE; - } -SkipDirectDrawCreate: - - // Get the display mode so we can make a compatible backbuffer - hResult = IDirect3D9_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hResult)) { - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Get device caps - hResult = IDirect3D9_GetDeviceCaps(lpCtx->pD3D, glb.dwAdapter, d3dDevType, &lpCtx->d3dCaps9); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D9_GetDeviceCaps failed", hResult); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - // Check for hardware transform & lighting - lpCtx->bHasHWTnL = lpCtx->d3dCaps9.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ? TRUE : FALSE; - -/* - // - // GONE FOR DX9? - // - // If this flag is present then we can't default to Mesa - // SW rendering between BeginScene() and EndScene(). - if (lpCtx->d3dCaps9.Caps2 & D3DCAPS2_NO2DDURING3DSCENE) { - ddlogMessage(DDLOG_WARN, - "Warning : No 2D allowed during 3D scene.\n"); - } -*/ - - // - // Create the Direct3D context - // - - // Re-use original IDirect3DDevice if persistant buffers exist. - // Note that we test for persistant IDirect3D9 as well - // bDirectDrawPersistant == persistant IDirect3D9 (DirectDraw9 does not exist) - if (bDirectDrawPersistant && bPersistantBuffers && dx9Globals.pD3D && dx9Globals.pDev) { - lpCtx->pDev = dx9Globals.pDev; - IDirect3DDevice9_AddRef(dx9Globals.pDev); - goto skip_direct3ddevice_create; - } - - // Clear the presentation parameters (sets all members to zero) - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Recommended by MS; needed for MultiSample. - // Be careful if altering this for FullScreenBlit - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - d3dpp.BackBufferFormat = d3ddm.Format; - d3dpp.BackBufferCount = 2; //1; - d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(lpCtx->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen); - d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData; - d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE; - - if (ctx->bFullscreen) { - ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen - d3dpp.Windowed = FALSE; - d3dpp.BackBufferWidth = d3ddm.Width; - d3dpp.BackBufferHeight = d3ddm.Height; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - - // Support for vertical retrace synchronisation. - // Set default presentation interval in case caps bits are missing - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - if (glb.bWaitForRetrace) { - if (lpCtx->d3dCaps9.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; - } else { - if (lpCtx->d3dCaps9.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - } - } else { - ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages - d3dpp.Windowed = TRUE; - d3dpp.BackBufferWidth = ctx->dwWidth; - d3dpp.BackBufferHeight = ctx->dwHeight; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = 0; - // PresentationInterval Windowed mode is optional now in DX9 (DaveM) - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - if (glb.bWaitForRetrace) { - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; - } else { - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - } - } - - // Decide if we can use hardware TnL - dwBehaviourFlags = (lpCtx->bHasHWTnL) ? - D3DCREATE_MIXED_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING; - // Add flag to tell D3D to be thread-safe - if (glb.bMultiThreaded) - dwBehaviourFlags |= D3DCREATE_MULTITHREADED; - // Add flag to tell D3D to be FPU-safe - if (!glb.bFastFPU) - dwBehaviourFlags |= D3DCREATE_FPU_PRESERVE; - hResult = IDirect3D9_CreateDevice(lpCtx->pD3D, - glb.dwAdapter, - d3dDevType, - ctx->hWnd, - dwBehaviourFlags, - &d3dpp, - &lpCtx->pDev); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "IDirect3D9_CreateDevice failed", hResult); - nContextError = GLDERR_D3D; - goto return_with_error; - } - - if (bDirectDrawPersistant && bPersistantBuffers && dx9Globals.pD3D) { - dx9Globals.pDev = lpCtx->pDev; - dx9Globals.bDirect3DDevice = TRUE; - } - - // Dump some useful stats - hResult = IDirect3D9_GetAdapterIdentifier( - lpCtx->pD3D, - glb.dwAdapter, - 0, // No WHQL detection (avoid few seconds delay) - &d3dIdent); - if (SUCCEEDED(hResult)) { - ddlogPrintf(DDLOG_INFO, "[Driver Description: %s]", &d3dIdent.Description); - ddlogPrintf(DDLOG_INFO, "[Driver file: %s %d.%d.%02d.%d]", - d3dIdent.Driver, - HIWORD(d3dIdent.DriverVersion.HighPart), - LOWORD(d3dIdent.DriverVersion.HighPart), - HIWORD(d3dIdent.DriverVersion.LowPart), - LOWORD(d3dIdent.DriverVersion.LowPart)); - ddlogPrintf(DDLOG_INFO, "[VendorId: 0x%X, DeviceId: 0x%X, SubSysId: 0x%X, Revision: 0x%X]", - d3dIdent.VendorId, d3dIdent.DeviceId, d3dIdent.SubSysId, d3dIdent.Revision); - } - - // Test to see if IHV driver exposes Scissor Test (new for DX9) - lpCtx->bCanScissor = lpCtx->d3dCaps9.RasterCaps & D3DPRASTERCAPS_SCISSORTEST; - ddlogPrintf(DDLOG_INFO, "Can Scissor: %s", lpCtx->bCanScissor ? "Yes" : "No"); - - // Init projection matrix for D3D TnL - D3DXMatrixIdentity(&lpCtx->matProjection); - lpCtx->matModelView = lpCtx->matProjection; -// gld->bUseMesaProjection = TRUE; - -skip_direct3ddevice_create: - - // Create buffers to hold primitives - lpCtx->PB2d.dwFVF = GLD_FVF_2D_VERTEX; - lpCtx->PB2d.dwPool = D3DPOOL_SYSTEMMEM; - lpCtx->PB2d.dwStride = sizeof(GLD_2D_VERTEX); - lpCtx->PB2d.dwUsage = D3DUSAGE_DONOTCLIP | - D3DUSAGE_DYNAMIC | - D3DUSAGE_SOFTWAREPROCESSING | - D3DUSAGE_WRITEONLY; - hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB2d); - if (FAILED(hResult)) - goto return_with_error; - - lpCtx->PB3d.dwFVF = GLD_FVF_3D_VERTEX; - lpCtx->PB3d.dwPool = D3DPOOL_DEFAULT; - lpCtx->PB3d.dwStride = sizeof(GLD_3D_VERTEX); - lpCtx->PB3d.dwUsage = D3DUSAGE_DYNAMIC | -//DaveM D3DUSAGE_SOFTWAREPROCESSING | - D3DUSAGE_WRITEONLY; - hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PB3d); - if (FAILED(hResult)) - goto return_with_error; - -/* // NOTE: A FVF code of zero indicates a non-FVF vertex buffer (for vertex shaders) - lpCtx->PBtwosidelight.dwFVF = 0; //GLD_FVF_TWOSIDED_VERTEX; - lpCtx->PBtwosidelight.dwPool = D3DPOOL_DEFAULT; - lpCtx->PBtwosidelight.dwStride = sizeof(GLD_TWOSIDED_VERTEX); - lpCtx->PBtwosidelight.dwUsage = D3DUSAGE_DONOTCLIP | - D3DUSAGE_DYNAMIC | - D3DUSAGE_SOFTWAREPROCESSING | - D3DUSAGE_WRITEONLY; - hResult = _gldCreatePrimitiveBuffer(ctx->glCtx, lpCtx, &lpCtx->PBtwosidelight); - if (FAILED(hResult)) - goto return_with_error;*/ - - // Now try and create the DX9 Vertex Shaders -// _gldCreateVertexShaders(lpCtx); - - // Zero the pipeline usage counters - lpCtx->PipelineUsage.qwMesa.QuadPart = -// lpCtx->PipelineUsage.dwD3D2SVS.QuadPart = - lpCtx->PipelineUsage.qwD3DFVF.QuadPart = 0; - - // Assign drawable to GL private - ctx->glPriv = lpCtx; - return TRUE; - -return_with_error: - // Clean up and bail - -// _gldDestroyVertexShaders(lpCtx); - -// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight); - _gldDestroyPrimitiveBuffer(&lpCtx->PB3d); - _gldDestroyPrimitiveBuffer(&lpCtx->PB2d); - - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - return FALSE; -} - -//--------------------------------------------------------------------------- - -BOOL gldResizeDrawable_DX( - DGL_ctx *ctx, - BOOL bDefaultDriver, - BOOL bPersistantInterface, - BOOL bPersistantBuffers) -{ - GLD_driver_dx9 *gld = NULL; - D3DDEVTYPE d3dDevType; - D3DPRESENT_PARAMETERS d3dpp; - D3DDISPLAYMODE d3ddm; - HRESULT hResult; - - // Error if context is NULL. - if (ctx == NULL) - return FALSE; - - gld = ctx->glPriv; - if (gld == NULL) - return FALSE; - - if (ctx->bSceneStarted) { - IDirect3DDevice9_EndScene(gld->pDev); - ctx->bSceneStarted = FALSE; - } - - d3dDevType = (glb.dwDriver == GLDS_DRIVER_HAL) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF; - if (!bDefaultDriver) - d3dDevType = D3DDEVTYPE_REF; // Force Direct3D Reference Rasterise (software) - - // Get the display mode so we can make a compatible backbuffer - hResult = IDirect3D9_GetAdapterDisplayMode(gld->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hResult)) { - nContextError = GLDERR_D3D; -// goto return_with_error; - return FALSE; - } - - // Destroy DX9 Vertex Shaders before Reset() -// _gldDestroyVertexShaders(gld); - - // Release POOL_DEFAULT objects before Reset() - if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) - _gldDestroyPrimitiveBuffer(&gld->PB2d); - if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) - _gldDestroyPrimitiveBuffer(&gld->PB3d); -// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) -// _gldDestroyPrimitiveBuffer(&gld->PBtwosidelight); - - // Clear the presentation parameters (sets all members to zero) - ZeroMemory(&d3dpp, sizeof(d3dpp)); - - // Recommended by MS; needed for MultiSample. - // Be careful if altering this for FullScreenBlit - d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - - d3dpp.BackBufferFormat = d3ddm.Format; - d3dpp.BackBufferCount = 1; - d3dpp.MultiSampleType = _gldGetDeviceMultiSampleType(gld->pD3D, d3ddm.Format, d3dDevType, !ctx->bFullscreen); - d3dpp.AutoDepthStencilFormat = ctx->lpPF->dwDriverData; - d3dpp.EnableAutoDepthStencil = (d3dpp.AutoDepthStencilFormat == D3DFMT_UNKNOWN) ? FALSE : TRUE; - - // TODO: Sync to refresh - - if (ctx->bFullscreen) { - ddlogWarnOption(FALSE); // Don't popup any messages in fullscreen - d3dpp.Windowed = FALSE; - d3dpp.BackBufferWidth = d3ddm.Width; - d3dpp.BackBufferHeight = d3ddm.Height; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - // Get better benchmark results? KeithH -// d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_UNLIMITED; - } else { - ddlogWarnOption(glb.bMessageBoxWarnings); // OK to popup messages - d3dpp.Windowed = TRUE; - d3dpp.BackBufferWidth = ctx->dwWidth; - d3dpp.BackBufferHeight = ctx->dwHeight; - d3dpp.hDeviceWindow = ctx->hWnd; - d3dpp.FullScreen_RefreshRateInHz = 0; - d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; - } - hResult = IDirect3DDevice9_Reset(gld->pDev, &d3dpp); - if (FAILED(hResult)) { - ddlogError(DDLOG_CRITICAL_OR_WARN, "dglResize: Reset failed", hResult); - return FALSE; - //goto cleanup_and_return_with_error; - } - - // - // Recreate POOL_DEFAULT objects - // - if (gld->PB2d.dwPool == D3DPOOL_DEFAULT) { - _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d); - } - if (gld->PB3d.dwPool == D3DPOOL_DEFAULT) { - _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB3d); - } -// if (gld->PBtwosidelight.dwPool == D3DPOOL_DEFAULT) { -// _gldCreatePrimitiveBuffer(ctx->glCtx, gld, &gld->PB2d); -// } - - // Recreate DX9 Vertex Shaders -// _gldCreateVertexShaders(gld); - - // Signal a complete state update - ctx->glCtx->Driver.UpdateState(ctx->glCtx, _NEW_ALL); - - // Begin a new scene - IDirect3DDevice9_BeginScene(gld->pDev); - ctx->bSceneStarted = TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyDrawable_DX( - DGL_ctx *ctx) -{ - GLD_driver_dx9 *lpCtx = NULL; - - // Error if context is NULL. - if (!ctx) - return FALSE; - - // Error if the drawable does not exist. - if (!ctx->glPriv) - return FALSE; - - lpCtx = ctx->glPriv; - -#ifdef _DEBUG - // Dump out stats - ddlogPrintf(DDLOG_SYSTEM, "Usage: M:0x%X%X, D:0x%X%X", - lpCtx->PipelineUsage.qwMesa.HighPart, - lpCtx->PipelineUsage.qwMesa.LowPart, - lpCtx->PipelineUsage.qwD3DFVF.HighPart, - lpCtx->PipelineUsage.qwD3DFVF.LowPart); -#endif - -// _gldDestroyVertexShaders(lpCtx); - -// _gldDestroyPrimitiveBuffer(&lpCtx->PBtwosidelight); - _gldDestroyPrimitiveBuffer(&lpCtx->PB3d); - _gldDestroyPrimitiveBuffer(&lpCtx->PB2d); - - SAFE_RELEASE(lpCtx->pDev); - SAFE_RELEASE(lpCtx->pD3D); - - // Free the private drawable data - free(ctx->glPriv); - ctx->glPriv = NULL; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldCreatePrivateGlobals_DX(void) -{ - ZeroMemory(&dx9Globals, sizeof(dx9Globals)); - - // Load d3d9.dll - dx9Globals.hD3D9DLL = LoadLibrary("D3D9.DLL"); - if (dx9Globals.hD3D9DLL == NULL) - return FALSE; - - // Now try and obtain Direct3DCreate9 - dx9Globals.fnDirect3DCreate9 = (FNDIRECT3DCREATE9)GetProcAddress(dx9Globals.hD3D9DLL, "Direct3DCreate9"); - if (dx9Globals.fnDirect3DCreate9 == NULL) { - FreeLibrary(dx9Globals.hD3D9DLL); - return FALSE; - } - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyPrivateGlobals_DX(void) -{ - if (dx9Globals.bDirect3DDevice) { - SAFE_RELEASE(dx9Globals.pDev); - dx9Globals.bDirect3DDevice = FALSE; - } - if (dx9Globals.bDirect3D) { - SAFE_RELEASE(dx9Globals.pD3D); - dx9Globals.bDirect3D = FALSE; - } - - FreeLibrary(dx9Globals.hD3D9DLL); - dx9Globals.hD3D9DLL = NULL; - dx9Globals.fnDirect3DCreate9 = NULL; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -static void _BitsFromDisplayFormat( - D3DFORMAT fmt, - BYTE *cColorBits, - BYTE *cRedBits, - BYTE *cGreenBits, - BYTE *cBlueBits, - BYTE *cAlphaBits) -{ - switch (fmt) { - case D3DFMT_X1R5G5B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 5; - *cBlueBits = 5; - *cAlphaBits = 0; - return; - case D3DFMT_R5G6B5: - *cColorBits = 16; - *cRedBits = 5; - *cGreenBits = 6; - *cBlueBits = 5; - *cAlphaBits = 0; - return; - case D3DFMT_X8R8G8B8: - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 0; - return; - case D3DFMT_A8R8G8B8: - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 8; - return; - } - - // Should not get here! - *cColorBits = 32; - *cRedBits = 8; - *cGreenBits = 8; - *cBlueBits = 8; - *cAlphaBits = 0; -} - -//--------------------------------------------------------------------------- - -static void _BitsFromDepthStencilFormat( - D3DFORMAT fmt, - BYTE *cDepthBits, - BYTE *cStencilBits) -{ - // NOTE: GL expects either 32 or 16 as depth bits. - switch (fmt) { - case D3DFMT_D32: - *cDepthBits = 32; - *cStencilBits = 0; - return; - case D3DFMT_D15S1: - *cDepthBits = 16; - *cStencilBits = 1; - return; - case D3DFMT_D24S8: - *cDepthBits = 32; - *cStencilBits = 8; - return; - case D3DFMT_D16: - *cDepthBits = 16; - *cStencilBits = 0; - return; - case D3DFMT_D24X8: - *cDepthBits = 32; - *cStencilBits = 0; - return; - case D3DFMT_D24X4S4: - *cDepthBits = 32; - *cStencilBits = 4; - return; - } -} - -//--------------------------------------------------------------------------- - -BOOL gldBuildPixelformatList_DX(void) -{ - D3DDISPLAYMODE d3ddm; - D3DFORMAT fmt[6]; - IDirect3D9 *pD3D = NULL; - HRESULT hr; - int nSupportedFormats = 0; - int i; - DGL_pixelFormat *pPF; - BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits; -// char buf[128]; -// char cat[8]; - - // Direct3D (SW or HW) - // These are arranged so that 'best' pixelformat - // is higher in the list (for ChoosePixelFormat). - const D3DFORMAT DepthStencil[6] = { -// New order: increaing Z, then increasing stencil - D3DFMT_D15S1, - D3DFMT_D16, - D3DFMT_D24X4S4, - D3DFMT_D24X8, - D3DFMT_D24S8, - D3DFMT_D32, - }; - - // Dump DX version - ddlogMessage(GLDLOG_SYSTEM, "DirectX Version : 9.0\n"); - - // Release any existing pixelformat list - if (glb.lpPF) { - free(glb.lpPF); - } - - glb.nPixelFormatCount = 0; - glb.lpPF = NULL; - - // - // Pixelformats for Direct3D (SW or HW) rendering - // - - // Get a Direct3D 9.0 interface - pD3D = dx9Globals.fnDirect3DCreate9(D3D_SDK_VERSION); - if (!pD3D) { - return FALSE; - } - - // We will use the display mode format when finding compliant - // rendertarget/depth-stencil surfaces. - hr = IDirect3D9_GetAdapterDisplayMode(pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hr)) { - IDirect3D9_Release(pD3D); - return FALSE; - } - - // Run through the possible formats and detect supported formats - for (i=0; i<6; i++) { - hr = IDirect3D9_CheckDeviceFormat( - pD3D, - glb.dwAdapter, - glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF, - d3ddm.Format, - D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, - DepthStencil[i]); - if (FAILED(hr)) - // A failure here is not fatal. - continue; - - // Verify that the depth format is compatible. - hr = IDirect3D9_CheckDepthStencilMatch( - pD3D, - glb.dwAdapter, - glb.dwDriver==GLDS_DRIVER_HAL ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF, - d3ddm.Format, - d3ddm.Format, - DepthStencil[i]); - if (FAILED(hr)) - // A failure here is not fatal, just means depth-stencil - // format is not compatible with this display mode. - continue; - - fmt[nSupportedFormats++] = DepthStencil[i]; - } - - IDirect3D9_Release(pD3D); - - if (nSupportedFormats == 0) - return FALSE; // Bail: no compliant pixelformats - - // Total count of pixelformats is: - // (nSupportedFormats+1)*2 - // UPDATED: nSupportedFormats*2 - glb.lpPF = (DGL_pixelFormat *)calloc(nSupportedFormats*2, sizeof(DGL_pixelFormat)); - glb.nPixelFormatCount = nSupportedFormats*2; - if (glb.lpPF == NULL) { - glb.nPixelFormatCount = 0; - return FALSE; - } - - // Get a copy of pointer that we can alter - pPF = glb.lpPF; - - // Cache colour bits from display format - _BitsFromDisplayFormat(d3ddm.Format, &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits); - - // - // Add single-buffer formats - // -/* - // NOTE: No longer returning pixelformats that don't contain depth - // Single-buffer, no depth-stencil buffer - memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat)); - pPF->pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - pPF->pfd.cDepthBits = 0; - pPF->pfd.cStencilBits = 0; - pPF->dwDriverData = D3DFMT_UNKNOWN; - pPF++; -*/ - for (i=0; ipfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits); - pPF->dwDriverData = fmt[i]; - } - - // - // Add double-buffer formats - // - - // NOTE: No longer returning pixelformats that don't contain depth -/* - memcpy(pPF, &pfTemplateHW, sizeof(DGL_pixelFormat)); - pPF->pfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - pPF->pfd.cDepthBits = 0; - pPF->pfd.cStencilBits = 0; - pPF->dwDriverData = D3DFMT_UNKNOWN; - pPF++; -*/ - for (i=0; ipfd.cColorBits = cColorBits; - pPF->pfd.cRedBits = cRedBits; - pPF->pfd.cGreenBits = cGreenBits; - pPF->pfd.cBlueBits = cBlueBits; - pPF->pfd.cAlphaBits = cAlphaBits; - _BitsFromDepthStencilFormat(fmt[i], &pPF->pfd.cDepthBits, &pPF->pfd.cStencilBits); - pPF->dwDriverData = fmt[i]; - } - - // Popup warning message if non RGB color mode - { - // This is a hack. KeithH - HDC hdcDesktop = GetDC(NULL); - DWORD dwDisplayBitDepth = GetDeviceCaps(hdcDesktop, BITSPIXEL); - ReleaseDC(0, hdcDesktop); - if (dwDisplayBitDepth <= 8) { - ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth); - MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING); - } - } - - // Mark list as 'current' - glb.bPixelformatsDirty = FALSE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldInitialiseMesa_DX( - DGL_ctx *lpCtx) -{ - GLD_driver_dx9 *gld = NULL; - int MaxTextureSize, TextureLevels; - BOOL bSoftwareTnL; - - if (lpCtx == NULL) - return FALSE; - - gld = lpCtx->glPriv; - if (gld == NULL) - return FALSE; - - if (glb.bMultitexture) { - lpCtx->glCtx->Const.MaxTextureUnits = gld->d3dCaps9.MaxSimultaneousTextures; - // Only support MAX_TEXTURE_UNITS texture units. - // ** If this is altered then the FVF formats must be reviewed **. - if (lpCtx->glCtx->Const.MaxTextureUnits > GLD_MAX_TEXTURE_UNITS_DX9) - lpCtx->glCtx->Const.MaxTextureUnits = GLD_MAX_TEXTURE_UNITS_DX9; - } else { - // Multitexture override - lpCtx->glCtx->Const.MaxTextureUnits = 1; - } - - // max texture size - MaxTextureSize = min(gld->d3dCaps9.MaxTextureHeight, gld->d3dCaps9.MaxTextureWidth); - if (MaxTextureSize == 0) - MaxTextureSize = 256; // Sanity check - - // - // HACK!! - if (MaxTextureSize > 1024) - MaxTextureSize = 1024; // HACK - CLAMP TO 1024 - // HACK!! - // - - // Got to set MAX_TEXTURE_SIZE as max levels. - // Who thought this stupid idea up? ;) - TextureLevels = 0; - // Calculate power-of-two. - while (MaxTextureSize) { - TextureLevels++; - MaxTextureSize >>= 1; - } - lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8; - lpCtx->glCtx->Const.MaxDrawBuffers = 1; - - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE); - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE); - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_DITHERENABLE, TRUE); - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_SHADEMODE, D3DSHADE_GOURAUD); - - IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_ZENABLE, - (lpCtx->lpPF->dwDriverData!=D3DFMT_UNKNOWN) ? D3DZB_TRUE : D3DZB_FALSE); - - // Set the view matrix - { - D3DXMATRIX vm; -#if 1 - D3DXMatrixIdentity(&vm); -#else - D3DXVECTOR3 Eye(0.0f, 0.0f, 0.0f); - D3DXVECTOR3 At(0.0f, 0.0f, -1.0f); - D3DXVECTOR3 Up(0.0f, 1.0f, 0.0f); - D3DXMatrixLookAtRH(&vm, &Eye, &At, &Up); - vm._31 = -vm._31; - vm._32 = -vm._32; - vm._33 = -vm._33; - vm._34 = -vm._34; -#endif - IDirect3DDevice9_SetTransform(gld->pDev, D3DTS_VIEW, &vm); - } - - if (gld->bHasHWTnL) { - if (glb.dwTnL == GLDS_TNL_DEFAULT) - bSoftwareTnL = FALSE; // HW TnL - else { - bSoftwareTnL = ((glb.dwTnL == GLDS_TNL_MESA) || (glb.dwTnL == GLDS_TNL_D3DSW)) ? TRUE : FALSE; - } - } else { - // No HW TnL, so no choice possible - bSoftwareTnL = TRUE; - } -// IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, bSoftwareTnL); - IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, bSoftwareTnL); - -// Dump this in a Release build as well, now. -//#ifdef _DEBUG - ddlogPrintf(DDLOG_INFO, "HW TnL: %s", - gld->bHasHWTnL ? (bSoftwareTnL ? "Disabled" : "Enabled") : "Unavailable"); -//#endif - - gldEnableExtensions_DX9(lpCtx->glCtx); - gldInstallPipeline_DX9(lpCtx->glCtx); - gldSetupDriverPointers_DX9(lpCtx->glCtx); - - // Signal a complete state update - lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL); - - // Start a scene - IDirect3DDevice9_BeginScene(gld->pDev); - lpCtx->bSceneStarted = TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldSwapBuffers_DX( - DGL_ctx *ctx, - HDC hDC, - HWND hWnd) -{ - HRESULT hr; - GLD_driver_dx9 *gld = NULL; - - if (ctx == NULL) - return FALSE; - - gld = ctx->glPriv; - if (gld == NULL) - return FALSE; - - if (ctx->bSceneStarted) { - IDirect3DDevice9_EndScene(gld->pDev); - ctx->bSceneStarted = FALSE; - } - - // Swap the buffers. hWnd may override the hWnd used for CreateDevice() - hr = IDirect3DDevice9_Present(gld->pDev, NULL, NULL, hWnd, NULL); - -exit_swap: - - IDirect3DDevice9_BeginScene(gld->pDev); - ctx->bSceneStarted = TRUE; - -// Debugging code -#ifdef _DEBUG -// ddlogMessage(GLDLOG_WARN, "SwapBuffers\n"); -#endif - - return (FAILED(hr)) ? FALSE : TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldGetDisplayMode_DX( - DGL_ctx *ctx, - GLD_displayMode *glddm) -{ - D3DDISPLAYMODE d3ddm; - HRESULT hr; - GLD_driver_dx9 *lpCtx = NULL; - BYTE cColorBits, cRedBits, cGreenBits, cBlueBits, cAlphaBits; - - if ((glddm == NULL) || (ctx == NULL)) - return FALSE; - - lpCtx = ctx->glPriv; - if (lpCtx == NULL) - return FALSE; - - if (lpCtx->pD3D == NULL) - return FALSE; - - hr = IDirect3D9_GetAdapterDisplayMode(lpCtx->pD3D, glb.dwAdapter, &d3ddm); - if (FAILED(hr)) - return FALSE; - - // Get info from the display format - _BitsFromDisplayFormat(d3ddm.Format, - &cColorBits, &cRedBits, &cGreenBits, &cBlueBits, &cAlphaBits); - - glddm->Width = d3ddm.Width; - glddm->Height = d3ddm.Height; - glddm->BPP = cColorBits; - glddm->Refresh = d3ddm.RefreshRate; - - return TRUE; -} - -//--------------------------------------------------------------------------- - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc b/mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc deleted file mode 100644 index ba0963153..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/gldirect.rc +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -* -* 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: Windows Resource Compiler -* Environment: Windows 95 -* -****************************************************************************/ - -#ifndef WORKSHOP_INVOKED - #include -#endif - -#define FILE_DESCRIPTION "SciTech GLDirect" -#define ORIG_FILENAME "opengl32.dll" -#define FILE_TYPE VFT_DLL - -#include "gldirect/gldver.ver" diff --git a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h b/mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h deleted file mode 100644 index 9c1f2a054..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/colors.h +++ /dev/null @@ -1,520 +0,0 @@ -/* File name : colors.h - * Version : 2.3 - * - * Header file for display driver for Mesa 2.3 under - * Windows95 and WindowsNT - * This file defines macros and global variables needed - * for converting color format - * - * Copyright (C) 1996- Li Wei - * Address : Institute of Artificial Intelligence - * : & Robotics - * : Xi'an Jiaotong University - * Email : liwei@aiar.xjtu.edu.cn - * Web page : http://sun.aiar.xjtu.edu.cn - * - * This file and its associations are partially based on the - * Windows NT driver for Mesa, written by Mark Leaming - * (mark@rsinc.com). - */ - -/* - * Macros for pixel format defined - */ - -/* - * Revision 1.1 2004/04/20 11:13:11 alanh - * add SciTech's GLDirect driver for Windows. - * - * This code is donated to Mesa which allows the usage of - * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). - * - * No build system exists for this code yet, that will come..... - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.2 1999/01/03 03:08:57 brianp - * Ted Jump's changes - * - * Revision 1.1 1999/01/03 03:08:12 brianp - * Initial revision - * - * Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) - * Add LUTs need for dithering - */ - -/* - * Revision 1.1 2004/04/20 11:13:11 alanh - * add SciTech's GLDirect driver for Windows. - * - * This code is donated to Mesa which allows the usage of - * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). - * - * No build system exists for this code yet, that will come..... - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.2 1999/01/03 03:08:57 brianp - * Ted Jump's changes - * - * Revision 1.1 1999/01/03 03:08:12 brianp - * Initial revision - * - * Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) - * Add BGR8 Macro - */ - -/* - * Revision 1.1 2004/04/20 11:13:11 alanh - * add SciTech's GLDirect driver for Windows. - * - * This code is donated to Mesa which allows the usage of - * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). - * - * No build system exists for this code yet, that will come..... - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.2 1999/01/03 03:08:57 brianp - * Ted Jump's changes - * - * Revision 1.1 1999/01/03 03:08:12 brianp - * Initial revision - * - * Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) - * Initial revision - */ -/* Values for wmesa->pixelformat: */ - -#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */ -#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */ -#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */ -#define PF_DITHER8 6 /* Dithered RGB using a lookup table */ -#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */ -#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */ -#define PF_BADFORMAT 11 -#define PF_INDEX8 12 - -char ColorMap16[] = { -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, -0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, -0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, -0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, -0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, -0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, -0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, -0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, -0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, -0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, -0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B, -0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, -0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D, -0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E, -0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, -0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, -0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, -0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, -0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, -0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, -0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19, -0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, -0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B, -0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C, -0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D, -0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E, -0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}; - -#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5))) -#ifdef DDRAW -#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11))) -#else -#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10))) -#endif -#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8) -#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) - - - -/* - * If pixelformat==PF_8A8B8G8R: - */ -#define PACK_8A8B8G8R( R, G, B, A ) \ - ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) ) - - -/* - * If pixelformat==PF_8R8G8B: - */ -#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) ) - - -/* - * If pixelformat==PF_5R6G5B: - */ - - -#ifdef DDRAW -#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11))) -#else -#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10))) -#endif -/*---------------------------------------------------------------------------- - -Division lookup tables. These tables compute 0-255 divided by 51 and -modulo 51. These tables could approximate gamma correction. - -*/ - -char unsigned const aDividedBy51Rounded[256] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -}; - -char unsigned const aDividedBy51[256] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, -}; - -char unsigned const aModulo51[256] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, -}; - -/*---------------------------------------------------------------------------- - -Multiplication LUTs. These compute 0-5 times 6 and 36. - -*/ - -char unsigned const aTimes6[6] = -{ - 0, 6, 12, 18, 24, 30 -}; - -char unsigned const aTimes36[6] = -{ - 0, 36, 72, 108, 144, 180 -}; - - -/*---------------------------------------------------------------------------- - -Dither matrices for 8 bit to 2.6 bit halftones. - -*/ - -char unsigned const aHalftone16x16[256] = -{ - 0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43, - 34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21, - 38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6, - 22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34, - 2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42, - 37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20, - 40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4, - 24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32, - 2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41, - 37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19, - 40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3, - 24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31, - 1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43, - 36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21, - 39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5, - 23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33, -}; - -char unsigned const aHalftone8x8[64] = -{ - 0, 38, 9, 47, 2, 40, 11, 50, - 25, 12, 35, 22, 27, 15, 37, 24, - 6, 44, 3, 41, 8, 47, 5, 43, - 31, 19, 28, 15, 34, 21, 31, 18, - 1, 39, 11, 49, 0, 39, 10, 48, - 27, 14, 36, 23, 26, 13, 35, 23, - 7, 46, 4, 43, 7, 45, 3, 42, - 33, 20, 30, 17, 32, 19, 29, 16, -}; - -char unsigned const aHalftone4x4_1[16] = -{ - 0, 25, 6, 31, - 38, 12, 44, 19, - 9, 35, 3, 28, - 47, 22, 41, 15 -}; - -char unsigned const aHalftone4x4_2[16] = -{ - 41, 3, 9, 28, - 35, 15, 22, 47, - 6, 25, 38, 0, - 19, 44, 31, 12 -}; - -/*************************************************************************** - aWinGHalftoneTranslation - - Translates a 2.6 bit-per-pixel halftoned representation into the - slightly rearranged WinG Halftone Palette. -*/ - -char unsigned const aWinGHalftoneTranslation[216] = -{ - 0, - 29, - 30, - 31, - 32, - 249, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 250, - 250, - 57, - 58, - 59, - 251, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 250, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 227, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 151, - 120, - 121, - 122, - 123, - 124, - 228, - 125, - 126, - 229, - 133, - 162, - 135, - 131, - 132, - 137, - 166, - 134, - 140, - 130, - 136, - 143, - 138, - 139, - 174, - 141, - 142, - 177, - 129, - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 157, - 152, - 153, - 154, - 155, - 156, - 192, - 158, - 159, - 160, - 161, - 196, - 163, - 164, - 165, - 127, - 199, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 207, - 175, - 176, - 210, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 224, - 193, - 194, - 195, - 252, - 252, - 197, - 198, - 128, - 253, - 252, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 230, - 208, - 209, - 231, - 211, - 212, - 213, - 214, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 254, - 223, - 232, - 225, - 226, - 255, -}; diff --git a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c deleted file mode 100644 index 342a74286..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ /dev/null @@ -1,1720 +0,0 @@ -/**************************************************************************** -* -* 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/2000/XP/XBox (Win32) -* -* Description: Mesa Software WGL (WindowsGL) -* -****************************************************************************/ - -#include -#define GL_GLEXT_PROTOTYPES -#include -#include - -#include "glheader.h" -#include "colors.h" -#include "context.h" -#include "colormac.h" -#include "dd.h" -#include "depth.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -// #include "mem.h" -//#include "mmath.h" -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" -#include "teximage.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_lines.h" -#include "swrast/s_triangle.h" -#include "swrast/s_trispan.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -#include "dglcontext.h" -#include "gld_driver.h" - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - -DGL_pixelFormat pfTemplateMesaSW = -{ - { - sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure - 1, // Structure version - should be 1 - // Flags: - PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface. - PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM) - PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM) - PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing. - PFD_DOUBLEBUFFER | // The buffer is double-buffered. - 0, // Placeholder for easy commenting of above flags - PFD_TYPE_RGBA, // Pixel type RGBA. - 32, // Total colour bitplanes (excluding alpha bitplanes) - 8, 0, // Red bits, shift - 8, 8, // Green bits, shift - 8, 16, // Blue bits, shift - 8, 24, // Alpha bits, shift (destination alpha) - 64, // Accumulator bits (total) - 16, 16, 16, 16, // Accumulator bits: Red, Green, Blue, Alpha - 16, // Depth bits - 8, // Stencil bits - 0, // Number of auxiliary buffers - 0, // Layer type - 0, // Specifies the number of overlay and underlay planes. - 0, // Layer mask - 0, // Specifies the transparent color or index of an underlay plane. - 0 // Damage mask - }, - 0, // Unused -}; - -//--------------------------------------------------------------------------- -// Extensions -//--------------------------------------------------------------------------- - -typedef struct { - PROC proc; - char *name; -} GLD_extension; - -static GLD_extension GLD_extList[] = { -#ifdef GL_EXT_polygon_offset - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, -#endif - { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, - { (PROC)glBlendColorEXT, "glBlendColorExt" }, - { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, - { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, - { (PROC)glColorPointerEXT, "glColorPointerEXT" }, - { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, - { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, - { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, - { (PROC)glGetPointervEXT, "glGetPointervEXT" }, - { (PROC)glArrayElementEXT, "glArrayElementEXT" }, - { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, - { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, - { (PROC)glBindTextureEXT, "glBindTextureEXT" }, - { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, - { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, - { (PROC)glIsTextureEXT, "glIsTextureEXT" }, - { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, - { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, - { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, - { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, - { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, - { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, - { (PROC)glLockArraysEXT, "glLockArraysEXT" }, - { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" }, - { NULL, "\0" } -}; - -//--------------------------------------------------------------------------- -// WMesa Internal Functions -//--------------------------------------------------------------------------- - -#define PAGE_FILE 0xffffffff - -#define REDBITS 0x03 -#define REDSHIFT 0x00 -#define GREENBITS 0x03 -#define GREENSHIFT 0x03 -#define BLUEBITS 0x02 -#define BLUESHIFT 0x06 - -typedef struct _dibSection { - HDC hDC; - HANDLE hFileMap; - BOOL fFlushed; - LPVOID base; -} WMDIBSECTION, *PWMDIBSECTION; - -typedef struct wmesa_context { - HWND Window; - HDC hDC; - HPALETTE hPalette; - HPALETTE hOldPalette; - HPEN hPen; - HPEN hOldPen; - HCURSOR hOldCursor; - COLORREF crColor; - // 3D projection stuff - RECT drawRect; - UINT uiDIBoffset; - // OpenGL stuff - HPALETTE hGLPalette; - GLuint width; - GLuint height; - GLuint ScanWidth; - GLboolean db_flag; //* double buffered? - GLboolean rgb_flag; //* RGB mode? - GLboolean dither_flag; //* use dither when 256 color mode for RGB? - GLuint depth; //* bits per pixel (1, 8, 24, etc) - ULONG pixel; // current color index or RGBA pixel value - ULONG clearpixel; //* pixel for clearing the color buffers - PBYTE ScreenMem; // WinG memory - BITMAPINFO *IndexFormat; - HPALETTE hPal; // Current Palette - HPALETTE hPalHalfTone; - - - WMDIBSECTION dib; - BITMAPINFO bmi; - HBITMAP hbmDIB; - HBITMAP hOldBitmap; - HBITMAP Old_Compat_BM; - HBITMAP Compat_BM; // Bitmap for double buffering - PBYTE pbPixels; - int nColors; - BYTE cColorBits; - int pixelformat; - - RECT rectOffScreen; - RECT rectSurface; -// HWND hwnd; - DWORD pitch; - PBYTE addrOffScreen; - - // We always double-buffer, for performance reasons, but - // we need to know which of SwapBuffers() or glFlush() to - // handle. If we're emulating, then we update on Flush(), - // otherwise we update on SwapBufers(). KeithH - BOOL bEmulateSingleBuffer; -} WMesaContext, *PWMC; - -#define GLD_GET_WMESA_DRIVER(c) (WMesaContext*)(c)->glPriv - -// TODO: -GLint stereo_flag = 0 ; - -/* If we are double-buffering, we want to get the DC for the - * off-screen DIB, otherwise the DC for the window. - */ -#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) -#define DD_RELEASEDC - -#define FLIP(Y) (Current->height-(Y)-1) - -struct DISPLAY_OPTIONS { - int stereo; - int fullScreen; - int mode; - int bpp; -}; - -struct DISPLAY_OPTIONS displayOptions; - -//--------------------------------------------------------------------------- - -static unsigned char threeto8[8] = { - 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 -}; - -static unsigned char twoto8[4] = { - 0, 0x55, 0xaa, 0xff -}; - -static unsigned char oneto8[2] = { - 0, 255 -}; - -//--------------------------------------------------------------------------- - -BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) -{ - char unsigned redtemp, greentemp, bluetemp, paletteindex; - - //*** now, look up each value in the halftone matrix - //*** using an 8x8 ordered dither. - redtemp = aDividedBy51[red] - + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 - + scanline%8]); - greentemp = aDividedBy51[(char unsigned)green] - + (aModulo51[green] > aHalftone8x8[ - (pixel%8)*8 + scanline%8]); - bluetemp = aDividedBy51[(char unsigned)blue] - + (aModulo51[blue] > aHalftone8x8[ - (pixel%8)*8 +scanline%8]); - - //*** recombine the halftoned rgb values into a palette index - paletteindex = - redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; - - //*** and translate through the wing halftone palette - //*** translation vector to give the correct value. - return aWinGHalftoneTranslation[paletteindex]; -} - -//--------------------------------------------------------------------------- - -static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) -{ - unsigned char val; - - val = i >> shift; - switch (nbits) { - - case 1: - val &= 0x1; - return oneto8[val]; - - case 2: - val &= 0x3; - return twoto8[val]; - - case 3: - val &= 0x7; - return threeto8[val]; - - default: - return 0; - } -} - -//--------------------------------------------------------------------------- - - -void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) -{ - WMesaContext *Current = pwc; - - // Test for invalid scanline parameter. KeithH - if ((iScanLine < 0) || (iScanLine >= pwc->height)) - return; - - if (Current->db_flag) { - LPBYTE lpb = pwc->pbPixels; - UINT nBypp = pwc->cColorBits >> 3; - UINT nOffset = iPixel % nBypp; - - lpb += pwc->ScanWidth * iScanLine; - lpb += iPixel * nBypp; - - if(nBypp == 1){ - if(pwc->dither_flag) - *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); - else - *lpb = BGR8(r,g,b); - } - else if(nBypp == 2) - *((LPWORD)lpb) = BGR16(r,g,b); - else if (nBypp == 3) - *((LPDWORD)lpb) = BGR24(r,g,b); - else if (nBypp == 4) - *((LPDWORD)lpb) = BGR32(r,g,b); - } - else{ - SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); - } -} - -//--------------------------------------------------------------------------- - -void wmCreateDIBSection( - HDC hDC, - PWMC pwc, // handle of device context - CONST BITMAPINFO *pbmi, // bitmap size, format, and color data - UINT iUsage // color data type indicator: RGB values or palette indices - ) -{ - DWORD dwSize = 0; - DWORD dwScanWidth; - UINT nBypp = pwc->cColorBits / 8; - HDC hic; - - dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); - - pwc->ScanWidth =pwc->pitch = dwScanWidth; - - if (stereo_flag) - pwc->ScanWidth = 2* pwc->pitch; - - dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); - - pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, - NULL, - PAGE_READWRITE | SEC_COMMIT, - 0, - dwSize, - NULL); - - if (!pwc->dib.hFileMap) - return; - - pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, - FILE_MAP_ALL_ACCESS, - 0, - 0, - 0); - - if(!pwc->dib.base){ - CloseHandle(pwc->dib.hFileMap); - return; - } - - - CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); - - hic = CreateIC("display", NULL, NULL, NULL); - pwc->dib.hDC = CreateCompatibleDC(hic); - - - pwc->hbmDIB = CreateDIBSection(hic, - &(pwc->bmi), - (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), - pwc->dib.hFileMap, - 0); - pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; - pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); - - DeleteDC(hic); - - return; - -} - -//--------------------------------------------------------------------------- - -void wmCreatePalette( PWMC pwdc ) -{ - /* Create a compressed and re-expanded 3:3:2 palette */ - int i; - LOGPALETTE *pPal; - BYTE rb, rs, gb, gs, bb, bs; - - pwdc->nColors = 0x100; - - pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + - pwdc->nColors * sizeof(PALETTEENTRY)); - memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); - - pPal->palVersion = 0x300; - - rb = REDBITS; - rs = REDSHIFT; - gb = GREENBITS; - gs = GREENSHIFT; - bb = BLUEBITS; - bs = BLUESHIFT; - - if (pwdc->db_flag) { - - /* Need to make two palettes: one for the screen DC and one for the DIB. */ - pPal->palNumEntries = pwdc->nColors; - for (i = 0; i < pwdc->nColors; i++) { - pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); - pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); - pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); - pPal->palPalEntry[i].peFlags = 0; - } - pwdc->hGLPalette = CreatePalette( pPal ); - pwdc->hPalette = CreatePalette( pPal ); - } - - else { - pPal->palNumEntries = pwdc->nColors; - for (i = 0; i < pwdc->nColors; i++) { - pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); - pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); - pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); - pPal->palPalEntry[i].peFlags = 0; - } - pwdc->hGLPalette = CreatePalette( pPal ); - } - - free(pPal); - -} - -//--------------------------------------------------------------------------- - -/* This function sets the color table of a DIB section - * to match that of the destination DC - */ -BOOL wmSetDibColors(PWMC pwc) -{ - RGBQUAD *pColTab, *pRGB; - PALETTEENTRY *pPal, *pPE; - int i, nColors; - BOOL bRet=TRUE; - DWORD dwErr=0; - - /* Build a color table in the DIB that maps to the - * selected palette in the DC. - */ - nColors = 1 << pwc->cColorBits; - pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); - memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); - GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); - pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); - for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { - pRGB->rgbRed = pPE->peRed; - pRGB->rgbGreen = pPE->peGreen; - pRGB->rgbBlue = pPE->peBlue; - } - if(pwc->db_flag) - bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); - - if(!bRet) - dwErr = GetLastError(); - - free( pColTab ); - free( pPal ); - - return bRet; -} - -//--------------------------------------------------------------------------- - -static void wmSetPixelFormat( PWMC wc, HDC hDC) -{ - if(wc->rgb_flag) - wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); - else - wc->cColorBits = 8; - switch(wc->cColorBits){ - case 8: - if(wc->dither_flag != GL_TRUE) - wc->pixelformat = PF_INDEX8; - else - wc->pixelformat = PF_DITHER8; - break; - case 16: - wc->pixelformat = PF_5R6G5B; - break; - case 32: - wc->pixelformat = PF_8R8G8B; - break; - default: - wc->pixelformat = PF_BADFORMAT; - } -} - -//--------------------------------------------------------------------------- - -/* - * This function creates the DIB section that is used for combined - * GL and GDI calls - */ -BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) -{ - HDC hdc = pwc->hDC; - LPBITMAPINFO pbmi = &(pwc->bmi); - int iUsage; - - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = lxSize; - pbmi->bmiHeader.biHeight= -lySize; - pbmi->bmiHeader.biPlanes = 1; - if(pwc->rgb_flag) - pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); - else - pbmi->bmiHeader.biBitCount = 8; - 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; - - iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; - - pwc->cColorBits = pbmi->bmiHeader.biBitCount; - pwc->ScanWidth = pwc->pitch = lxSize; - pwc->width = lxSize; - pwc->height = lySize; - - wmCreateDIBSection(hdc, pwc, pbmi, iUsage); - - if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { - wmCreatePalette( pwc ); - wmSetDibColors( pwc ); - } - wmSetPixelFormat(pwc, pwc->hDC); - return TRUE; -} - -//--------------------------------------------------------------------------- - -/* - * Free up the dib section that was created - */ -BOOL wmDeleteBackingStore(PWMC pwc) -{ - SelectObject(pwc->dib.hDC, pwc->hOldBitmap); - DeleteDC(pwc->dib.hDC); - DeleteObject(pwc->hbmDIB); - UnmapViewOfFile(pwc->dib.base); - CloseHandle(pwc->dib.hFileMap); - return TRUE; -} - -//--------------------------------------------------------------------------- - -/* - * Blit memory DC to screen DC - */ -BOOL wmFlush(PWMC pwc, HDC hDC) -{ - BOOL bRet = 0; - DWORD dwErr = 0; - -// Now using bEmulateSingleBuffer in the calling function. KeithH - -// if(pwc->db_flag){ - bRet = BitBlt(hDC, 0, 0, pwc->width, pwc->height, - pwc->dib.hDC, 0, 0, SRCCOPY); -// } - - return bRet; - -} - -//--------------------------------------------------------------------------- -// Support Functions -//--------------------------------------------------------------------------- - -static void flush(GLcontext* ctx) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); -/* - if((Current->rgb_flag &&!(Current->db_flag)) - ||(!Current->rgb_flag)) - { - wmFlush(Current, Current->hDC); - } -*/ - // Only flush if we're not in double-buffer mode. KeithH - // The demo fractal.c calls glutSwapBuffers() then glFlush()! - if (Current->bEmulateSingleBuffer) { - wmFlush(Current, Current->hDC); - } -} - - -//--------------------------------------------------------------------------- - - -/* - * Set the color index used to clear the color buffer. - */ -static void clear_index(GLcontext* ctx, GLuint index) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - Current->clearpixel = index; -} - - - -//--------------------------------------------------------------------------- - -/* - * Set the color used to clear the color buffer. - */ -//static void clear_color( GLcontext* ctx, const GLchan color[4] ) -// Changed for Mesa 5.x. KeithH -static void clear_color( - GLcontext* ctx, - const GLfloat color[4]) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - GLubyte col[4]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - Current->clearpixel = RGB(col[0], col[1], col[2]); -} - - -//--------------------------------------------------------------------------- - - -/* - * 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. - * We also only clear the color buffers if the color masks are all 1's. - * Otherwise, we let swrast do it. - */ - -static clear(GLcontext* ctx, GLbitfield mask, - GLboolean all, GLint x, GLint y, GLint width, GLint height) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - DWORD dwColor; - WORD wColor; - BYTE bColor; - LPDWORD lpdw = (LPDWORD)Current->pbPixels; - LPWORD lpw = (LPWORD)Current->pbPixels; - LPBYTE lpb = Current->pbPixels; - int lines; - const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; - - if (all){ - x=y=0; - width=Current->width; - height=Current->height; - } - - - /* sanity check - can't have right(stereo) buffers */ - assert((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT)) == 0); - - /* clear alpha */ - if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_RIGHT_BIT)) && - ctx->DrawBuffer->UseSoftwareAlphaBuffers && - ctx->Color.ColorMask[ACOMP]) { - _swrast_clear_alpha_buffers( ctx ); - } - - if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { - if (mask & DD_BACK_LEFT_BIT) { - /* Double-buffering - clear back buffer */ - UINT nBypp = Current->cColorBits / 8; - int i = 0; - int iSize = 0; - - assert(Current->db_flag==GL_TRUE); /* we'd better be double buffer */ - if(nBypp ==1 ){ - iSize = Current->width/4; - bColor = BGR8(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - wColor = MAKEWORD(bColor,bColor); - dwColor = MAKELONG(wColor, wColor); - } - if(nBypp == 2){ - iSize = Current->width / 2; - wColor = BGR16(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - dwColor = MAKELONG(wColor, wColor); - } - else if(nBypp == 4){ - iSize = Current->width; - dwColor = BGR32(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - } - - /* clear a line */ - while(i < iSize){ - *lpdw = dwColor; - lpdw++; - i++; - } - - /* This is the 24bit case */ - if (nBypp == 3) { - iSize = Current->width *3/4; - dwColor = BGR24(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - while(i < iSize){ - *lpdw = dwColor; - lpb += nBypp; - lpdw = (LPDWORD)lpb; - i++; - } - } - - i = 0; - if (stereo_flag) - lines = height /2; - else - lines = height; - /* copy cleared line to other lines in buffer */ - do { - memcpy(lpb, Current->pbPixels, iSize*4); - lpb += Current->ScanWidth; - i++; - } - while (iclearpixel); - HBRUSH Brush=CreateSolidBrush(Current->clearpixel); - HPEN Old_Pen=SelectObject(DC,Pen); - HBRUSH Old_Brush=SelectObject(DC,Brush); - Rectangle(DC,x,y,x+width,y+height); - SelectObject(DC,Old_Pen); - SelectObject(DC,Old_Brush); - DeleteObject(Pen); - DeleteObject(Brush); - DD_RELEASEDC; - mask &= ~DD_FRONT_LEFT_BIT; - } /* single-buffer */ - } /* if masks are all 1's */ - - /* Call swrast if there is anything left to clear (like DEPTH) */ - if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); -} - - -//--------------------------------------------------------------------------- - - -static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - - if (!Current) - return; - - if (pname == GL_DITHER) { - if(enable == GL_FALSE){ - Current->dither_flag = GL_FALSE; - if(Current->cColorBits == 8) - Current->pixelformat = PF_INDEX8; - } - else{ - if (Current->rgb_flag && Current->cColorBits == 8){ - Current->pixelformat = PF_DITHER8; - Current->dither_flag = GL_TRUE; - } - else - Current->dither_flag = GL_FALSE; - } - } -} - -//--------------------------------------------------------------------------- - -static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) -{ - /* TODO: this could be better */ - if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - -//--------------------------------------------------------------------------- - - -static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer ) -{ - /* XXX todo */ - return; -} - - -//--------------------------------------------------------------------------- - - -/* Return characteristics of the output buffer. */ -//static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) -// Altered for Mesa 5.x. KeithH -static void buffer_size( - GLframebuffer *buffer, - GLuint *width, - GLuint *height) -{ - // For some reason the context is not passed into this function. - // Therefore we have to explicitly retrieve it. - GET_CURRENT_CONTEXT(ctx); - - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - int New_Size; - RECT CR; - - GetClientRect(Current->Window,&CR); - - *width=CR.right; - *height=CR.bottom; - - New_Size=((*width)!=Current->width) || ((*height)!=Current->height); - - if (New_Size){ - Current->width=*width; - Current->height=*height; - Current->ScanWidth=Current->width; - if ((Current->ScanWidth%sizeof(long))!=0) - Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); - - if (Current->db_flag){ - if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ - wmDeleteBackingStore(Current); - wmCreateBackingStore(Current, Current->width, Current->height); - } - } - - } -} - - - -/**********************************************************************/ -/***** Accelerated point, line, polygon rendering *****/ -/**********************************************************************/ - -/* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */ - -static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) -{ -} - -//--------------------------------------------------------------------------- - -/* Return pointer to accelerated points function */ -extern tnl_points_func choose_points_function( GLcontext* ctx ) -{ - return NULL; -} - -//--------------------------------------------------------------------------- - -static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, - GLuint v1, GLuint pv ) -{ -} - -//--------------------------------------------------------------------------- - -static tnl_line_func choose_line_function( GLcontext* ctx ) -{ -} - - -/**********************************************************************/ -/***** Span-based pixel drawing *****/ -/**********************************************************************/ - - -/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ -static void write_ci32_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLuint index[], - const GLubyte mask[] ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - GLuint i; - PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; irgb_flag==GL_TRUE) - { - GLuint i; - HDC DC=DD_GETDC; - y=FLIP(y); - if (mask) { - for (i=0; iScreenMem+y*Current->ScanWidth+x; - y = FLIP(y); - if (mask) { - for (i=0; ihPal, - RGB(rgba[i][RCOMP], - rgba[i][GCOMP], - rgba[i][BCOMP])); - } - else { - for (i=0; ihPal, - RGB(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( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], const GLubyte mask[] ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - PWMC pwc = Current; - - if (pwc->rgb_flag==GL_TRUE) - { - GLuint i; - HDC DC=DD_GETDC; - y=FLIP(y); - if (mask) { - for (i=0; iScreenMem+y*Current->ScanWidth+x; - y = FLIP(y); - if (mask) { - for (i=0; ihPal, - RGB(rgb[i][RCOMP], - rgb[i][GCOMP], - rgb[i][BCOMP])); - } - else { - for (i=0; ihPal, - 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( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); - GLuint i; - HDC DC=DD_GETDC; - PWMC pwc = Current; - assert(Current->rgb_flag==GL_TRUE); - y=FLIP(y); - if(Current->rgb_flag==GL_TRUE){ - for (i=0; irgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = index[i]; - } - } -} - - -//--------------------------------------------------------------------------- - - -/* - * Write an array of pixels with a boolean mask. The current color - * index is used for all pixels. - */ -static void write_mono_ci_pixels( const GLcontext* ctx, - GLuint n, - const GLint x[], const GLint y[], - GLuint colorIndex, const GLubyte mask[] ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - GLuint i; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = colorIndex; - } - } -} - - -//--------------------------------------------------------------------------- - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels( const GLcontext* ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - GLuint i; - PWMC pwc = Current; - HDC DC=DD_GETDC; - assert(Current->rgb_flag==GL_TRUE); - for (i=0; irgb_flag==GL_TRUE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; irgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); - } - } -} - -//--------------------------------------------------------------------------- - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4] ) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - UINT i; - COLORREF Color; - HDC DC=DD_GETDC; - assert(Current->rgb_flag==GL_TRUE); - y = Current->height - y - 1; - for (i=0; irgb_flag==GL_TRUE); - for (i=0; iheight - y[i] - 1; - Color=GetPixel(DC,x[i],y2); - rgba[i][RCOMP] = GetRValue(Color); - rgba[i][GCOMP] = GetGValue(Color); - rgba[i][BCOMP] = GetBValue(Color); - rgba[i][ACOMP] = 255; - } - } - DD_RELEASEDC; -} - -//--------------------------------------------------------------------------- - -static void wmesa_update_state( - GLcontext *ctx, - GLuint new_state) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); -} - -//--------------------------------------------------------------------------- - -static void wmesa_viewport( - GLcontext *ctx, - GLint x, - GLint y, - GLsizei w, - GLsizei h) -{ -// ctx->Driver.ResizeBuffersMESA(ctx); -} - -//--------------------------------------------------------------------------- - -static void wmesa_update_state_first_time( - GLcontext *ctx, - GLuint new_state) -{ - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - - /* - * XXX these function pointers could be initialized just once during - * context creation since they don't depend on any state changes. - * kws - This is true - this function gets called a lot and it - * would be good to minimize setting all this when not needed. - */ - // Good idea, so I'll do it. KeithH. :-) - - ctx->Driver.GetString = _gldGetStringGeneric; - ctx->Driver.UpdateState = wmesa_update_state; - ctx->Driver.DrawBuffer = set_draw_buffer; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; - ctx->Driver.GetBufferSize = buffer_size; - - ctx->Driver.Viewport = wmesa_viewport; - - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.Clear = clear; - - ctx->Driver.Flush = flush; - ctx->Driver.ClearIndex = clear_index; - ctx->Driver.ClearColor = clear_color; - ctx->Driver.Enable = enable; - - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = _mesa_store_teximage2d; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - - // Does not apply for Mesa 5.x - //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; - //ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size; - //ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage; - - swdd->SetBuffer = set_read_buffer; - - - /* Pixel/span writing functions: */ - swdd->WriteRGBASpan = write_rgba_span; - swdd->WriteRGBSpan = write_rgb_span; - swdd->WriteMonoRGBASpan = write_mono_rgba_span; - swdd->WriteRGBAPixels = write_rgba_pixels; - swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels; - swdd->WriteCI32Span = write_ci32_span; - swdd->WriteCI8Span = write_ci8_span; - swdd->WriteMonoCISpan = write_mono_ci_span; - swdd->WriteCI32Pixels = write_ci32_pixels; - swdd->WriteMonoCIPixels = write_mono_ci_pixels; - - swdd->ReadCI32Span = read_ci32_span; - swdd->ReadRGBASpan = read_rgba_span; - swdd->ReadCI32Pixels = read_ci32_pixels; - swdd->ReadRGBAPixels = read_rgba_pixels; - - - tnl->Driver.RunPipeline = _tnl_run_pipeline; - - wmesa_update_state(ctx, new_state); -} - -//--------------------------------------------------------------------------- -// Driver interface functions -//--------------------------------------------------------------------------- - -BOOL gldCreateDrawable_MesaSW( - DGL_ctx *pCtx, - BOOL bPersistantInterface, - BOOL bPersistantBuffers) -{ - WMesaContext *c; - GLboolean true_color_flag; - GLboolean rgb_flag = GL_TRUE; - GLboolean db_flag = GL_TRUE; - - if (pCtx == NULL) - return FALSE; - - c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); - if (!c) - return FALSE; - - pCtx->glPriv = c; - - c->hDC = pCtx->hDC; - c->Window = pCtx->hWnd; - - true_color_flag = GetDeviceCaps(pCtx->hDC, BITSPIXEL) > 8; - - -#ifdef DITHER - if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ - c->dither_flag = GL_TRUE; - c->hPalHalfTone = WinGCreateHalftonePalette(); - } - else - c->dither_flag = GL_FALSE; -#else - c->dither_flag = GL_FALSE; -#endif - - - if (rgb_flag==GL_FALSE) - { - c->rgb_flag = GL_FALSE; -#if 0 - /* Old WinG stuff???? */ - c->db_flag = db_flag =GL_TRUE; /* WinG requires double buffering */ - printf("Single buffer is not supported in color index mode, ", - "setting to double buffer.\n"); -#endif - } - else - { - c->rgb_flag = GL_TRUE; - } - -// db_flag = pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? GL_TRUE : GL_FALSE; - db_flag = GL_TRUE; // Force double-buffer - if (db_flag) { - c->db_flag = 1; - /* Double buffered */ - { - wmCreateBackingStore(c, pCtx->dwWidth, pCtx->dwHeight); - - } - } else { - /* Single Buffered */ - if (c->rgb_flag) - c->db_flag = 0; - } - - c->bEmulateSingleBuffer = (pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER) - ? FALSE : TRUE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldResizeDrawable_MesaSW( - DGL_ctx *ctx, - BOOL bDefaultDriver, - BOOL bPersistantInterface, - BOOL bPersistantBuffers) -{ - WMesaContext *c; - - if (ctx == NULL) - return FALSE; - - c = ctx->glPriv; - if (c == NULL) - return FALSE; - - c->hDC = ctx->hDC; - c->Window = ctx->hWnd; -// c->width = ctx->dwWidth; -// c->height = ctx->dwHeight; - - if (c->db_flag) { - wmDeleteBackingStore(c); - wmCreateBackingStore(c, ctx->dwWidth, ctx->dwHeight); - } - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyDrawable_MesaSW( - DGL_ctx *ctx) -{ - WMesaContext *c; - - if (ctx == NULL) - return FALSE; - - c = ctx->glPriv; - if (c == NULL) - return FALSE; - - if (c->hPalHalfTone != NULL) - DeleteObject(c->hPalHalfTone); - - if (c->db_flag) - wmDeleteBackingStore(c); - - free(c); - - ctx->glPriv = NULL; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldCreatePrivateGlobals_MesaSW(void) -{ - // Mesa Software driver needs no private globals - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldDestroyPrivateGlobals_MesaSW(void) -{ - // Mesa Software driver needs no private globals - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldBuildPixelformatList_MesaSW(void) -{ - // Release any existing pixelformat list - if (glb.lpPF) { - free(glb.lpPF); - } - - glb.nPixelFormatCount = 0; - glb.lpPF = NULL; - - glb.lpPF = (DGL_pixelFormat *)calloc(2, sizeof(DGL_pixelFormat)); - if (glb.lpPF == NULL) - return FALSE; - // Single-buffered - memcpy(&glb.lpPF[0], &pfTemplateMesaSW, sizeof(DGL_pixelFormat)); - glb.lpPF[0].pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag - // Double-buffered - memcpy(&glb.lpPF[1], &pfTemplateMesaSW, sizeof(DGL_pixelFormat)); - glb.nPixelFormatCount = 2; - - // Mark list as 'current' - glb.bPixelformatsDirty = FALSE; - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldInitialiseMesa_MesaSW( - DGL_ctx *gld) -{ - GLcontext *ctx; - - if (gld == NULL) - return FALSE; - - ctx = gld->glCtx; - - // Set max texture size to 256 - ctx->Const.MaxTextureLevels = 8; - - // Multitexture enable/disable - ctx->Const.MaxTextureUnits = (glb.bMultitexture) ? MAX_TEXTURE_UNITS : 1; - - /* Initialize the software rasterizer and helper modules.*/ - - // Added this to force max texture diminsion to 256. KeithH - ctx->Const.MaxTextureLevels = 8; - ctx->Const.MaxDrawBuffers = 1; - - _mesa_enable_sw_extensions(ctx); - _mesa_enable_imaging_extensions(ctx); - _mesa_enable_1_3_extensions(ctx); - -// _swrast_CreateContext( ctx ); -// _vbo_CreateContext( ctx ); -// _tnl_CreateContext( ctx ); -// _swsetup_CreateContext( ctx ); - - _swsetup_Wakeup( ctx ); - - wmesa_update_state_first_time(ctx, ~0); - - return TRUE; -} - -//--------------------------------------------------------------------------- - -BOOL gldSwapBuffers_MesaSW( - DGL_ctx *ctx, - HDC hDC, - HWND hWnd) -{ - WMesaContext *c; - - if (ctx == NULL) - return FALSE; - - c = ctx->glPriv; - if (c == NULL) - return FALSE; - - /* If we're swapping the buffer associated with the current context - * we have to flush any pending rendering commands first. - */ - - // Altered to respect bEmulateSingleBuffer. KeithH -// if (c->db_flag) - if (!c->bEmulateSingleBuffer) - wmFlush(c, hDC); - - return TRUE; -} - -//--------------------------------------------------------------------------- - -PROC gldGetProcAddress_MesaSW( - LPCSTR a) -{ - int i; - PROC proc = NULL; - - for (i=0; GLD_extList[i].proc; i++) { - if (!strcmp(a, GLD_extList[i].name)) { - proc = GLD_extList[i].proc; - break; - } - } - - gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed"); - - return proc; -} - -//--------------------------------------------------------------------------- - -BOOL gldGetDisplayMode_MesaSW( - DGL_ctx *ctx, - GLD_displayMode *glddm) -{ - HDC hdcDesktop; - - if (glddm == NULL) - return FALSE; - - // - // A bit hacky... KeithH - // - - hdcDesktop = GetDC(NULL); - glddm->Width = GetDeviceCaps(hdcDesktop, HORZRES); - glddm->Height = GetDeviceCaps(hdcDesktop, VERTRES); - glddm->BPP = GetDeviceCaps(hdcDesktop, BITSPIXEL); - glddm->Refresh = 0; - ReleaseDC(0, hdcDesktop); - - return TRUE; -} - -//--------------------------------------------------------------------------- - diff --git a/mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref b/mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref deleted file mode 100644 index 2f71faf21..000000000 --- a/mesalib/src/mesa/drivers/windows/gldirect/opengl32.ref +++ /dev/null @@ -1,495 +0,0 @@ -;**************************************************************************** -;* -;* 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/2000/XP/XBox (Win32) -;* -;* Description: DLL Module definition file -;* -;****************************************************************************/ - -DESCRIPTION 'GLDirect' - -VERSION 3.0 - -EXPORTS - glAccum - glAlphaFunc - glAreTexturesResident - glArrayElement - glBegin - glBindTexture - glBitmap - glBlendFunc - glCallList - glCallLists - glClear - glClearAccum - glClearIndex - glClearColor - glClearDepth - glClearStencil - glClipPlane - glColor3b - glColor3d - glColor3f - glColor3i - glColor3s - glColor3ub - glColor3ui - glColor3us - glColor4b - glColor4d - glColor4f - glColor4i - glColor4s - glColor4ub - glColor4ui - glColor4us - glColor3bv - glColor3dv - glColor3fv - glColor3iv - glColor3sv - glColor3ubv - glColor3uiv - glColor3usv - glColor4bv - glColor4dv - glColor4fv - glColor4iv - glColor4sv - glColor4ubv - glColor4uiv - glColor4usv - glColorMask - glColorMaterial - glColorPointer - glColorTableEXT - glColorSubTableEXT - glCopyPixels - glCopyTexImage1D - glCopyTexImage2D - glCopyTexSubImage1D - glCopyTexSubImage2D - glCullFace - glDepthFunc - glDepthMask - glDepthRange - glDeleteLists - glDeleteTextures - glDisable - glDisableClientState - glDrawArrays - glDrawBuffer - glDrawElements - glDrawPixels - glEnable - glEnableClientState - glEnd - glEndList - glEvalCoord1d - glEvalCoord1f - glEvalCoord1dv - glEvalCoord1fv - glEvalCoord2d - glEvalCoord2f - glEvalCoord2dv - glEvalCoord2fv - glEvalPoint1 - glEvalPoint2 - glEvalMesh1 - glEdgeFlag - glEdgeFlagv - glEdgeFlagPointer - glEvalMesh2 - glFeedbackBuffer - glFinish - glFlush - glFogf - glFogi - glFogfv - glFogiv - glFrontFace - glFrustum - glGenLists - glGenTextures - glGetBooleanv - glGetClipPlane - glGetColorTableEXT - glGetColorTableParameterivEXT - glGetColorTableParameterfvEXT - glGetDoublev - glGetError - glGetFloatv - glGetIntegerv - glGetLightfv - glGetLightiv - glGetMapdv - glGetMapfv - glGetMapiv - glGetMaterialfv - glGetMaterialiv - glGetPixelMapfv - glGetPixelMapuiv - glGetPixelMapusv - glGetPointerv - glGetPolygonStipple - glGetString - glGetTexEnvfv - glGetTexEnviv - glGetTexGeniv - glGetTexGendv - glGetTexGenfv - glGetTexImage - glGetTexLevelParameterfv - glGetTexLevelParameteriv - glGetTexParameterfv - glGetTexParameteriv - glHint - glIndexd - glIndexf - glIndexi - glIndexs - glIndexub - glIndexdv - glIndexfv - glIndexiv - glIndexsv - glIndexubv - glIndexMask - glIndexPointer - glInterleavedArrays - glInitNames - glIsList - glIsTexture - glLightf - glLighti - glLightfv - glLightiv - glLightModelf - glLightModeli - glLightModelfv - glLightModeliv - glLineWidth - glLineStipple - glListBase - glLoadIdentity - glLoadMatrixd - glLoadMatrixf - glLoadName - glLogicOp - glMap1d - glMap1f - glMap2d - glMap2f - glMapGrid1d - glMapGrid1f - glMapGrid2d - glMapGrid2f - glMaterialf - glMateriali - glMaterialfv - glMaterialiv - glMatrixMode - glMultMatrixd - glMultMatrixf - glNewList - glNormal3b - glNormal3d - glNormal3f - glNormal3i - glNormal3s - glNormal3bv - glNormal3dv - glNormal3fv - glNormal3iv - glNormal3sv - glNormalPointer - glOrtho - glPassThrough - glPixelMapfv - glPixelMapuiv - glPixelMapusv - glPixelStoref - glPixelStorei - glPixelTransferf - glPixelTransferi - glPixelZoom - glPointSize - glPolygonMode - glPolygonOffset - glPolygonOffsetEXT - glPolygonStipple - glPopAttrib - glPopClientAttrib - glPopMatrix - glPopName - glPrioritizeTextures - glPushMatrix - glRasterPos2d - glRasterPos2f - glRasterPos2i - glRasterPos2s - glRasterPos3d - glRasterPos3f - glRasterPos3i - glRasterPos3s - glRasterPos4d - glRasterPos4f - glRasterPos4i - glRasterPos4s - glRasterPos2dv - glRasterPos2fv - glRasterPos2iv - glRasterPos2sv - glRasterPos3dv - glRasterPos3fv - glRasterPos3iv - glRasterPos3sv - glRasterPos4dv - glRasterPos4fv - glRasterPos4iv - glRasterPos4sv - glReadBuffer - glReadPixels - glRectd - glRectf - glRecti - glRects - glRectdv - glRectfv - glRectiv - glRectsv - glScissor - glIsEnabled - glPushAttrib - glPushClientAttrib - glPushName - glRenderMode - glRotated - glRotatef - glSelectBuffer - glScaled - glScalef - glShadeModel - glStencilFunc - glStencilMask - glStencilOp - glTexCoord1d - glTexCoord1f - glTexCoord1i - glTexCoord1s - glTexCoord2d - glTexCoord2f - glTexCoord2i - glTexCoord2s - glTexCoord3d - glTexCoord3f - glTexCoord3i - glTexCoord3s - glTexCoord4d - glTexCoord4f - glTexCoord4i - glTexCoord4s - glTexCoord1dv - glTexCoord1fv - glTexCoord1iv - glTexCoord1sv - glTexCoord2dv - glTexCoord2fv - glTexCoord2iv - glTexCoord2sv - glTexCoord3dv - glTexCoord3fv - glTexCoord3iv - glTexCoord3sv - glTexCoord4dv - glTexCoord4fv - glTexCoord4iv - glTexCoord4sv - glTexCoordPointer - glTexGend - glTexGenf - glTexGeni - glTexGendv - glTexGeniv - glTexGenfv - glTexEnvf - glTexEnvi - glTexEnvfv - glTexEnviv - glTexImage1D - glTexImage2D - glTexParameterf - glTexParameteri - glTexParameterfv - glTexParameteriv - glTexSubImage1D - glTexSubImage2D - glTranslated - glTranslatef - glVertex2d - glVertex2f - glVertex2i - glVertex2s - glVertex3d - glVertex3f - glVertex3i - glVertex3s - glVertex4d - glVertex4f - glVertex4i - glVertex4s - glVertex2dv - glVertex2fv - glVertex2iv - glVertex2sv - glVertex3dv - glVertex3fv - glVertex3iv - glVertex3sv - glVertex4dv - glVertex4fv - glVertex4iv - glVertex4sv - glVertexPointer - glViewport - - glBlendEquationEXT - glBlendColorEXT - glVertexPointerEXT - glNormalPointerEXT - glColorPointerEXT - glIndexPointerEXT - glTexCoordPointerEXT - glEdgeFlagPointerEXT - glGetPointervEXT - glArrayElementEXT - glDrawArraysEXT - glBindTextureEXT - glDeleteTexturesEXT - glGenTexturesEXT - glPrioritizeTexturesEXT - glCopyTexSubImage3DEXT - glTexImage3DEXT - glTexSubImage3DEXT - - glWindowPos4fMESA - glWindowPos2iMESA - glWindowPos2sMESA - glWindowPos2fMESA - glWindowPos2dMESA - glWindowPos2ivMESA - glWindowPos2svMESA - glWindowPos2fvMESA - glWindowPos2dvMESA - glWindowPos3iMESA - glWindowPos3sMESA - glWindowPos3fMESA - glWindowPos3dMESA - glWindowPos3ivMESA - glWindowPos3svMESA - glWindowPos3fvMESA - glWindowPos3dvMESA - glWindowPos4iMESA - glWindowPos4sMESA - glWindowPos4dMESA - glWindowPos4ivMESA - glWindowPos4svMESA - glWindowPos4fvMESA - glWindowPos4dvMESA - glResizeBuffersMESA - - wglCopyContext - wglCreateContext - wglCreateLayerContext - wglDeleteContext - wglDescribeLayerPlane - wglGetCurrentContext - wglGetCurrentDC - wglGetLayerPaletteEntries - wglGetProcAddress - wglMakeCurrent - wglRealizeLayerPalette - wglSetLayerPaletteEntries - wglShareLists - wglSwapLayerBuffers - wglUseFontBitmapsA - wglUseFontBitmapsW - wglUseFontOutlinesA - wglUseFontOutlinesW - -;These functions are identical and therefore share the same addresses - ChoosePixelFormat = wglChoosePixelFormat - DescribePixelFormat = wglDescribePixelFormat - GetPixelFormat = wglGetPixelFormat - SetPixelFormat = wglSetPixelFormat - SwapBuffers = wglSwapBuffers - - wglChoosePixelFormat - wglDescribePixelFormat - wglGetPixelFormat - wglSetPixelFormat - wglSwapBuffers - - 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 diff --git a/mesalib/src/mesa/drivers/windows/icd/mesa.def b/mesalib/src/mesa/drivers/windows/icd/mesa.def index 465b380a0..25ac08a2f 100644 --- a/mesalib/src/mesa/drivers/windows/icd/mesa.def +++ b/mesalib/src/mesa/drivers/windows/icd/mesa.def @@ -75,6 +75,15 @@ EXPORTS _mesa_strcmp _mesa_test_proxy_teximage _mesa_Viewport + _mesa_meta_CopyColorSubTable + _mesa_meta_CopyColorTable + _mesa_meta_CopyConvolutionFilter1D + _mesa_meta_CopyConvolutionFilter2D + _mesa_meta_CopyTexImage1D + _mesa_meta_CopyTexImage2D + _mesa_meta_CopyTexSubImage1D + _mesa_meta_CopyTexSubImage2D + _mesa_meta_CopyTexSubImage3D _swrast_Accum _swrast_Bitmap _swrast_CopyPixels @@ -84,15 +93,6 @@ EXPORTS _swrast_Clear _swrast_choose_line _swrast_choose_triangle - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_CopyConvolutionFilter1D - _swrast_CopyConvolutionFilter2D - _swrast_copy_teximage1d - _swrast_copy_teximage2d - _swrast_copy_texsubimage1d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext _swrast_InvalidateState diff --git a/mesalib/src/mesa/glapi/APPLE_vertex_array_object.xml b/mesalib/src/mesa/glapi/APPLE_vertex_array_object.xml deleted file mode 100644 index bd8427eaf..000000000 --- a/mesalib/src/mesa/glapi/APPLE_vertex_array_object.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/ARB_copy_buffer.xml b/mesalib/src/mesa/glapi/ARB_copy_buffer.xml deleted file mode 100644 index 719816d81..000000000 --- a/mesalib/src/mesa/glapi/ARB_copy_buffer.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/ARB_framebuffer_object.xml b/mesalib/src/mesa/glapi/ARB_framebuffer_object.xml deleted file mode 100644 index b700e7e77..000000000 --- a/mesalib/src/mesa/glapi/ARB_framebuffer_object.xml +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/ARB_map_buffer_range.xml b/mesalib/src/mesa/glapi/ARB_map_buffer_range.xml deleted file mode 100644 index afcb9b6ba..000000000 --- a/mesalib/src/mesa/glapi/ARB_map_buffer_range.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/ARB_seamless_cube_map.xml b/mesalib/src/mesa/glapi/ARB_seamless_cube_map.xml deleted file mode 100644 index 3cdc84d2b..000000000 --- a/mesalib/src/mesa/glapi/ARB_seamless_cube_map.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/ARB_sync.xml b/mesalib/src/mesa/glapi/ARB_sync.xml deleted file mode 100644 index 37f474980..000000000 --- a/mesalib/src/mesa/glapi/ARB_sync.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/ARB_vertex_array_object.xml b/mesalib/src/mesa/glapi/ARB_vertex_array_object.xml deleted file mode 100644 index 3b4ab64f5..000000000 --- a/mesalib/src/mesa/glapi/ARB_vertex_array_object.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/EXT_framebuffer_object.xml b/mesalib/src/mesa/glapi/EXT_framebuffer_object.xml deleted file mode 100644 index 5559b48b1..000000000 --- a/mesalib/src/mesa/glapi/EXT_framebuffer_object.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/EXT_provoking_vertex.xml b/mesalib/src/mesa/glapi/EXT_provoking_vertex.xml deleted file mode 100644 index f528a2c7d..000000000 --- a/mesalib/src/mesa/glapi/EXT_provoking_vertex.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/EXT_texture_array.xml b/mesalib/src/mesa/glapi/EXT_texture_array.xml deleted file mode 100644 index e5bd9f3c6..000000000 --- a/mesalib/src/mesa/glapi/EXT_texture_array.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/Makefile b/mesalib/src/mesa/glapi/Makefile deleted file mode 100644 index 65edab7ce..000000000 --- a/mesalib/src/mesa/glapi/Makefile +++ /dev/null @@ -1,152 +0,0 @@ -# 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 - -OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \ - ../main/enums.c \ - ../x86/glapi_x86.S \ - ../x86-64/glapi_x86-64.S \ - ../sparc/glapi_sparc.S \ - ../drivers/dri/common/extension_helper.h \ - ../../glx/x11/indirect.c \ - ../../glx/x11/indirect.h \ - ../../glx/x11/indirect_init.c \ - ../../glx/x11/indirect_size.h \ - ../../glx/x11/indirect_size.c - - -GLX_DIR = $(XORG_BASE)/glx - -SERVER_GLAPI_FILES = \ - $(GLX_DIR)/glapi.h \ - $(GLX_DIR)/glapi.c \ - $(GLX_DIR)/glthread.c \ - $(GLX_DIR)/glthread.h - -SERVER_OUTPUTS = \ - $(GLX_DIR)/indirect_dispatch.c \ - $(GLX_DIR)/indirect_dispatch_swap.c \ - $(GLX_DIR)/indirect_dispatch.h \ - $(GLX_DIR)/indirect_reqsize.c \ - $(GLX_DIR)/indirect_reqsize.h \ - $(GLX_DIR)/indirect_size.h \ - $(GLX_DIR)/indirect_size_get.c \ - $(GLX_DIR)/indirect_size_get.h \ - $(GLX_DIR)/indirect_table.c \ - $(GLX_DIR)/glapitemp.h \ - $(GLX_DIR)/glapitable.h \ - $(GLX_DIR)/glapioffsets.h \ - $(GLX_DIR)/glprocs.h \ - $(GLX_DIR)/dispatch.h \ - $(SERVER_GLAPI_FILES) - -API_XML = gl_API.xml \ - EXT_framebuffer_object.xml \ - ARB_copy_buffer.xml \ - ARB_framebuffer_object.xml \ - ARB_map_buffer_range.xml \ - ARB_seamless_cube_map.xml \ - ARB_sync.xml \ - ARB_vertex_array_object.xml \ - APPLE_vertex_array_object.xml \ - EXT_provoking_vertex.xml - -COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py -COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py - -all: check-xorg-source $(OUTPUTS) $(SERVER_OUTPUTS) - -check-xorg-source: - @if ! test -d $(GLX_DIR); then \ - echo "ERROR: Must specify path to xserver checkout; set XORG_BASE."; \ - exit 1; \ - fi - -$(GLX_DIR)/%.c: %.c - cp $< $@ - -$(GLX_DIR)/%.h: %.h - cp $< $@ - -glprocs.h $(GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapitemp.h $(GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapioffsets.h $(GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapitable.h $(GLX_DIR)/glapitable.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -dispatch.h $(GLX_DIR)/dispatch.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ - -../main/enums.c: gl_enums.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../x86/glapi_x86.S: gl_x86_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../x86-64/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - - -../drivers/dri/common/extension_helper.h: extension_helper.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../../glx/x11/indirect.c: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ - -../../glx/x11/indirect.h: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ - -../../glx/x11/indirect_init.c: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ - -../../glx/x11/indirect_size.h $(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) > $@ - -../../glx/x11/indirect_size.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ - | $(INDENT) $(INDENT_FLAGS) > $@ - -$(GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ - -$(GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ - -$(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 > $@ - -$(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) > $@ - -$(GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ - -$(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 > $@ - -$(GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ - -$(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 > $@ - -clean: - -rm -f *~ *.pyo - -rm -f $(OUTPUTS) diff --git a/mesalib/src/mesa/glapi/dispatch.h b/mesalib/src/mesa/glapi/dispatch.h index 0d3204591..6623d5246 100644 --- a/mesalib/src/mesa/glapi/dispatch.h +++ b/mesalib/src/mesa/glapi/dispatch.h @@ -1,5 +1,3 @@ -/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */ - /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. @@ -25,3961 +23,15 @@ * SOFTWARE. */ -#if !defined( _DISPATCH_H_ ) -# define _DISPATCH_H_ +#ifndef _DISPATCH_H +#define _DISPATCH_H +#ifdef IN_DRI_DRIVER +#define _GLAPI_USE_REMAP_TABLE +#endif #include "glapitable.h" -/** - * \file dispatch.h - * Macros for handling GL dispatch tables. - * - * For each known GL function, there are 3 macros in this file. The first - * macro is named CALL_FuncName and is used to call that GL function using - * the specified dispatch table. The other 2 macros, called GET_FuncName - * can SET_FuncName, are used to get and set the dispatch pointer for the - * named function in the specified dispatch table. - */ - -#define CALL_by_offset(disp, cast, offset, parameters) \ - (*(cast (GET_by_offset(disp, offset)))) parameters -#define GET_by_offset(disp, offset) \ - (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL -#define SET_by_offset(disp, offset, fn) \ - do { \ - if ( (offset) < 0 ) { \ - /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\n", */ \ - /* __func__, __LINE__, disp, offset, # fn); */ \ - /* abort(); */ \ - } \ - else { \ - ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \ - } \ - } while(0) - -#define CALL_NewList(disp, parameters) (*((disp)->NewList)) parameters -#define GET_NewList(disp) ((disp)->NewList) -#define SET_NewList(disp, fn) ((disp)->NewList = fn) -#define CALL_EndList(disp, parameters) (*((disp)->EndList)) parameters -#define GET_EndList(disp) ((disp)->EndList) -#define SET_EndList(disp, fn) ((disp)->EndList = fn) -#define CALL_CallList(disp, parameters) (*((disp)->CallList)) parameters -#define GET_CallList(disp) ((disp)->CallList) -#define SET_CallList(disp, fn) ((disp)->CallList = fn) -#define CALL_CallLists(disp, parameters) (*((disp)->CallLists)) parameters -#define GET_CallLists(disp) ((disp)->CallLists) -#define SET_CallLists(disp, fn) ((disp)->CallLists = fn) -#define CALL_DeleteLists(disp, parameters) (*((disp)->DeleteLists)) parameters -#define GET_DeleteLists(disp) ((disp)->DeleteLists) -#define SET_DeleteLists(disp, fn) ((disp)->DeleteLists = fn) -#define CALL_GenLists(disp, parameters) (*((disp)->GenLists)) parameters -#define GET_GenLists(disp) ((disp)->GenLists) -#define SET_GenLists(disp, fn) ((disp)->GenLists = fn) -#define CALL_ListBase(disp, parameters) (*((disp)->ListBase)) parameters -#define GET_ListBase(disp) ((disp)->ListBase) -#define SET_ListBase(disp, fn) ((disp)->ListBase = fn) -#define CALL_Begin(disp, parameters) (*((disp)->Begin)) parameters -#define GET_Begin(disp) ((disp)->Begin) -#define SET_Begin(disp, fn) ((disp)->Begin = fn) -#define CALL_Bitmap(disp, parameters) (*((disp)->Bitmap)) parameters -#define GET_Bitmap(disp) ((disp)->Bitmap) -#define SET_Bitmap(disp, fn) ((disp)->Bitmap = fn) -#define CALL_Color3b(disp, parameters) (*((disp)->Color3b)) parameters -#define GET_Color3b(disp) ((disp)->Color3b) -#define SET_Color3b(disp, fn) ((disp)->Color3b = fn) -#define CALL_Color3bv(disp, parameters) (*((disp)->Color3bv)) parameters -#define GET_Color3bv(disp) ((disp)->Color3bv) -#define SET_Color3bv(disp, fn) ((disp)->Color3bv = fn) -#define CALL_Color3d(disp, parameters) (*((disp)->Color3d)) parameters -#define GET_Color3d(disp) ((disp)->Color3d) -#define SET_Color3d(disp, fn) ((disp)->Color3d = fn) -#define CALL_Color3dv(disp, parameters) (*((disp)->Color3dv)) parameters -#define GET_Color3dv(disp) ((disp)->Color3dv) -#define SET_Color3dv(disp, fn) ((disp)->Color3dv = fn) -#define CALL_Color3f(disp, parameters) (*((disp)->Color3f)) parameters -#define GET_Color3f(disp) ((disp)->Color3f) -#define SET_Color3f(disp, fn) ((disp)->Color3f = fn) -#define CALL_Color3fv(disp, parameters) (*((disp)->Color3fv)) parameters -#define GET_Color3fv(disp) ((disp)->Color3fv) -#define SET_Color3fv(disp, fn) ((disp)->Color3fv = fn) -#define CALL_Color3i(disp, parameters) (*((disp)->Color3i)) parameters -#define GET_Color3i(disp) ((disp)->Color3i) -#define SET_Color3i(disp, fn) ((disp)->Color3i = fn) -#define CALL_Color3iv(disp, parameters) (*((disp)->Color3iv)) parameters -#define GET_Color3iv(disp) ((disp)->Color3iv) -#define SET_Color3iv(disp, fn) ((disp)->Color3iv = fn) -#define CALL_Color3s(disp, parameters) (*((disp)->Color3s)) parameters -#define GET_Color3s(disp) ((disp)->Color3s) -#define SET_Color3s(disp, fn) ((disp)->Color3s = fn) -#define CALL_Color3sv(disp, parameters) (*((disp)->Color3sv)) parameters -#define GET_Color3sv(disp) ((disp)->Color3sv) -#define SET_Color3sv(disp, fn) ((disp)->Color3sv = fn) -#define CALL_Color3ub(disp, parameters) (*((disp)->Color3ub)) parameters -#define GET_Color3ub(disp) ((disp)->Color3ub) -#define SET_Color3ub(disp, fn) ((disp)->Color3ub = fn) -#define CALL_Color3ubv(disp, parameters) (*((disp)->Color3ubv)) parameters -#define GET_Color3ubv(disp) ((disp)->Color3ubv) -#define SET_Color3ubv(disp, fn) ((disp)->Color3ubv = fn) -#define CALL_Color3ui(disp, parameters) (*((disp)->Color3ui)) parameters -#define GET_Color3ui(disp) ((disp)->Color3ui) -#define SET_Color3ui(disp, fn) ((disp)->Color3ui = fn) -#define CALL_Color3uiv(disp, parameters) (*((disp)->Color3uiv)) parameters -#define GET_Color3uiv(disp) ((disp)->Color3uiv) -#define SET_Color3uiv(disp, fn) ((disp)->Color3uiv = fn) -#define CALL_Color3us(disp, parameters) (*((disp)->Color3us)) parameters -#define GET_Color3us(disp) ((disp)->Color3us) -#define SET_Color3us(disp, fn) ((disp)->Color3us = fn) -#define CALL_Color3usv(disp, parameters) (*((disp)->Color3usv)) parameters -#define GET_Color3usv(disp) ((disp)->Color3usv) -#define SET_Color3usv(disp, fn) ((disp)->Color3usv = fn) -#define CALL_Color4b(disp, parameters) (*((disp)->Color4b)) parameters -#define GET_Color4b(disp) ((disp)->Color4b) -#define SET_Color4b(disp, fn) ((disp)->Color4b = fn) -#define CALL_Color4bv(disp, parameters) (*((disp)->Color4bv)) parameters -#define GET_Color4bv(disp) ((disp)->Color4bv) -#define SET_Color4bv(disp, fn) ((disp)->Color4bv = fn) -#define CALL_Color4d(disp, parameters) (*((disp)->Color4d)) parameters -#define GET_Color4d(disp) ((disp)->Color4d) -#define SET_Color4d(disp, fn) ((disp)->Color4d = fn) -#define CALL_Color4dv(disp, parameters) (*((disp)->Color4dv)) parameters -#define GET_Color4dv(disp) ((disp)->Color4dv) -#define SET_Color4dv(disp, fn) ((disp)->Color4dv = fn) -#define CALL_Color4f(disp, parameters) (*((disp)->Color4f)) parameters -#define GET_Color4f(disp) ((disp)->Color4f) -#define SET_Color4f(disp, fn) ((disp)->Color4f = fn) -#define CALL_Color4fv(disp, parameters) (*((disp)->Color4fv)) parameters -#define GET_Color4fv(disp) ((disp)->Color4fv) -#define SET_Color4fv(disp, fn) ((disp)->Color4fv = fn) -#define CALL_Color4i(disp, parameters) (*((disp)->Color4i)) parameters -#define GET_Color4i(disp) ((disp)->Color4i) -#define SET_Color4i(disp, fn) ((disp)->Color4i = fn) -#define CALL_Color4iv(disp, parameters) (*((disp)->Color4iv)) parameters -#define GET_Color4iv(disp) ((disp)->Color4iv) -#define SET_Color4iv(disp, fn) ((disp)->Color4iv = fn) -#define CALL_Color4s(disp, parameters) (*((disp)->Color4s)) parameters -#define GET_Color4s(disp) ((disp)->Color4s) -#define SET_Color4s(disp, fn) ((disp)->Color4s = fn) -#define CALL_Color4sv(disp, parameters) (*((disp)->Color4sv)) parameters -#define GET_Color4sv(disp) ((disp)->Color4sv) -#define SET_Color4sv(disp, fn) ((disp)->Color4sv = fn) -#define CALL_Color4ub(disp, parameters) (*((disp)->Color4ub)) parameters -#define GET_Color4ub(disp) ((disp)->Color4ub) -#define SET_Color4ub(disp, fn) ((disp)->Color4ub = fn) -#define CALL_Color4ubv(disp, parameters) (*((disp)->Color4ubv)) parameters -#define GET_Color4ubv(disp) ((disp)->Color4ubv) -#define SET_Color4ubv(disp, fn) ((disp)->Color4ubv = fn) -#define CALL_Color4ui(disp, parameters) (*((disp)->Color4ui)) parameters -#define GET_Color4ui(disp) ((disp)->Color4ui) -#define SET_Color4ui(disp, fn) ((disp)->Color4ui = fn) -#define CALL_Color4uiv(disp, parameters) (*((disp)->Color4uiv)) parameters -#define GET_Color4uiv(disp) ((disp)->Color4uiv) -#define SET_Color4uiv(disp, fn) ((disp)->Color4uiv = fn) -#define CALL_Color4us(disp, parameters) (*((disp)->Color4us)) parameters -#define GET_Color4us(disp) ((disp)->Color4us) -#define SET_Color4us(disp, fn) ((disp)->Color4us = fn) -#define CALL_Color4usv(disp, parameters) (*((disp)->Color4usv)) parameters -#define GET_Color4usv(disp) ((disp)->Color4usv) -#define SET_Color4usv(disp, fn) ((disp)->Color4usv = fn) -#define CALL_EdgeFlag(disp, parameters) (*((disp)->EdgeFlag)) parameters -#define GET_EdgeFlag(disp) ((disp)->EdgeFlag) -#define SET_EdgeFlag(disp, fn) ((disp)->EdgeFlag = fn) -#define CALL_EdgeFlagv(disp, parameters) (*((disp)->EdgeFlagv)) parameters -#define GET_EdgeFlagv(disp) ((disp)->EdgeFlagv) -#define SET_EdgeFlagv(disp, fn) ((disp)->EdgeFlagv = fn) -#define CALL_End(disp, parameters) (*((disp)->End)) parameters -#define GET_End(disp) ((disp)->End) -#define SET_End(disp, fn) ((disp)->End = fn) -#define CALL_Indexd(disp, parameters) (*((disp)->Indexd)) parameters -#define GET_Indexd(disp) ((disp)->Indexd) -#define SET_Indexd(disp, fn) ((disp)->Indexd = fn) -#define CALL_Indexdv(disp, parameters) (*((disp)->Indexdv)) parameters -#define GET_Indexdv(disp) ((disp)->Indexdv) -#define SET_Indexdv(disp, fn) ((disp)->Indexdv = fn) -#define CALL_Indexf(disp, parameters) (*((disp)->Indexf)) parameters -#define GET_Indexf(disp) ((disp)->Indexf) -#define SET_Indexf(disp, fn) ((disp)->Indexf = fn) -#define CALL_Indexfv(disp, parameters) (*((disp)->Indexfv)) parameters -#define GET_Indexfv(disp) ((disp)->Indexfv) -#define SET_Indexfv(disp, fn) ((disp)->Indexfv = fn) -#define CALL_Indexi(disp, parameters) (*((disp)->Indexi)) parameters -#define GET_Indexi(disp) ((disp)->Indexi) -#define SET_Indexi(disp, fn) ((disp)->Indexi = fn) -#define CALL_Indexiv(disp, parameters) (*((disp)->Indexiv)) parameters -#define GET_Indexiv(disp) ((disp)->Indexiv) -#define SET_Indexiv(disp, fn) ((disp)->Indexiv = fn) -#define CALL_Indexs(disp, parameters) (*((disp)->Indexs)) parameters -#define GET_Indexs(disp) ((disp)->Indexs) -#define SET_Indexs(disp, fn) ((disp)->Indexs = fn) -#define CALL_Indexsv(disp, parameters) (*((disp)->Indexsv)) parameters -#define GET_Indexsv(disp) ((disp)->Indexsv) -#define SET_Indexsv(disp, fn) ((disp)->Indexsv = fn) -#define CALL_Normal3b(disp, parameters) (*((disp)->Normal3b)) parameters -#define GET_Normal3b(disp) ((disp)->Normal3b) -#define SET_Normal3b(disp, fn) ((disp)->Normal3b = fn) -#define CALL_Normal3bv(disp, parameters) (*((disp)->Normal3bv)) parameters -#define GET_Normal3bv(disp) ((disp)->Normal3bv) -#define SET_Normal3bv(disp, fn) ((disp)->Normal3bv = fn) -#define CALL_Normal3d(disp, parameters) (*((disp)->Normal3d)) parameters -#define GET_Normal3d(disp) ((disp)->Normal3d) -#define SET_Normal3d(disp, fn) ((disp)->Normal3d = fn) -#define CALL_Normal3dv(disp, parameters) (*((disp)->Normal3dv)) parameters -#define GET_Normal3dv(disp) ((disp)->Normal3dv) -#define SET_Normal3dv(disp, fn) ((disp)->Normal3dv = fn) -#define CALL_Normal3f(disp, parameters) (*((disp)->Normal3f)) parameters -#define GET_Normal3f(disp) ((disp)->Normal3f) -#define SET_Normal3f(disp, fn) ((disp)->Normal3f = fn) -#define CALL_Normal3fv(disp, parameters) (*((disp)->Normal3fv)) parameters -#define GET_Normal3fv(disp) ((disp)->Normal3fv) -#define SET_Normal3fv(disp, fn) ((disp)->Normal3fv = fn) -#define CALL_Normal3i(disp, parameters) (*((disp)->Normal3i)) parameters -#define GET_Normal3i(disp) ((disp)->Normal3i) -#define SET_Normal3i(disp, fn) ((disp)->Normal3i = fn) -#define CALL_Normal3iv(disp, parameters) (*((disp)->Normal3iv)) parameters -#define GET_Normal3iv(disp) ((disp)->Normal3iv) -#define SET_Normal3iv(disp, fn) ((disp)->Normal3iv = fn) -#define CALL_Normal3s(disp, parameters) (*((disp)->Normal3s)) parameters -#define GET_Normal3s(disp) ((disp)->Normal3s) -#define SET_Normal3s(disp, fn) ((disp)->Normal3s = fn) -#define CALL_Normal3sv(disp, parameters) (*((disp)->Normal3sv)) parameters -#define GET_Normal3sv(disp) ((disp)->Normal3sv) -#define SET_Normal3sv(disp, fn) ((disp)->Normal3sv = fn) -#define CALL_RasterPos2d(disp, parameters) (*((disp)->RasterPos2d)) parameters -#define GET_RasterPos2d(disp) ((disp)->RasterPos2d) -#define SET_RasterPos2d(disp, fn) ((disp)->RasterPos2d = fn) -#define CALL_RasterPos2dv(disp, parameters) (*((disp)->RasterPos2dv)) parameters -#define GET_RasterPos2dv(disp) ((disp)->RasterPos2dv) -#define SET_RasterPos2dv(disp, fn) ((disp)->RasterPos2dv = fn) -#define CALL_RasterPos2f(disp, parameters) (*((disp)->RasterPos2f)) parameters -#define GET_RasterPos2f(disp) ((disp)->RasterPos2f) -#define SET_RasterPos2f(disp, fn) ((disp)->RasterPos2f = fn) -#define CALL_RasterPos2fv(disp, parameters) (*((disp)->RasterPos2fv)) parameters -#define GET_RasterPos2fv(disp) ((disp)->RasterPos2fv) -#define SET_RasterPos2fv(disp, fn) ((disp)->RasterPos2fv = fn) -#define CALL_RasterPos2i(disp, parameters) (*((disp)->RasterPos2i)) parameters -#define GET_RasterPos2i(disp) ((disp)->RasterPos2i) -#define SET_RasterPos2i(disp, fn) ((disp)->RasterPos2i = fn) -#define CALL_RasterPos2iv(disp, parameters) (*((disp)->RasterPos2iv)) parameters -#define GET_RasterPos2iv(disp) ((disp)->RasterPos2iv) -#define SET_RasterPos2iv(disp, fn) ((disp)->RasterPos2iv = fn) -#define CALL_RasterPos2s(disp, parameters) (*((disp)->RasterPos2s)) parameters -#define GET_RasterPos2s(disp) ((disp)->RasterPos2s) -#define SET_RasterPos2s(disp, fn) ((disp)->RasterPos2s = fn) -#define CALL_RasterPos2sv(disp, parameters) (*((disp)->RasterPos2sv)) parameters -#define GET_RasterPos2sv(disp) ((disp)->RasterPos2sv) -#define SET_RasterPos2sv(disp, fn) ((disp)->RasterPos2sv = fn) -#define CALL_RasterPos3d(disp, parameters) (*((disp)->RasterPos3d)) parameters -#define GET_RasterPos3d(disp) ((disp)->RasterPos3d) -#define SET_RasterPos3d(disp, fn) ((disp)->RasterPos3d = fn) -#define CALL_RasterPos3dv(disp, parameters) (*((disp)->RasterPos3dv)) parameters -#define GET_RasterPos3dv(disp) ((disp)->RasterPos3dv) -#define SET_RasterPos3dv(disp, fn) ((disp)->RasterPos3dv = fn) -#define CALL_RasterPos3f(disp, parameters) (*((disp)->RasterPos3f)) parameters -#define GET_RasterPos3f(disp) ((disp)->RasterPos3f) -#define SET_RasterPos3f(disp, fn) ((disp)->RasterPos3f = fn) -#define CALL_RasterPos3fv(disp, parameters) (*((disp)->RasterPos3fv)) parameters -#define GET_RasterPos3fv(disp) ((disp)->RasterPos3fv) -#define SET_RasterPos3fv(disp, fn) ((disp)->RasterPos3fv = fn) -#define CALL_RasterPos3i(disp, parameters) (*((disp)->RasterPos3i)) parameters -#define GET_RasterPos3i(disp) ((disp)->RasterPos3i) -#define SET_RasterPos3i(disp, fn) ((disp)->RasterPos3i = fn) -#define CALL_RasterPos3iv(disp, parameters) (*((disp)->RasterPos3iv)) parameters -#define GET_RasterPos3iv(disp) ((disp)->RasterPos3iv) -#define SET_RasterPos3iv(disp, fn) ((disp)->RasterPos3iv = fn) -#define CALL_RasterPos3s(disp, parameters) (*((disp)->RasterPos3s)) parameters -#define GET_RasterPos3s(disp) ((disp)->RasterPos3s) -#define SET_RasterPos3s(disp, fn) ((disp)->RasterPos3s = fn) -#define CALL_RasterPos3sv(disp, parameters) (*((disp)->RasterPos3sv)) parameters -#define GET_RasterPos3sv(disp) ((disp)->RasterPos3sv) -#define SET_RasterPos3sv(disp, fn) ((disp)->RasterPos3sv = fn) -#define CALL_RasterPos4d(disp, parameters) (*((disp)->RasterPos4d)) parameters -#define GET_RasterPos4d(disp) ((disp)->RasterPos4d) -#define SET_RasterPos4d(disp, fn) ((disp)->RasterPos4d = fn) -#define CALL_RasterPos4dv(disp, parameters) (*((disp)->RasterPos4dv)) parameters -#define GET_RasterPos4dv(disp) ((disp)->RasterPos4dv) -#define SET_RasterPos4dv(disp, fn) ((disp)->RasterPos4dv = fn) -#define CALL_RasterPos4f(disp, parameters) (*((disp)->RasterPos4f)) parameters -#define GET_RasterPos4f(disp) ((disp)->RasterPos4f) -#define SET_RasterPos4f(disp, fn) ((disp)->RasterPos4f = fn) -#define CALL_RasterPos4fv(disp, parameters) (*((disp)->RasterPos4fv)) parameters -#define GET_RasterPos4fv(disp) ((disp)->RasterPos4fv) -#define SET_RasterPos4fv(disp, fn) ((disp)->RasterPos4fv = fn) -#define CALL_RasterPos4i(disp, parameters) (*((disp)->RasterPos4i)) parameters -#define GET_RasterPos4i(disp) ((disp)->RasterPos4i) -#define SET_RasterPos4i(disp, fn) ((disp)->RasterPos4i = fn) -#define CALL_RasterPos4iv(disp, parameters) (*((disp)->RasterPos4iv)) parameters -#define GET_RasterPos4iv(disp) ((disp)->RasterPos4iv) -#define SET_RasterPos4iv(disp, fn) ((disp)->RasterPos4iv = fn) -#define CALL_RasterPos4s(disp, parameters) (*((disp)->RasterPos4s)) parameters -#define GET_RasterPos4s(disp) ((disp)->RasterPos4s) -#define SET_RasterPos4s(disp, fn) ((disp)->RasterPos4s = fn) -#define CALL_RasterPos4sv(disp, parameters) (*((disp)->RasterPos4sv)) parameters -#define GET_RasterPos4sv(disp) ((disp)->RasterPos4sv) -#define SET_RasterPos4sv(disp, fn) ((disp)->RasterPos4sv = fn) -#define CALL_Rectd(disp, parameters) (*((disp)->Rectd)) parameters -#define GET_Rectd(disp) ((disp)->Rectd) -#define SET_Rectd(disp, fn) ((disp)->Rectd = fn) -#define CALL_Rectdv(disp, parameters) (*((disp)->Rectdv)) parameters -#define GET_Rectdv(disp) ((disp)->Rectdv) -#define SET_Rectdv(disp, fn) ((disp)->Rectdv = fn) -#define CALL_Rectf(disp, parameters) (*((disp)->Rectf)) parameters -#define GET_Rectf(disp) ((disp)->Rectf) -#define SET_Rectf(disp, fn) ((disp)->Rectf = fn) -#define CALL_Rectfv(disp, parameters) (*((disp)->Rectfv)) parameters -#define GET_Rectfv(disp) ((disp)->Rectfv) -#define SET_Rectfv(disp, fn) ((disp)->Rectfv = fn) -#define CALL_Recti(disp, parameters) (*((disp)->Recti)) parameters -#define GET_Recti(disp) ((disp)->Recti) -#define SET_Recti(disp, fn) ((disp)->Recti = fn) -#define CALL_Rectiv(disp, parameters) (*((disp)->Rectiv)) parameters -#define GET_Rectiv(disp) ((disp)->Rectiv) -#define SET_Rectiv(disp, fn) ((disp)->Rectiv = fn) -#define CALL_Rects(disp, parameters) (*((disp)->Rects)) parameters -#define GET_Rects(disp) ((disp)->Rects) -#define SET_Rects(disp, fn) ((disp)->Rects = fn) -#define CALL_Rectsv(disp, parameters) (*((disp)->Rectsv)) parameters -#define GET_Rectsv(disp) ((disp)->Rectsv) -#define SET_Rectsv(disp, fn) ((disp)->Rectsv = fn) -#define CALL_TexCoord1d(disp, parameters) (*((disp)->TexCoord1d)) parameters -#define GET_TexCoord1d(disp) ((disp)->TexCoord1d) -#define SET_TexCoord1d(disp, fn) ((disp)->TexCoord1d = fn) -#define CALL_TexCoord1dv(disp, parameters) (*((disp)->TexCoord1dv)) parameters -#define GET_TexCoord1dv(disp) ((disp)->TexCoord1dv) -#define SET_TexCoord1dv(disp, fn) ((disp)->TexCoord1dv = fn) -#define CALL_TexCoord1f(disp, parameters) (*((disp)->TexCoord1f)) parameters -#define GET_TexCoord1f(disp) ((disp)->TexCoord1f) -#define SET_TexCoord1f(disp, fn) ((disp)->TexCoord1f = fn) -#define CALL_TexCoord1fv(disp, parameters) (*((disp)->TexCoord1fv)) parameters -#define GET_TexCoord1fv(disp) ((disp)->TexCoord1fv) -#define SET_TexCoord1fv(disp, fn) ((disp)->TexCoord1fv = fn) -#define CALL_TexCoord1i(disp, parameters) (*((disp)->TexCoord1i)) parameters -#define GET_TexCoord1i(disp) ((disp)->TexCoord1i) -#define SET_TexCoord1i(disp, fn) ((disp)->TexCoord1i = fn) -#define CALL_TexCoord1iv(disp, parameters) (*((disp)->TexCoord1iv)) parameters -#define GET_TexCoord1iv(disp) ((disp)->TexCoord1iv) -#define SET_TexCoord1iv(disp, fn) ((disp)->TexCoord1iv = fn) -#define CALL_TexCoord1s(disp, parameters) (*((disp)->TexCoord1s)) parameters -#define GET_TexCoord1s(disp) ((disp)->TexCoord1s) -#define SET_TexCoord1s(disp, fn) ((disp)->TexCoord1s = fn) -#define CALL_TexCoord1sv(disp, parameters) (*((disp)->TexCoord1sv)) parameters -#define GET_TexCoord1sv(disp) ((disp)->TexCoord1sv) -#define SET_TexCoord1sv(disp, fn) ((disp)->TexCoord1sv = fn) -#define CALL_TexCoord2d(disp, parameters) (*((disp)->TexCoord2d)) parameters -#define GET_TexCoord2d(disp) ((disp)->TexCoord2d) -#define SET_TexCoord2d(disp, fn) ((disp)->TexCoord2d = fn) -#define CALL_TexCoord2dv(disp, parameters) (*((disp)->TexCoord2dv)) parameters -#define GET_TexCoord2dv(disp) ((disp)->TexCoord2dv) -#define SET_TexCoord2dv(disp, fn) ((disp)->TexCoord2dv = fn) -#define CALL_TexCoord2f(disp, parameters) (*((disp)->TexCoord2f)) parameters -#define GET_TexCoord2f(disp) ((disp)->TexCoord2f) -#define SET_TexCoord2f(disp, fn) ((disp)->TexCoord2f = fn) -#define CALL_TexCoord2fv(disp, parameters) (*((disp)->TexCoord2fv)) parameters -#define GET_TexCoord2fv(disp) ((disp)->TexCoord2fv) -#define SET_TexCoord2fv(disp, fn) ((disp)->TexCoord2fv = fn) -#define CALL_TexCoord2i(disp, parameters) (*((disp)->TexCoord2i)) parameters -#define GET_TexCoord2i(disp) ((disp)->TexCoord2i) -#define SET_TexCoord2i(disp, fn) ((disp)->TexCoord2i = fn) -#define CALL_TexCoord2iv(disp, parameters) (*((disp)->TexCoord2iv)) parameters -#define GET_TexCoord2iv(disp) ((disp)->TexCoord2iv) -#define SET_TexCoord2iv(disp, fn) ((disp)->TexCoord2iv = fn) -#define CALL_TexCoord2s(disp, parameters) (*((disp)->TexCoord2s)) parameters -#define GET_TexCoord2s(disp) ((disp)->TexCoord2s) -#define SET_TexCoord2s(disp, fn) ((disp)->TexCoord2s = fn) -#define CALL_TexCoord2sv(disp, parameters) (*((disp)->TexCoord2sv)) parameters -#define GET_TexCoord2sv(disp) ((disp)->TexCoord2sv) -#define SET_TexCoord2sv(disp, fn) ((disp)->TexCoord2sv = fn) -#define CALL_TexCoord3d(disp, parameters) (*((disp)->TexCoord3d)) parameters -#define GET_TexCoord3d(disp) ((disp)->TexCoord3d) -#define SET_TexCoord3d(disp, fn) ((disp)->TexCoord3d = fn) -#define CALL_TexCoord3dv(disp, parameters) (*((disp)->TexCoord3dv)) parameters -#define GET_TexCoord3dv(disp) ((disp)->TexCoord3dv) -#define SET_TexCoord3dv(disp, fn) ((disp)->TexCoord3dv = fn) -#define CALL_TexCoord3f(disp, parameters) (*((disp)->TexCoord3f)) parameters -#define GET_TexCoord3f(disp) ((disp)->TexCoord3f) -#define SET_TexCoord3f(disp, fn) ((disp)->TexCoord3f = fn) -#define CALL_TexCoord3fv(disp, parameters) (*((disp)->TexCoord3fv)) parameters -#define GET_TexCoord3fv(disp) ((disp)->TexCoord3fv) -#define SET_TexCoord3fv(disp, fn) ((disp)->TexCoord3fv = fn) -#define CALL_TexCoord3i(disp, parameters) (*((disp)->TexCoord3i)) parameters -#define GET_TexCoord3i(disp) ((disp)->TexCoord3i) -#define SET_TexCoord3i(disp, fn) ((disp)->TexCoord3i = fn) -#define CALL_TexCoord3iv(disp, parameters) (*((disp)->TexCoord3iv)) parameters -#define GET_TexCoord3iv(disp) ((disp)->TexCoord3iv) -#define SET_TexCoord3iv(disp, fn) ((disp)->TexCoord3iv = fn) -#define CALL_TexCoord3s(disp, parameters) (*((disp)->TexCoord3s)) parameters -#define GET_TexCoord3s(disp) ((disp)->TexCoord3s) -#define SET_TexCoord3s(disp, fn) ((disp)->TexCoord3s = fn) -#define CALL_TexCoord3sv(disp, parameters) (*((disp)->TexCoord3sv)) parameters -#define GET_TexCoord3sv(disp) ((disp)->TexCoord3sv) -#define SET_TexCoord3sv(disp, fn) ((disp)->TexCoord3sv = fn) -#define CALL_TexCoord4d(disp, parameters) (*((disp)->TexCoord4d)) parameters -#define GET_TexCoord4d(disp) ((disp)->TexCoord4d) -#define SET_TexCoord4d(disp, fn) ((disp)->TexCoord4d = fn) -#define CALL_TexCoord4dv(disp, parameters) (*((disp)->TexCoord4dv)) parameters -#define GET_TexCoord4dv(disp) ((disp)->TexCoord4dv) -#define SET_TexCoord4dv(disp, fn) ((disp)->TexCoord4dv = fn) -#define CALL_TexCoord4f(disp, parameters) (*((disp)->TexCoord4f)) parameters -#define GET_TexCoord4f(disp) ((disp)->TexCoord4f) -#define SET_TexCoord4f(disp, fn) ((disp)->TexCoord4f = fn) -#define CALL_TexCoord4fv(disp, parameters) (*((disp)->TexCoord4fv)) parameters -#define GET_TexCoord4fv(disp) ((disp)->TexCoord4fv) -#define SET_TexCoord4fv(disp, fn) ((disp)->TexCoord4fv = fn) -#define CALL_TexCoord4i(disp, parameters) (*((disp)->TexCoord4i)) parameters -#define GET_TexCoord4i(disp) ((disp)->TexCoord4i) -#define SET_TexCoord4i(disp, fn) ((disp)->TexCoord4i = fn) -#define CALL_TexCoord4iv(disp, parameters) (*((disp)->TexCoord4iv)) parameters -#define GET_TexCoord4iv(disp) ((disp)->TexCoord4iv) -#define SET_TexCoord4iv(disp, fn) ((disp)->TexCoord4iv = fn) -#define CALL_TexCoord4s(disp, parameters) (*((disp)->TexCoord4s)) parameters -#define GET_TexCoord4s(disp) ((disp)->TexCoord4s) -#define SET_TexCoord4s(disp, fn) ((disp)->TexCoord4s = fn) -#define CALL_TexCoord4sv(disp, parameters) (*((disp)->TexCoord4sv)) parameters -#define GET_TexCoord4sv(disp) ((disp)->TexCoord4sv) -#define SET_TexCoord4sv(disp, fn) ((disp)->TexCoord4sv = fn) -#define CALL_Vertex2d(disp, parameters) (*((disp)->Vertex2d)) parameters -#define GET_Vertex2d(disp) ((disp)->Vertex2d) -#define SET_Vertex2d(disp, fn) ((disp)->Vertex2d = fn) -#define CALL_Vertex2dv(disp, parameters) (*((disp)->Vertex2dv)) parameters -#define GET_Vertex2dv(disp) ((disp)->Vertex2dv) -#define SET_Vertex2dv(disp, fn) ((disp)->Vertex2dv = fn) -#define CALL_Vertex2f(disp, parameters) (*((disp)->Vertex2f)) parameters -#define GET_Vertex2f(disp) ((disp)->Vertex2f) -#define SET_Vertex2f(disp, fn) ((disp)->Vertex2f = fn) -#define CALL_Vertex2fv(disp, parameters) (*((disp)->Vertex2fv)) parameters -#define GET_Vertex2fv(disp) ((disp)->Vertex2fv) -#define SET_Vertex2fv(disp, fn) ((disp)->Vertex2fv = fn) -#define CALL_Vertex2i(disp, parameters) (*((disp)->Vertex2i)) parameters -#define GET_Vertex2i(disp) ((disp)->Vertex2i) -#define SET_Vertex2i(disp, fn) ((disp)->Vertex2i = fn) -#define CALL_Vertex2iv(disp, parameters) (*((disp)->Vertex2iv)) parameters -#define GET_Vertex2iv(disp) ((disp)->Vertex2iv) -#define SET_Vertex2iv(disp, fn) ((disp)->Vertex2iv = fn) -#define CALL_Vertex2s(disp, parameters) (*((disp)->Vertex2s)) parameters -#define GET_Vertex2s(disp) ((disp)->Vertex2s) -#define SET_Vertex2s(disp, fn) ((disp)->Vertex2s = fn) -#define CALL_Vertex2sv(disp, parameters) (*((disp)->Vertex2sv)) parameters -#define GET_Vertex2sv(disp) ((disp)->Vertex2sv) -#define SET_Vertex2sv(disp, fn) ((disp)->Vertex2sv = fn) -#define CALL_Vertex3d(disp, parameters) (*((disp)->Vertex3d)) parameters -#define GET_Vertex3d(disp) ((disp)->Vertex3d) -#define SET_Vertex3d(disp, fn) ((disp)->Vertex3d = fn) -#define CALL_Vertex3dv(disp, parameters) (*((disp)->Vertex3dv)) parameters -#define GET_Vertex3dv(disp) ((disp)->Vertex3dv) -#define SET_Vertex3dv(disp, fn) ((disp)->Vertex3dv = fn) -#define CALL_Vertex3f(disp, parameters) (*((disp)->Vertex3f)) parameters -#define GET_Vertex3f(disp) ((disp)->Vertex3f) -#define SET_Vertex3f(disp, fn) ((disp)->Vertex3f = fn) -#define CALL_Vertex3fv(disp, parameters) (*((disp)->Vertex3fv)) parameters -#define GET_Vertex3fv(disp) ((disp)->Vertex3fv) -#define SET_Vertex3fv(disp, fn) ((disp)->Vertex3fv = fn) -#define CALL_Vertex3i(disp, parameters) (*((disp)->Vertex3i)) parameters -#define GET_Vertex3i(disp) ((disp)->Vertex3i) -#define SET_Vertex3i(disp, fn) ((disp)->Vertex3i = fn) -#define CALL_Vertex3iv(disp, parameters) (*((disp)->Vertex3iv)) parameters -#define GET_Vertex3iv(disp) ((disp)->Vertex3iv) -#define SET_Vertex3iv(disp, fn) ((disp)->Vertex3iv = fn) -#define CALL_Vertex3s(disp, parameters) (*((disp)->Vertex3s)) parameters -#define GET_Vertex3s(disp) ((disp)->Vertex3s) -#define SET_Vertex3s(disp, fn) ((disp)->Vertex3s = fn) -#define CALL_Vertex3sv(disp, parameters) (*((disp)->Vertex3sv)) parameters -#define GET_Vertex3sv(disp) ((disp)->Vertex3sv) -#define SET_Vertex3sv(disp, fn) ((disp)->Vertex3sv = fn) -#define CALL_Vertex4d(disp, parameters) (*((disp)->Vertex4d)) parameters -#define GET_Vertex4d(disp) ((disp)->Vertex4d) -#define SET_Vertex4d(disp, fn) ((disp)->Vertex4d = fn) -#define CALL_Vertex4dv(disp, parameters) (*((disp)->Vertex4dv)) parameters -#define GET_Vertex4dv(disp) ((disp)->Vertex4dv) -#define SET_Vertex4dv(disp, fn) ((disp)->Vertex4dv = fn) -#define CALL_Vertex4f(disp, parameters) (*((disp)->Vertex4f)) parameters -#define GET_Vertex4f(disp) ((disp)->Vertex4f) -#define SET_Vertex4f(disp, fn) ((disp)->Vertex4f = fn) -#define CALL_Vertex4fv(disp, parameters) (*((disp)->Vertex4fv)) parameters -#define GET_Vertex4fv(disp) ((disp)->Vertex4fv) -#define SET_Vertex4fv(disp, fn) ((disp)->Vertex4fv = fn) -#define CALL_Vertex4i(disp, parameters) (*((disp)->Vertex4i)) parameters -#define GET_Vertex4i(disp) ((disp)->Vertex4i) -#define SET_Vertex4i(disp, fn) ((disp)->Vertex4i = fn) -#define CALL_Vertex4iv(disp, parameters) (*((disp)->Vertex4iv)) parameters -#define GET_Vertex4iv(disp) ((disp)->Vertex4iv) -#define SET_Vertex4iv(disp, fn) ((disp)->Vertex4iv = fn) -#define CALL_Vertex4s(disp, parameters) (*((disp)->Vertex4s)) parameters -#define GET_Vertex4s(disp) ((disp)->Vertex4s) -#define SET_Vertex4s(disp, fn) ((disp)->Vertex4s = fn) -#define CALL_Vertex4sv(disp, parameters) (*((disp)->Vertex4sv)) parameters -#define GET_Vertex4sv(disp) ((disp)->Vertex4sv) -#define SET_Vertex4sv(disp, fn) ((disp)->Vertex4sv = fn) -#define CALL_ClipPlane(disp, parameters) (*((disp)->ClipPlane)) parameters -#define GET_ClipPlane(disp) ((disp)->ClipPlane) -#define SET_ClipPlane(disp, fn) ((disp)->ClipPlane = fn) -#define CALL_ColorMaterial(disp, parameters) (*((disp)->ColorMaterial)) parameters -#define GET_ColorMaterial(disp) ((disp)->ColorMaterial) -#define SET_ColorMaterial(disp, fn) ((disp)->ColorMaterial = fn) -#define CALL_CullFace(disp, parameters) (*((disp)->CullFace)) parameters -#define GET_CullFace(disp) ((disp)->CullFace) -#define SET_CullFace(disp, fn) ((disp)->CullFace = fn) -#define CALL_Fogf(disp, parameters) (*((disp)->Fogf)) parameters -#define GET_Fogf(disp) ((disp)->Fogf) -#define SET_Fogf(disp, fn) ((disp)->Fogf = fn) -#define CALL_Fogfv(disp, parameters) (*((disp)->Fogfv)) parameters -#define GET_Fogfv(disp) ((disp)->Fogfv) -#define SET_Fogfv(disp, fn) ((disp)->Fogfv = fn) -#define CALL_Fogi(disp, parameters) (*((disp)->Fogi)) parameters -#define GET_Fogi(disp) ((disp)->Fogi) -#define SET_Fogi(disp, fn) ((disp)->Fogi = fn) -#define CALL_Fogiv(disp, parameters) (*((disp)->Fogiv)) parameters -#define GET_Fogiv(disp) ((disp)->Fogiv) -#define SET_Fogiv(disp, fn) ((disp)->Fogiv = fn) -#define CALL_FrontFace(disp, parameters) (*((disp)->FrontFace)) parameters -#define GET_FrontFace(disp) ((disp)->FrontFace) -#define SET_FrontFace(disp, fn) ((disp)->FrontFace = fn) -#define CALL_Hint(disp, parameters) (*((disp)->Hint)) parameters -#define GET_Hint(disp) ((disp)->Hint) -#define SET_Hint(disp, fn) ((disp)->Hint = fn) -#define CALL_Lightf(disp, parameters) (*((disp)->Lightf)) parameters -#define GET_Lightf(disp) ((disp)->Lightf) -#define SET_Lightf(disp, fn) ((disp)->Lightf = fn) -#define CALL_Lightfv(disp, parameters) (*((disp)->Lightfv)) parameters -#define GET_Lightfv(disp) ((disp)->Lightfv) -#define SET_Lightfv(disp, fn) ((disp)->Lightfv = fn) -#define CALL_Lighti(disp, parameters) (*((disp)->Lighti)) parameters -#define GET_Lighti(disp) ((disp)->Lighti) -#define SET_Lighti(disp, fn) ((disp)->Lighti = fn) -#define CALL_Lightiv(disp, parameters) (*((disp)->Lightiv)) parameters -#define GET_Lightiv(disp) ((disp)->Lightiv) -#define SET_Lightiv(disp, fn) ((disp)->Lightiv = fn) -#define CALL_LightModelf(disp, parameters) (*((disp)->LightModelf)) parameters -#define GET_LightModelf(disp) ((disp)->LightModelf) -#define SET_LightModelf(disp, fn) ((disp)->LightModelf = fn) -#define CALL_LightModelfv(disp, parameters) (*((disp)->LightModelfv)) parameters -#define GET_LightModelfv(disp) ((disp)->LightModelfv) -#define SET_LightModelfv(disp, fn) ((disp)->LightModelfv = fn) -#define CALL_LightModeli(disp, parameters) (*((disp)->LightModeli)) parameters -#define GET_LightModeli(disp) ((disp)->LightModeli) -#define SET_LightModeli(disp, fn) ((disp)->LightModeli = fn) -#define CALL_LightModeliv(disp, parameters) (*((disp)->LightModeliv)) parameters -#define GET_LightModeliv(disp) ((disp)->LightModeliv) -#define SET_LightModeliv(disp, fn) ((disp)->LightModeliv = fn) -#define CALL_LineStipple(disp, parameters) (*((disp)->LineStipple)) parameters -#define GET_LineStipple(disp) ((disp)->LineStipple) -#define SET_LineStipple(disp, fn) ((disp)->LineStipple = fn) -#define CALL_LineWidth(disp, parameters) (*((disp)->LineWidth)) parameters -#define GET_LineWidth(disp) ((disp)->LineWidth) -#define SET_LineWidth(disp, fn) ((disp)->LineWidth = fn) -#define CALL_Materialf(disp, parameters) (*((disp)->Materialf)) parameters -#define GET_Materialf(disp) ((disp)->Materialf) -#define SET_Materialf(disp, fn) ((disp)->Materialf = fn) -#define CALL_Materialfv(disp, parameters) (*((disp)->Materialfv)) parameters -#define GET_Materialfv(disp) ((disp)->Materialfv) -#define SET_Materialfv(disp, fn) ((disp)->Materialfv = fn) -#define CALL_Materiali(disp, parameters) (*((disp)->Materiali)) parameters -#define GET_Materiali(disp) ((disp)->Materiali) -#define SET_Materiali(disp, fn) ((disp)->Materiali = fn) -#define CALL_Materialiv(disp, parameters) (*((disp)->Materialiv)) parameters -#define GET_Materialiv(disp) ((disp)->Materialiv) -#define SET_Materialiv(disp, fn) ((disp)->Materialiv = fn) -#define CALL_PointSize(disp, parameters) (*((disp)->PointSize)) parameters -#define GET_PointSize(disp) ((disp)->PointSize) -#define SET_PointSize(disp, fn) ((disp)->PointSize = fn) -#define CALL_PolygonMode(disp, parameters) (*((disp)->PolygonMode)) parameters -#define GET_PolygonMode(disp) ((disp)->PolygonMode) -#define SET_PolygonMode(disp, fn) ((disp)->PolygonMode = fn) -#define CALL_PolygonStipple(disp, parameters) (*((disp)->PolygonStipple)) parameters -#define GET_PolygonStipple(disp) ((disp)->PolygonStipple) -#define SET_PolygonStipple(disp, fn) ((disp)->PolygonStipple = fn) -#define CALL_Scissor(disp, parameters) (*((disp)->Scissor)) parameters -#define GET_Scissor(disp) ((disp)->Scissor) -#define SET_Scissor(disp, fn) ((disp)->Scissor = fn) -#define CALL_ShadeModel(disp, parameters) (*((disp)->ShadeModel)) parameters -#define GET_ShadeModel(disp) ((disp)->ShadeModel) -#define SET_ShadeModel(disp, fn) ((disp)->ShadeModel = fn) -#define CALL_TexParameterf(disp, parameters) (*((disp)->TexParameterf)) parameters -#define GET_TexParameterf(disp) ((disp)->TexParameterf) -#define SET_TexParameterf(disp, fn) ((disp)->TexParameterf = fn) -#define CALL_TexParameterfv(disp, parameters) (*((disp)->TexParameterfv)) parameters -#define GET_TexParameterfv(disp) ((disp)->TexParameterfv) -#define SET_TexParameterfv(disp, fn) ((disp)->TexParameterfv = fn) -#define CALL_TexParameteri(disp, parameters) (*((disp)->TexParameteri)) parameters -#define GET_TexParameteri(disp) ((disp)->TexParameteri) -#define SET_TexParameteri(disp, fn) ((disp)->TexParameteri = fn) -#define CALL_TexParameteriv(disp, parameters) (*((disp)->TexParameteriv)) parameters -#define GET_TexParameteriv(disp) ((disp)->TexParameteriv) -#define SET_TexParameteriv(disp, fn) ((disp)->TexParameteriv = fn) -#define CALL_TexImage1D(disp, parameters) (*((disp)->TexImage1D)) parameters -#define GET_TexImage1D(disp) ((disp)->TexImage1D) -#define SET_TexImage1D(disp, fn) ((disp)->TexImage1D = fn) -#define CALL_TexImage2D(disp, parameters) (*((disp)->TexImage2D)) parameters -#define GET_TexImage2D(disp) ((disp)->TexImage2D) -#define SET_TexImage2D(disp, fn) ((disp)->TexImage2D = fn) -#define CALL_TexEnvf(disp, parameters) (*((disp)->TexEnvf)) parameters -#define GET_TexEnvf(disp) ((disp)->TexEnvf) -#define SET_TexEnvf(disp, fn) ((disp)->TexEnvf = fn) -#define CALL_TexEnvfv(disp, parameters) (*((disp)->TexEnvfv)) parameters -#define GET_TexEnvfv(disp) ((disp)->TexEnvfv) -#define SET_TexEnvfv(disp, fn) ((disp)->TexEnvfv = fn) -#define CALL_TexEnvi(disp, parameters) (*((disp)->TexEnvi)) parameters -#define GET_TexEnvi(disp) ((disp)->TexEnvi) -#define SET_TexEnvi(disp, fn) ((disp)->TexEnvi = fn) -#define CALL_TexEnviv(disp, parameters) (*((disp)->TexEnviv)) parameters -#define GET_TexEnviv(disp) ((disp)->TexEnviv) -#define SET_TexEnviv(disp, fn) ((disp)->TexEnviv = fn) -#define CALL_TexGend(disp, parameters) (*((disp)->TexGend)) parameters -#define GET_TexGend(disp) ((disp)->TexGend) -#define SET_TexGend(disp, fn) ((disp)->TexGend = fn) -#define CALL_TexGendv(disp, parameters) (*((disp)->TexGendv)) parameters -#define GET_TexGendv(disp) ((disp)->TexGendv) -#define SET_TexGendv(disp, fn) ((disp)->TexGendv = fn) -#define CALL_TexGenf(disp, parameters) (*((disp)->TexGenf)) parameters -#define GET_TexGenf(disp) ((disp)->TexGenf) -#define SET_TexGenf(disp, fn) ((disp)->TexGenf = fn) -#define CALL_TexGenfv(disp, parameters) (*((disp)->TexGenfv)) parameters -#define GET_TexGenfv(disp) ((disp)->TexGenfv) -#define SET_TexGenfv(disp, fn) ((disp)->TexGenfv = fn) -#define CALL_TexGeni(disp, parameters) (*((disp)->TexGeni)) parameters -#define GET_TexGeni(disp) ((disp)->TexGeni) -#define SET_TexGeni(disp, fn) ((disp)->TexGeni = fn) -#define CALL_TexGeniv(disp, parameters) (*((disp)->TexGeniv)) parameters -#define GET_TexGeniv(disp) ((disp)->TexGeniv) -#define SET_TexGeniv(disp, fn) ((disp)->TexGeniv = fn) -#define CALL_FeedbackBuffer(disp, parameters) (*((disp)->FeedbackBuffer)) parameters -#define GET_FeedbackBuffer(disp) ((disp)->FeedbackBuffer) -#define SET_FeedbackBuffer(disp, fn) ((disp)->FeedbackBuffer = fn) -#define CALL_SelectBuffer(disp, parameters) (*((disp)->SelectBuffer)) parameters -#define GET_SelectBuffer(disp) ((disp)->SelectBuffer) -#define SET_SelectBuffer(disp, fn) ((disp)->SelectBuffer = fn) -#define CALL_RenderMode(disp, parameters) (*((disp)->RenderMode)) parameters -#define GET_RenderMode(disp) ((disp)->RenderMode) -#define SET_RenderMode(disp, fn) ((disp)->RenderMode = fn) -#define CALL_InitNames(disp, parameters) (*((disp)->InitNames)) parameters -#define GET_InitNames(disp) ((disp)->InitNames) -#define SET_InitNames(disp, fn) ((disp)->InitNames = fn) -#define CALL_LoadName(disp, parameters) (*((disp)->LoadName)) parameters -#define GET_LoadName(disp) ((disp)->LoadName) -#define SET_LoadName(disp, fn) ((disp)->LoadName = fn) -#define CALL_PassThrough(disp, parameters) (*((disp)->PassThrough)) parameters -#define GET_PassThrough(disp) ((disp)->PassThrough) -#define SET_PassThrough(disp, fn) ((disp)->PassThrough = fn) -#define CALL_PopName(disp, parameters) (*((disp)->PopName)) parameters -#define GET_PopName(disp) ((disp)->PopName) -#define SET_PopName(disp, fn) ((disp)->PopName = fn) -#define CALL_PushName(disp, parameters) (*((disp)->PushName)) parameters -#define GET_PushName(disp) ((disp)->PushName) -#define SET_PushName(disp, fn) ((disp)->PushName = fn) -#define CALL_DrawBuffer(disp, parameters) (*((disp)->DrawBuffer)) parameters -#define GET_DrawBuffer(disp) ((disp)->DrawBuffer) -#define SET_DrawBuffer(disp, fn) ((disp)->DrawBuffer = fn) -#define CALL_Clear(disp, parameters) (*((disp)->Clear)) parameters -#define GET_Clear(disp) ((disp)->Clear) -#define SET_Clear(disp, fn) ((disp)->Clear = fn) -#define CALL_ClearAccum(disp, parameters) (*((disp)->ClearAccum)) parameters -#define GET_ClearAccum(disp) ((disp)->ClearAccum) -#define SET_ClearAccum(disp, fn) ((disp)->ClearAccum = fn) -#define CALL_ClearIndex(disp, parameters) (*((disp)->ClearIndex)) parameters -#define GET_ClearIndex(disp) ((disp)->ClearIndex) -#define SET_ClearIndex(disp, fn) ((disp)->ClearIndex = fn) -#define CALL_ClearColor(disp, parameters) (*((disp)->ClearColor)) parameters -#define GET_ClearColor(disp) ((disp)->ClearColor) -#define SET_ClearColor(disp, fn) ((disp)->ClearColor = fn) -#define CALL_ClearStencil(disp, parameters) (*((disp)->ClearStencil)) parameters -#define GET_ClearStencil(disp) ((disp)->ClearStencil) -#define SET_ClearStencil(disp, fn) ((disp)->ClearStencil = fn) -#define CALL_ClearDepth(disp, parameters) (*((disp)->ClearDepth)) parameters -#define GET_ClearDepth(disp) ((disp)->ClearDepth) -#define SET_ClearDepth(disp, fn) ((disp)->ClearDepth = fn) -#define CALL_StencilMask(disp, parameters) (*((disp)->StencilMask)) parameters -#define GET_StencilMask(disp) ((disp)->StencilMask) -#define SET_StencilMask(disp, fn) ((disp)->StencilMask = fn) -#define CALL_ColorMask(disp, parameters) (*((disp)->ColorMask)) parameters -#define GET_ColorMask(disp) ((disp)->ColorMask) -#define SET_ColorMask(disp, fn) ((disp)->ColorMask = fn) -#define CALL_DepthMask(disp, parameters) (*((disp)->DepthMask)) parameters -#define GET_DepthMask(disp) ((disp)->DepthMask) -#define SET_DepthMask(disp, fn) ((disp)->DepthMask = fn) -#define CALL_IndexMask(disp, parameters) (*((disp)->IndexMask)) parameters -#define GET_IndexMask(disp) ((disp)->IndexMask) -#define SET_IndexMask(disp, fn) ((disp)->IndexMask = fn) -#define CALL_Accum(disp, parameters) (*((disp)->Accum)) parameters -#define GET_Accum(disp) ((disp)->Accum) -#define SET_Accum(disp, fn) ((disp)->Accum = fn) -#define CALL_Disable(disp, parameters) (*((disp)->Disable)) parameters -#define GET_Disable(disp) ((disp)->Disable) -#define SET_Disable(disp, fn) ((disp)->Disable = fn) -#define CALL_Enable(disp, parameters) (*((disp)->Enable)) parameters -#define GET_Enable(disp) ((disp)->Enable) -#define SET_Enable(disp, fn) ((disp)->Enable = fn) -#define CALL_Finish(disp, parameters) (*((disp)->Finish)) parameters -#define GET_Finish(disp) ((disp)->Finish) -#define SET_Finish(disp, fn) ((disp)->Finish = fn) -#define CALL_Flush(disp, parameters) (*((disp)->Flush)) parameters -#define GET_Flush(disp) ((disp)->Flush) -#define SET_Flush(disp, fn) ((disp)->Flush = fn) -#define CALL_PopAttrib(disp, parameters) (*((disp)->PopAttrib)) parameters -#define GET_PopAttrib(disp) ((disp)->PopAttrib) -#define SET_PopAttrib(disp, fn) ((disp)->PopAttrib = fn) -#define CALL_PushAttrib(disp, parameters) (*((disp)->PushAttrib)) parameters -#define GET_PushAttrib(disp) ((disp)->PushAttrib) -#define SET_PushAttrib(disp, fn) ((disp)->PushAttrib = fn) -#define CALL_Map1d(disp, parameters) (*((disp)->Map1d)) parameters -#define GET_Map1d(disp) ((disp)->Map1d) -#define SET_Map1d(disp, fn) ((disp)->Map1d = fn) -#define CALL_Map1f(disp, parameters) (*((disp)->Map1f)) parameters -#define GET_Map1f(disp) ((disp)->Map1f) -#define SET_Map1f(disp, fn) ((disp)->Map1f = fn) -#define CALL_Map2d(disp, parameters) (*((disp)->Map2d)) parameters -#define GET_Map2d(disp) ((disp)->Map2d) -#define SET_Map2d(disp, fn) ((disp)->Map2d = fn) -#define CALL_Map2f(disp, parameters) (*((disp)->Map2f)) parameters -#define GET_Map2f(disp) ((disp)->Map2f) -#define SET_Map2f(disp, fn) ((disp)->Map2f = fn) -#define CALL_MapGrid1d(disp, parameters) (*((disp)->MapGrid1d)) parameters -#define GET_MapGrid1d(disp) ((disp)->MapGrid1d) -#define SET_MapGrid1d(disp, fn) ((disp)->MapGrid1d = fn) -#define CALL_MapGrid1f(disp, parameters) (*((disp)->MapGrid1f)) parameters -#define GET_MapGrid1f(disp) ((disp)->MapGrid1f) -#define SET_MapGrid1f(disp, fn) ((disp)->MapGrid1f = fn) -#define CALL_MapGrid2d(disp, parameters) (*((disp)->MapGrid2d)) parameters -#define GET_MapGrid2d(disp) ((disp)->MapGrid2d) -#define SET_MapGrid2d(disp, fn) ((disp)->MapGrid2d = fn) -#define CALL_MapGrid2f(disp, parameters) (*((disp)->MapGrid2f)) parameters -#define GET_MapGrid2f(disp) ((disp)->MapGrid2f) -#define SET_MapGrid2f(disp, fn) ((disp)->MapGrid2f = fn) -#define CALL_EvalCoord1d(disp, parameters) (*((disp)->EvalCoord1d)) parameters -#define GET_EvalCoord1d(disp) ((disp)->EvalCoord1d) -#define SET_EvalCoord1d(disp, fn) ((disp)->EvalCoord1d = fn) -#define CALL_EvalCoord1dv(disp, parameters) (*((disp)->EvalCoord1dv)) parameters -#define GET_EvalCoord1dv(disp) ((disp)->EvalCoord1dv) -#define SET_EvalCoord1dv(disp, fn) ((disp)->EvalCoord1dv = fn) -#define CALL_EvalCoord1f(disp, parameters) (*((disp)->EvalCoord1f)) parameters -#define GET_EvalCoord1f(disp) ((disp)->EvalCoord1f) -#define SET_EvalCoord1f(disp, fn) ((disp)->EvalCoord1f = fn) -#define CALL_EvalCoord1fv(disp, parameters) (*((disp)->EvalCoord1fv)) parameters -#define GET_EvalCoord1fv(disp) ((disp)->EvalCoord1fv) -#define SET_EvalCoord1fv(disp, fn) ((disp)->EvalCoord1fv = fn) -#define CALL_EvalCoord2d(disp, parameters) (*((disp)->EvalCoord2d)) parameters -#define GET_EvalCoord2d(disp) ((disp)->EvalCoord2d) -#define SET_EvalCoord2d(disp, fn) ((disp)->EvalCoord2d = fn) -#define CALL_EvalCoord2dv(disp, parameters) (*((disp)->EvalCoord2dv)) parameters -#define GET_EvalCoord2dv(disp) ((disp)->EvalCoord2dv) -#define SET_EvalCoord2dv(disp, fn) ((disp)->EvalCoord2dv = fn) -#define CALL_EvalCoord2f(disp, parameters) (*((disp)->EvalCoord2f)) parameters -#define GET_EvalCoord2f(disp) ((disp)->EvalCoord2f) -#define SET_EvalCoord2f(disp, fn) ((disp)->EvalCoord2f = fn) -#define CALL_EvalCoord2fv(disp, parameters) (*((disp)->EvalCoord2fv)) parameters -#define GET_EvalCoord2fv(disp) ((disp)->EvalCoord2fv) -#define SET_EvalCoord2fv(disp, fn) ((disp)->EvalCoord2fv = fn) -#define CALL_EvalMesh1(disp, parameters) (*((disp)->EvalMesh1)) parameters -#define GET_EvalMesh1(disp) ((disp)->EvalMesh1) -#define SET_EvalMesh1(disp, fn) ((disp)->EvalMesh1 = fn) -#define CALL_EvalPoint1(disp, parameters) (*((disp)->EvalPoint1)) parameters -#define GET_EvalPoint1(disp) ((disp)->EvalPoint1) -#define SET_EvalPoint1(disp, fn) ((disp)->EvalPoint1 = fn) -#define CALL_EvalMesh2(disp, parameters) (*((disp)->EvalMesh2)) parameters -#define GET_EvalMesh2(disp) ((disp)->EvalMesh2) -#define SET_EvalMesh2(disp, fn) ((disp)->EvalMesh2 = fn) -#define CALL_EvalPoint2(disp, parameters) (*((disp)->EvalPoint2)) parameters -#define GET_EvalPoint2(disp) ((disp)->EvalPoint2) -#define SET_EvalPoint2(disp, fn) ((disp)->EvalPoint2 = fn) -#define CALL_AlphaFunc(disp, parameters) (*((disp)->AlphaFunc)) parameters -#define GET_AlphaFunc(disp) ((disp)->AlphaFunc) -#define SET_AlphaFunc(disp, fn) ((disp)->AlphaFunc = fn) -#define CALL_BlendFunc(disp, parameters) (*((disp)->BlendFunc)) parameters -#define GET_BlendFunc(disp) ((disp)->BlendFunc) -#define SET_BlendFunc(disp, fn) ((disp)->BlendFunc = fn) -#define CALL_LogicOp(disp, parameters) (*((disp)->LogicOp)) parameters -#define GET_LogicOp(disp) ((disp)->LogicOp) -#define SET_LogicOp(disp, fn) ((disp)->LogicOp = fn) -#define CALL_StencilFunc(disp, parameters) (*((disp)->StencilFunc)) parameters -#define GET_StencilFunc(disp) ((disp)->StencilFunc) -#define SET_StencilFunc(disp, fn) ((disp)->StencilFunc = fn) -#define CALL_StencilOp(disp, parameters) (*((disp)->StencilOp)) parameters -#define GET_StencilOp(disp) ((disp)->StencilOp) -#define SET_StencilOp(disp, fn) ((disp)->StencilOp = fn) -#define CALL_DepthFunc(disp, parameters) (*((disp)->DepthFunc)) parameters -#define GET_DepthFunc(disp) ((disp)->DepthFunc) -#define SET_DepthFunc(disp, fn) ((disp)->DepthFunc = fn) -#define CALL_PixelZoom(disp, parameters) (*((disp)->PixelZoom)) parameters -#define GET_PixelZoom(disp) ((disp)->PixelZoom) -#define SET_PixelZoom(disp, fn) ((disp)->PixelZoom = fn) -#define CALL_PixelTransferf(disp, parameters) (*((disp)->PixelTransferf)) parameters -#define GET_PixelTransferf(disp) ((disp)->PixelTransferf) -#define SET_PixelTransferf(disp, fn) ((disp)->PixelTransferf = fn) -#define CALL_PixelTransferi(disp, parameters) (*((disp)->PixelTransferi)) parameters -#define GET_PixelTransferi(disp) ((disp)->PixelTransferi) -#define SET_PixelTransferi(disp, fn) ((disp)->PixelTransferi = fn) -#define CALL_PixelStoref(disp, parameters) (*((disp)->PixelStoref)) parameters -#define GET_PixelStoref(disp) ((disp)->PixelStoref) -#define SET_PixelStoref(disp, fn) ((disp)->PixelStoref = fn) -#define CALL_PixelStorei(disp, parameters) (*((disp)->PixelStorei)) parameters -#define GET_PixelStorei(disp) ((disp)->PixelStorei) -#define SET_PixelStorei(disp, fn) ((disp)->PixelStorei = fn) -#define CALL_PixelMapfv(disp, parameters) (*((disp)->PixelMapfv)) parameters -#define GET_PixelMapfv(disp) ((disp)->PixelMapfv) -#define SET_PixelMapfv(disp, fn) ((disp)->PixelMapfv = fn) -#define CALL_PixelMapuiv(disp, parameters) (*((disp)->PixelMapuiv)) parameters -#define GET_PixelMapuiv(disp) ((disp)->PixelMapuiv) -#define SET_PixelMapuiv(disp, fn) ((disp)->PixelMapuiv = fn) -#define CALL_PixelMapusv(disp, parameters) (*((disp)->PixelMapusv)) parameters -#define GET_PixelMapusv(disp) ((disp)->PixelMapusv) -#define SET_PixelMapusv(disp, fn) ((disp)->PixelMapusv = fn) -#define CALL_ReadBuffer(disp, parameters) (*((disp)->ReadBuffer)) parameters -#define GET_ReadBuffer(disp) ((disp)->ReadBuffer) -#define SET_ReadBuffer(disp, fn) ((disp)->ReadBuffer = fn) -#define CALL_CopyPixels(disp, parameters) (*((disp)->CopyPixels)) parameters -#define GET_CopyPixels(disp) ((disp)->CopyPixels) -#define SET_CopyPixels(disp, fn) ((disp)->CopyPixels = fn) -#define CALL_ReadPixels(disp, parameters) (*((disp)->ReadPixels)) parameters -#define GET_ReadPixels(disp) ((disp)->ReadPixels) -#define SET_ReadPixels(disp, fn) ((disp)->ReadPixels = fn) -#define CALL_DrawPixels(disp, parameters) (*((disp)->DrawPixels)) parameters -#define GET_DrawPixels(disp) ((disp)->DrawPixels) -#define SET_DrawPixels(disp, fn) ((disp)->DrawPixels = fn) -#define CALL_GetBooleanv(disp, parameters) (*((disp)->GetBooleanv)) parameters -#define GET_GetBooleanv(disp) ((disp)->GetBooleanv) -#define SET_GetBooleanv(disp, fn) ((disp)->GetBooleanv = fn) -#define CALL_GetClipPlane(disp, parameters) (*((disp)->GetClipPlane)) parameters -#define GET_GetClipPlane(disp) ((disp)->GetClipPlane) -#define SET_GetClipPlane(disp, fn) ((disp)->GetClipPlane = fn) -#define CALL_GetDoublev(disp, parameters) (*((disp)->GetDoublev)) parameters -#define GET_GetDoublev(disp) ((disp)->GetDoublev) -#define SET_GetDoublev(disp, fn) ((disp)->GetDoublev = fn) -#define CALL_GetError(disp, parameters) (*((disp)->GetError)) parameters -#define GET_GetError(disp) ((disp)->GetError) -#define SET_GetError(disp, fn) ((disp)->GetError = fn) -#define CALL_GetFloatv(disp, parameters) (*((disp)->GetFloatv)) parameters -#define GET_GetFloatv(disp) ((disp)->GetFloatv) -#define SET_GetFloatv(disp, fn) ((disp)->GetFloatv = fn) -#define CALL_GetIntegerv(disp, parameters) (*((disp)->GetIntegerv)) parameters -#define GET_GetIntegerv(disp) ((disp)->GetIntegerv) -#define SET_GetIntegerv(disp, fn) ((disp)->GetIntegerv = fn) -#define CALL_GetLightfv(disp, parameters) (*((disp)->GetLightfv)) parameters -#define GET_GetLightfv(disp) ((disp)->GetLightfv) -#define SET_GetLightfv(disp, fn) ((disp)->GetLightfv = fn) -#define CALL_GetLightiv(disp, parameters) (*((disp)->GetLightiv)) parameters -#define GET_GetLightiv(disp) ((disp)->GetLightiv) -#define SET_GetLightiv(disp, fn) ((disp)->GetLightiv = fn) -#define CALL_GetMapdv(disp, parameters) (*((disp)->GetMapdv)) parameters -#define GET_GetMapdv(disp) ((disp)->GetMapdv) -#define SET_GetMapdv(disp, fn) ((disp)->GetMapdv = fn) -#define CALL_GetMapfv(disp, parameters) (*((disp)->GetMapfv)) parameters -#define GET_GetMapfv(disp) ((disp)->GetMapfv) -#define SET_GetMapfv(disp, fn) ((disp)->GetMapfv = fn) -#define CALL_GetMapiv(disp, parameters) (*((disp)->GetMapiv)) parameters -#define GET_GetMapiv(disp) ((disp)->GetMapiv) -#define SET_GetMapiv(disp, fn) ((disp)->GetMapiv = fn) -#define CALL_GetMaterialfv(disp, parameters) (*((disp)->GetMaterialfv)) parameters -#define GET_GetMaterialfv(disp) ((disp)->GetMaterialfv) -#define SET_GetMaterialfv(disp, fn) ((disp)->GetMaterialfv = fn) -#define CALL_GetMaterialiv(disp, parameters) (*((disp)->GetMaterialiv)) parameters -#define GET_GetMaterialiv(disp) ((disp)->GetMaterialiv) -#define SET_GetMaterialiv(disp, fn) ((disp)->GetMaterialiv = fn) -#define CALL_GetPixelMapfv(disp, parameters) (*((disp)->GetPixelMapfv)) parameters -#define GET_GetPixelMapfv(disp) ((disp)->GetPixelMapfv) -#define SET_GetPixelMapfv(disp, fn) ((disp)->GetPixelMapfv = fn) -#define CALL_GetPixelMapuiv(disp, parameters) (*((disp)->GetPixelMapuiv)) parameters -#define GET_GetPixelMapuiv(disp) ((disp)->GetPixelMapuiv) -#define SET_GetPixelMapuiv(disp, fn) ((disp)->GetPixelMapuiv = fn) -#define CALL_GetPixelMapusv(disp, parameters) (*((disp)->GetPixelMapusv)) parameters -#define GET_GetPixelMapusv(disp) ((disp)->GetPixelMapusv) -#define SET_GetPixelMapusv(disp, fn) ((disp)->GetPixelMapusv = fn) -#define CALL_GetPolygonStipple(disp, parameters) (*((disp)->GetPolygonStipple)) parameters -#define GET_GetPolygonStipple(disp) ((disp)->GetPolygonStipple) -#define SET_GetPolygonStipple(disp, fn) ((disp)->GetPolygonStipple = fn) -#define CALL_GetString(disp, parameters) (*((disp)->GetString)) parameters -#define GET_GetString(disp) ((disp)->GetString) -#define SET_GetString(disp, fn) ((disp)->GetString = fn) -#define CALL_GetTexEnvfv(disp, parameters) (*((disp)->GetTexEnvfv)) parameters -#define GET_GetTexEnvfv(disp) ((disp)->GetTexEnvfv) -#define SET_GetTexEnvfv(disp, fn) ((disp)->GetTexEnvfv = fn) -#define CALL_GetTexEnviv(disp, parameters) (*((disp)->GetTexEnviv)) parameters -#define GET_GetTexEnviv(disp) ((disp)->GetTexEnviv) -#define SET_GetTexEnviv(disp, fn) ((disp)->GetTexEnviv = fn) -#define CALL_GetTexGendv(disp, parameters) (*((disp)->GetTexGendv)) parameters -#define GET_GetTexGendv(disp) ((disp)->GetTexGendv) -#define SET_GetTexGendv(disp, fn) ((disp)->GetTexGendv = fn) -#define CALL_GetTexGenfv(disp, parameters) (*((disp)->GetTexGenfv)) parameters -#define GET_GetTexGenfv(disp) ((disp)->GetTexGenfv) -#define SET_GetTexGenfv(disp, fn) ((disp)->GetTexGenfv = fn) -#define CALL_GetTexGeniv(disp, parameters) (*((disp)->GetTexGeniv)) parameters -#define GET_GetTexGeniv(disp) ((disp)->GetTexGeniv) -#define SET_GetTexGeniv(disp, fn) ((disp)->GetTexGeniv = fn) -#define CALL_GetTexImage(disp, parameters) (*((disp)->GetTexImage)) parameters -#define GET_GetTexImage(disp) ((disp)->GetTexImage) -#define SET_GetTexImage(disp, fn) ((disp)->GetTexImage = fn) -#define CALL_GetTexParameterfv(disp, parameters) (*((disp)->GetTexParameterfv)) parameters -#define GET_GetTexParameterfv(disp) ((disp)->GetTexParameterfv) -#define SET_GetTexParameterfv(disp, fn) ((disp)->GetTexParameterfv = fn) -#define CALL_GetTexParameteriv(disp, parameters) (*((disp)->GetTexParameteriv)) parameters -#define GET_GetTexParameteriv(disp) ((disp)->GetTexParameteriv) -#define SET_GetTexParameteriv(disp, fn) ((disp)->GetTexParameteriv = fn) -#define CALL_GetTexLevelParameterfv(disp, parameters) (*((disp)->GetTexLevelParameterfv)) parameters -#define GET_GetTexLevelParameterfv(disp) ((disp)->GetTexLevelParameterfv) -#define SET_GetTexLevelParameterfv(disp, fn) ((disp)->GetTexLevelParameterfv = fn) -#define CALL_GetTexLevelParameteriv(disp, parameters) (*((disp)->GetTexLevelParameteriv)) parameters -#define GET_GetTexLevelParameteriv(disp) ((disp)->GetTexLevelParameteriv) -#define SET_GetTexLevelParameteriv(disp, fn) ((disp)->GetTexLevelParameteriv = fn) -#define CALL_IsEnabled(disp, parameters) (*((disp)->IsEnabled)) parameters -#define GET_IsEnabled(disp) ((disp)->IsEnabled) -#define SET_IsEnabled(disp, fn) ((disp)->IsEnabled = fn) -#define CALL_IsList(disp, parameters) (*((disp)->IsList)) parameters -#define GET_IsList(disp) ((disp)->IsList) -#define SET_IsList(disp, fn) ((disp)->IsList = fn) -#define CALL_DepthRange(disp, parameters) (*((disp)->DepthRange)) parameters -#define GET_DepthRange(disp) ((disp)->DepthRange) -#define SET_DepthRange(disp, fn) ((disp)->DepthRange = fn) -#define CALL_Frustum(disp, parameters) (*((disp)->Frustum)) parameters -#define GET_Frustum(disp) ((disp)->Frustum) -#define SET_Frustum(disp, fn) ((disp)->Frustum = fn) -#define CALL_LoadIdentity(disp, parameters) (*((disp)->LoadIdentity)) parameters -#define GET_LoadIdentity(disp) ((disp)->LoadIdentity) -#define SET_LoadIdentity(disp, fn) ((disp)->LoadIdentity = fn) -#define CALL_LoadMatrixf(disp, parameters) (*((disp)->LoadMatrixf)) parameters -#define GET_LoadMatrixf(disp) ((disp)->LoadMatrixf) -#define SET_LoadMatrixf(disp, fn) ((disp)->LoadMatrixf = fn) -#define CALL_LoadMatrixd(disp, parameters) (*((disp)->LoadMatrixd)) parameters -#define GET_LoadMatrixd(disp) ((disp)->LoadMatrixd) -#define SET_LoadMatrixd(disp, fn) ((disp)->LoadMatrixd = fn) -#define CALL_MatrixMode(disp, parameters) (*((disp)->MatrixMode)) parameters -#define GET_MatrixMode(disp) ((disp)->MatrixMode) -#define SET_MatrixMode(disp, fn) ((disp)->MatrixMode = fn) -#define CALL_MultMatrixf(disp, parameters) (*((disp)->MultMatrixf)) parameters -#define GET_MultMatrixf(disp) ((disp)->MultMatrixf) -#define SET_MultMatrixf(disp, fn) ((disp)->MultMatrixf = fn) -#define CALL_MultMatrixd(disp, parameters) (*((disp)->MultMatrixd)) parameters -#define GET_MultMatrixd(disp) ((disp)->MultMatrixd) -#define SET_MultMatrixd(disp, fn) ((disp)->MultMatrixd = fn) -#define CALL_Ortho(disp, parameters) (*((disp)->Ortho)) parameters -#define GET_Ortho(disp) ((disp)->Ortho) -#define SET_Ortho(disp, fn) ((disp)->Ortho = fn) -#define CALL_PopMatrix(disp, parameters) (*((disp)->PopMatrix)) parameters -#define GET_PopMatrix(disp) ((disp)->PopMatrix) -#define SET_PopMatrix(disp, fn) ((disp)->PopMatrix = fn) -#define CALL_PushMatrix(disp, parameters) (*((disp)->PushMatrix)) parameters -#define GET_PushMatrix(disp) ((disp)->PushMatrix) -#define SET_PushMatrix(disp, fn) ((disp)->PushMatrix = fn) -#define CALL_Rotated(disp, parameters) (*((disp)->Rotated)) parameters -#define GET_Rotated(disp) ((disp)->Rotated) -#define SET_Rotated(disp, fn) ((disp)->Rotated = fn) -#define CALL_Rotatef(disp, parameters) (*((disp)->Rotatef)) parameters -#define GET_Rotatef(disp) ((disp)->Rotatef) -#define SET_Rotatef(disp, fn) ((disp)->Rotatef = fn) -#define CALL_Scaled(disp, parameters) (*((disp)->Scaled)) parameters -#define GET_Scaled(disp) ((disp)->Scaled) -#define SET_Scaled(disp, fn) ((disp)->Scaled = fn) -#define CALL_Scalef(disp, parameters) (*((disp)->Scalef)) parameters -#define GET_Scalef(disp) ((disp)->Scalef) -#define SET_Scalef(disp, fn) ((disp)->Scalef = fn) -#define CALL_Translated(disp, parameters) (*((disp)->Translated)) parameters -#define GET_Translated(disp) ((disp)->Translated) -#define SET_Translated(disp, fn) ((disp)->Translated = fn) -#define CALL_Translatef(disp, parameters) (*((disp)->Translatef)) parameters -#define GET_Translatef(disp) ((disp)->Translatef) -#define SET_Translatef(disp, fn) ((disp)->Translatef = fn) -#define CALL_Viewport(disp, parameters) (*((disp)->Viewport)) parameters -#define GET_Viewport(disp) ((disp)->Viewport) -#define SET_Viewport(disp, fn) ((disp)->Viewport = fn) -#define CALL_ArrayElement(disp, parameters) (*((disp)->ArrayElement)) parameters -#define GET_ArrayElement(disp) ((disp)->ArrayElement) -#define SET_ArrayElement(disp, fn) ((disp)->ArrayElement = fn) -#define CALL_BindTexture(disp, parameters) (*((disp)->BindTexture)) parameters -#define GET_BindTexture(disp) ((disp)->BindTexture) -#define SET_BindTexture(disp, fn) ((disp)->BindTexture = fn) -#define CALL_ColorPointer(disp, parameters) (*((disp)->ColorPointer)) parameters -#define GET_ColorPointer(disp) ((disp)->ColorPointer) -#define SET_ColorPointer(disp, fn) ((disp)->ColorPointer = fn) -#define CALL_DisableClientState(disp, parameters) (*((disp)->DisableClientState)) parameters -#define GET_DisableClientState(disp) ((disp)->DisableClientState) -#define SET_DisableClientState(disp, fn) ((disp)->DisableClientState = fn) -#define CALL_DrawArrays(disp, parameters) (*((disp)->DrawArrays)) parameters -#define GET_DrawArrays(disp) ((disp)->DrawArrays) -#define SET_DrawArrays(disp, fn) ((disp)->DrawArrays = fn) -#define CALL_DrawElements(disp, parameters) (*((disp)->DrawElements)) parameters -#define GET_DrawElements(disp) ((disp)->DrawElements) -#define SET_DrawElements(disp, fn) ((disp)->DrawElements = fn) -#define CALL_EdgeFlagPointer(disp, parameters) (*((disp)->EdgeFlagPointer)) parameters -#define GET_EdgeFlagPointer(disp) ((disp)->EdgeFlagPointer) -#define SET_EdgeFlagPointer(disp, fn) ((disp)->EdgeFlagPointer = fn) -#define CALL_EnableClientState(disp, parameters) (*((disp)->EnableClientState)) parameters -#define GET_EnableClientState(disp) ((disp)->EnableClientState) -#define SET_EnableClientState(disp, fn) ((disp)->EnableClientState = fn) -#define CALL_IndexPointer(disp, parameters) (*((disp)->IndexPointer)) parameters -#define GET_IndexPointer(disp) ((disp)->IndexPointer) -#define SET_IndexPointer(disp, fn) ((disp)->IndexPointer = fn) -#define CALL_Indexub(disp, parameters) (*((disp)->Indexub)) parameters -#define GET_Indexub(disp) ((disp)->Indexub) -#define SET_Indexub(disp, fn) ((disp)->Indexub = fn) -#define CALL_Indexubv(disp, parameters) (*((disp)->Indexubv)) parameters -#define GET_Indexubv(disp) ((disp)->Indexubv) -#define SET_Indexubv(disp, fn) ((disp)->Indexubv = fn) -#define CALL_InterleavedArrays(disp, parameters) (*((disp)->InterleavedArrays)) parameters -#define GET_InterleavedArrays(disp) ((disp)->InterleavedArrays) -#define SET_InterleavedArrays(disp, fn) ((disp)->InterleavedArrays = fn) -#define CALL_NormalPointer(disp, parameters) (*((disp)->NormalPointer)) parameters -#define GET_NormalPointer(disp) ((disp)->NormalPointer) -#define SET_NormalPointer(disp, fn) ((disp)->NormalPointer = fn) -#define CALL_PolygonOffset(disp, parameters) (*((disp)->PolygonOffset)) parameters -#define GET_PolygonOffset(disp) ((disp)->PolygonOffset) -#define SET_PolygonOffset(disp, fn) ((disp)->PolygonOffset = fn) -#define CALL_TexCoordPointer(disp, parameters) (*((disp)->TexCoordPointer)) parameters -#define GET_TexCoordPointer(disp) ((disp)->TexCoordPointer) -#define SET_TexCoordPointer(disp, fn) ((disp)->TexCoordPointer = fn) -#define CALL_VertexPointer(disp, parameters) (*((disp)->VertexPointer)) parameters -#define GET_VertexPointer(disp) ((disp)->VertexPointer) -#define SET_VertexPointer(disp, fn) ((disp)->VertexPointer = fn) -#define CALL_AreTexturesResident(disp, parameters) (*((disp)->AreTexturesResident)) parameters -#define GET_AreTexturesResident(disp) ((disp)->AreTexturesResident) -#define SET_AreTexturesResident(disp, fn) ((disp)->AreTexturesResident = fn) -#define CALL_CopyTexImage1D(disp, parameters) (*((disp)->CopyTexImage1D)) parameters -#define GET_CopyTexImage1D(disp) ((disp)->CopyTexImage1D) -#define SET_CopyTexImage1D(disp, fn) ((disp)->CopyTexImage1D = fn) -#define CALL_CopyTexImage2D(disp, parameters) (*((disp)->CopyTexImage2D)) parameters -#define GET_CopyTexImage2D(disp) ((disp)->CopyTexImage2D) -#define SET_CopyTexImage2D(disp, fn) ((disp)->CopyTexImage2D = fn) -#define CALL_CopyTexSubImage1D(disp, parameters) (*((disp)->CopyTexSubImage1D)) parameters -#define GET_CopyTexSubImage1D(disp) ((disp)->CopyTexSubImage1D) -#define SET_CopyTexSubImage1D(disp, fn) ((disp)->CopyTexSubImage1D = fn) -#define CALL_CopyTexSubImage2D(disp, parameters) (*((disp)->CopyTexSubImage2D)) parameters -#define GET_CopyTexSubImage2D(disp) ((disp)->CopyTexSubImage2D) -#define SET_CopyTexSubImage2D(disp, fn) ((disp)->CopyTexSubImage2D = fn) -#define CALL_DeleteTextures(disp, parameters) (*((disp)->DeleteTextures)) parameters -#define GET_DeleteTextures(disp) ((disp)->DeleteTextures) -#define SET_DeleteTextures(disp, fn) ((disp)->DeleteTextures = fn) -#define CALL_GenTextures(disp, parameters) (*((disp)->GenTextures)) parameters -#define GET_GenTextures(disp) ((disp)->GenTextures) -#define SET_GenTextures(disp, fn) ((disp)->GenTextures = fn) -#define CALL_GetPointerv(disp, parameters) (*((disp)->GetPointerv)) parameters -#define GET_GetPointerv(disp) ((disp)->GetPointerv) -#define SET_GetPointerv(disp, fn) ((disp)->GetPointerv = fn) -#define CALL_IsTexture(disp, parameters) (*((disp)->IsTexture)) parameters -#define GET_IsTexture(disp) ((disp)->IsTexture) -#define SET_IsTexture(disp, fn) ((disp)->IsTexture = fn) -#define CALL_PrioritizeTextures(disp, parameters) (*((disp)->PrioritizeTextures)) parameters -#define GET_PrioritizeTextures(disp) ((disp)->PrioritizeTextures) -#define SET_PrioritizeTextures(disp, fn) ((disp)->PrioritizeTextures = fn) -#define CALL_TexSubImage1D(disp, parameters) (*((disp)->TexSubImage1D)) parameters -#define GET_TexSubImage1D(disp) ((disp)->TexSubImage1D) -#define SET_TexSubImage1D(disp, fn) ((disp)->TexSubImage1D = fn) -#define CALL_TexSubImage2D(disp, parameters) (*((disp)->TexSubImage2D)) parameters -#define GET_TexSubImage2D(disp) ((disp)->TexSubImage2D) -#define SET_TexSubImage2D(disp, fn) ((disp)->TexSubImage2D = fn) -#define CALL_PopClientAttrib(disp, parameters) (*((disp)->PopClientAttrib)) parameters -#define GET_PopClientAttrib(disp) ((disp)->PopClientAttrib) -#define SET_PopClientAttrib(disp, fn) ((disp)->PopClientAttrib = fn) -#define CALL_PushClientAttrib(disp, parameters) (*((disp)->PushClientAttrib)) parameters -#define GET_PushClientAttrib(disp) ((disp)->PushClientAttrib) -#define SET_PushClientAttrib(disp, fn) ((disp)->PushClientAttrib = fn) -#define CALL_BlendColor(disp, parameters) (*((disp)->BlendColor)) parameters -#define GET_BlendColor(disp) ((disp)->BlendColor) -#define SET_BlendColor(disp, fn) ((disp)->BlendColor = fn) -#define CALL_BlendEquation(disp, parameters) (*((disp)->BlendEquation)) parameters -#define GET_BlendEquation(disp) ((disp)->BlendEquation) -#define SET_BlendEquation(disp, fn) ((disp)->BlendEquation = fn) -#define CALL_DrawRangeElements(disp, parameters) (*((disp)->DrawRangeElements)) parameters -#define GET_DrawRangeElements(disp) ((disp)->DrawRangeElements) -#define SET_DrawRangeElements(disp, fn) ((disp)->DrawRangeElements = fn) -#define CALL_ColorTable(disp, parameters) (*((disp)->ColorTable)) parameters -#define GET_ColorTable(disp) ((disp)->ColorTable) -#define SET_ColorTable(disp, fn) ((disp)->ColorTable = fn) -#define CALL_ColorTableParameterfv(disp, parameters) (*((disp)->ColorTableParameterfv)) parameters -#define GET_ColorTableParameterfv(disp) ((disp)->ColorTableParameterfv) -#define SET_ColorTableParameterfv(disp, fn) ((disp)->ColorTableParameterfv = fn) -#define CALL_ColorTableParameteriv(disp, parameters) (*((disp)->ColorTableParameteriv)) parameters -#define GET_ColorTableParameteriv(disp) ((disp)->ColorTableParameteriv) -#define SET_ColorTableParameteriv(disp, fn) ((disp)->ColorTableParameteriv = fn) -#define CALL_CopyColorTable(disp, parameters) (*((disp)->CopyColorTable)) parameters -#define GET_CopyColorTable(disp) ((disp)->CopyColorTable) -#define SET_CopyColorTable(disp, fn) ((disp)->CopyColorTable = fn) -#define CALL_GetColorTable(disp, parameters) (*((disp)->GetColorTable)) parameters -#define GET_GetColorTable(disp) ((disp)->GetColorTable) -#define SET_GetColorTable(disp, fn) ((disp)->GetColorTable = fn) -#define CALL_GetColorTableParameterfv(disp, parameters) (*((disp)->GetColorTableParameterfv)) parameters -#define GET_GetColorTableParameterfv(disp) ((disp)->GetColorTableParameterfv) -#define SET_GetColorTableParameterfv(disp, fn) ((disp)->GetColorTableParameterfv = fn) -#define CALL_GetColorTableParameteriv(disp, parameters) (*((disp)->GetColorTableParameteriv)) parameters -#define GET_GetColorTableParameteriv(disp) ((disp)->GetColorTableParameteriv) -#define SET_GetColorTableParameteriv(disp, fn) ((disp)->GetColorTableParameteriv = fn) -#define CALL_ColorSubTable(disp, parameters) (*((disp)->ColorSubTable)) parameters -#define GET_ColorSubTable(disp) ((disp)->ColorSubTable) -#define SET_ColorSubTable(disp, fn) ((disp)->ColorSubTable = fn) -#define CALL_CopyColorSubTable(disp, parameters) (*((disp)->CopyColorSubTable)) parameters -#define GET_CopyColorSubTable(disp) ((disp)->CopyColorSubTable) -#define SET_CopyColorSubTable(disp, fn) ((disp)->CopyColorSubTable = fn) -#define CALL_ConvolutionFilter1D(disp, parameters) (*((disp)->ConvolutionFilter1D)) parameters -#define GET_ConvolutionFilter1D(disp) ((disp)->ConvolutionFilter1D) -#define SET_ConvolutionFilter1D(disp, fn) ((disp)->ConvolutionFilter1D = fn) -#define CALL_ConvolutionFilter2D(disp, parameters) (*((disp)->ConvolutionFilter2D)) parameters -#define GET_ConvolutionFilter2D(disp) ((disp)->ConvolutionFilter2D) -#define SET_ConvolutionFilter2D(disp, fn) ((disp)->ConvolutionFilter2D = fn) -#define CALL_ConvolutionParameterf(disp, parameters) (*((disp)->ConvolutionParameterf)) parameters -#define GET_ConvolutionParameterf(disp) ((disp)->ConvolutionParameterf) -#define SET_ConvolutionParameterf(disp, fn) ((disp)->ConvolutionParameterf = fn) -#define CALL_ConvolutionParameterfv(disp, parameters) (*((disp)->ConvolutionParameterfv)) parameters -#define GET_ConvolutionParameterfv(disp) ((disp)->ConvolutionParameterfv) -#define SET_ConvolutionParameterfv(disp, fn) ((disp)->ConvolutionParameterfv = fn) -#define CALL_ConvolutionParameteri(disp, parameters) (*((disp)->ConvolutionParameteri)) parameters -#define GET_ConvolutionParameteri(disp) ((disp)->ConvolutionParameteri) -#define SET_ConvolutionParameteri(disp, fn) ((disp)->ConvolutionParameteri = fn) -#define CALL_ConvolutionParameteriv(disp, parameters) (*((disp)->ConvolutionParameteriv)) parameters -#define GET_ConvolutionParameteriv(disp) ((disp)->ConvolutionParameteriv) -#define SET_ConvolutionParameteriv(disp, fn) ((disp)->ConvolutionParameteriv = fn) -#define CALL_CopyConvolutionFilter1D(disp, parameters) (*((disp)->CopyConvolutionFilter1D)) parameters -#define GET_CopyConvolutionFilter1D(disp) ((disp)->CopyConvolutionFilter1D) -#define SET_CopyConvolutionFilter1D(disp, fn) ((disp)->CopyConvolutionFilter1D = fn) -#define CALL_CopyConvolutionFilter2D(disp, parameters) (*((disp)->CopyConvolutionFilter2D)) parameters -#define GET_CopyConvolutionFilter2D(disp) ((disp)->CopyConvolutionFilter2D) -#define SET_CopyConvolutionFilter2D(disp, fn) ((disp)->CopyConvolutionFilter2D = fn) -#define CALL_GetConvolutionFilter(disp, parameters) (*((disp)->GetConvolutionFilter)) parameters -#define GET_GetConvolutionFilter(disp) ((disp)->GetConvolutionFilter) -#define SET_GetConvolutionFilter(disp, fn) ((disp)->GetConvolutionFilter = fn) -#define CALL_GetConvolutionParameterfv(disp, parameters) (*((disp)->GetConvolutionParameterfv)) parameters -#define GET_GetConvolutionParameterfv(disp) ((disp)->GetConvolutionParameterfv) -#define SET_GetConvolutionParameterfv(disp, fn) ((disp)->GetConvolutionParameterfv = fn) -#define CALL_GetConvolutionParameteriv(disp, parameters) (*((disp)->GetConvolutionParameteriv)) parameters -#define GET_GetConvolutionParameteriv(disp) ((disp)->GetConvolutionParameteriv) -#define SET_GetConvolutionParameteriv(disp, fn) ((disp)->GetConvolutionParameteriv = fn) -#define CALL_GetSeparableFilter(disp, parameters) (*((disp)->GetSeparableFilter)) parameters -#define GET_GetSeparableFilter(disp) ((disp)->GetSeparableFilter) -#define SET_GetSeparableFilter(disp, fn) ((disp)->GetSeparableFilter = fn) -#define CALL_SeparableFilter2D(disp, parameters) (*((disp)->SeparableFilter2D)) parameters -#define GET_SeparableFilter2D(disp) ((disp)->SeparableFilter2D) -#define SET_SeparableFilter2D(disp, fn) ((disp)->SeparableFilter2D = fn) -#define CALL_GetHistogram(disp, parameters) (*((disp)->GetHistogram)) parameters -#define GET_GetHistogram(disp) ((disp)->GetHistogram) -#define SET_GetHistogram(disp, fn) ((disp)->GetHistogram = fn) -#define CALL_GetHistogramParameterfv(disp, parameters) (*((disp)->GetHistogramParameterfv)) parameters -#define GET_GetHistogramParameterfv(disp) ((disp)->GetHistogramParameterfv) -#define SET_GetHistogramParameterfv(disp, fn) ((disp)->GetHistogramParameterfv = fn) -#define CALL_GetHistogramParameteriv(disp, parameters) (*((disp)->GetHistogramParameteriv)) parameters -#define GET_GetHistogramParameteriv(disp) ((disp)->GetHistogramParameteriv) -#define SET_GetHistogramParameteriv(disp, fn) ((disp)->GetHistogramParameteriv = fn) -#define CALL_GetMinmax(disp, parameters) (*((disp)->GetMinmax)) parameters -#define GET_GetMinmax(disp) ((disp)->GetMinmax) -#define SET_GetMinmax(disp, fn) ((disp)->GetMinmax = fn) -#define CALL_GetMinmaxParameterfv(disp, parameters) (*((disp)->GetMinmaxParameterfv)) parameters -#define GET_GetMinmaxParameterfv(disp) ((disp)->GetMinmaxParameterfv) -#define SET_GetMinmaxParameterfv(disp, fn) ((disp)->GetMinmaxParameterfv = fn) -#define CALL_GetMinmaxParameteriv(disp, parameters) (*((disp)->GetMinmaxParameteriv)) parameters -#define GET_GetMinmaxParameteriv(disp) ((disp)->GetMinmaxParameteriv) -#define SET_GetMinmaxParameteriv(disp, fn) ((disp)->GetMinmaxParameteriv = fn) -#define CALL_Histogram(disp, parameters) (*((disp)->Histogram)) parameters -#define GET_Histogram(disp) ((disp)->Histogram) -#define SET_Histogram(disp, fn) ((disp)->Histogram = fn) -#define CALL_Minmax(disp, parameters) (*((disp)->Minmax)) parameters -#define GET_Minmax(disp) ((disp)->Minmax) -#define SET_Minmax(disp, fn) ((disp)->Minmax = fn) -#define CALL_ResetHistogram(disp, parameters) (*((disp)->ResetHistogram)) parameters -#define GET_ResetHistogram(disp) ((disp)->ResetHistogram) -#define SET_ResetHistogram(disp, fn) ((disp)->ResetHistogram = fn) -#define CALL_ResetMinmax(disp, parameters) (*((disp)->ResetMinmax)) parameters -#define GET_ResetMinmax(disp) ((disp)->ResetMinmax) -#define SET_ResetMinmax(disp, fn) ((disp)->ResetMinmax = fn) -#define CALL_TexImage3D(disp, parameters) (*((disp)->TexImage3D)) parameters -#define GET_TexImage3D(disp) ((disp)->TexImage3D) -#define SET_TexImage3D(disp, fn) ((disp)->TexImage3D = fn) -#define CALL_TexSubImage3D(disp, parameters) (*((disp)->TexSubImage3D)) parameters -#define GET_TexSubImage3D(disp) ((disp)->TexSubImage3D) -#define SET_TexSubImage3D(disp, fn) ((disp)->TexSubImage3D = fn) -#define CALL_CopyTexSubImage3D(disp, parameters) (*((disp)->CopyTexSubImage3D)) parameters -#define GET_CopyTexSubImage3D(disp) ((disp)->CopyTexSubImage3D) -#define SET_CopyTexSubImage3D(disp, fn) ((disp)->CopyTexSubImage3D = fn) -#define CALL_ActiveTextureARB(disp, parameters) (*((disp)->ActiveTextureARB)) parameters -#define GET_ActiveTextureARB(disp) ((disp)->ActiveTextureARB) -#define SET_ActiveTextureARB(disp, fn) ((disp)->ActiveTextureARB = fn) -#define CALL_ClientActiveTextureARB(disp, parameters) (*((disp)->ClientActiveTextureARB)) parameters -#define GET_ClientActiveTextureARB(disp) ((disp)->ClientActiveTextureARB) -#define SET_ClientActiveTextureARB(disp, fn) ((disp)->ClientActiveTextureARB = fn) -#define CALL_MultiTexCoord1dARB(disp, parameters) (*((disp)->MultiTexCoord1dARB)) parameters -#define GET_MultiTexCoord1dARB(disp) ((disp)->MultiTexCoord1dARB) -#define SET_MultiTexCoord1dARB(disp, fn) ((disp)->MultiTexCoord1dARB = fn) -#define CALL_MultiTexCoord1dvARB(disp, parameters) (*((disp)->MultiTexCoord1dvARB)) parameters -#define GET_MultiTexCoord1dvARB(disp) ((disp)->MultiTexCoord1dvARB) -#define SET_MultiTexCoord1dvARB(disp, fn) ((disp)->MultiTexCoord1dvARB = fn) -#define CALL_MultiTexCoord1fARB(disp, parameters) (*((disp)->MultiTexCoord1fARB)) parameters -#define GET_MultiTexCoord1fARB(disp) ((disp)->MultiTexCoord1fARB) -#define SET_MultiTexCoord1fARB(disp, fn) ((disp)->MultiTexCoord1fARB = fn) -#define CALL_MultiTexCoord1fvARB(disp, parameters) (*((disp)->MultiTexCoord1fvARB)) parameters -#define GET_MultiTexCoord1fvARB(disp) ((disp)->MultiTexCoord1fvARB) -#define SET_MultiTexCoord1fvARB(disp, fn) ((disp)->MultiTexCoord1fvARB = fn) -#define CALL_MultiTexCoord1iARB(disp, parameters) (*((disp)->MultiTexCoord1iARB)) parameters -#define GET_MultiTexCoord1iARB(disp) ((disp)->MultiTexCoord1iARB) -#define SET_MultiTexCoord1iARB(disp, fn) ((disp)->MultiTexCoord1iARB = fn) -#define CALL_MultiTexCoord1ivARB(disp, parameters) (*((disp)->MultiTexCoord1ivARB)) parameters -#define GET_MultiTexCoord1ivARB(disp) ((disp)->MultiTexCoord1ivARB) -#define SET_MultiTexCoord1ivARB(disp, fn) ((disp)->MultiTexCoord1ivARB = fn) -#define CALL_MultiTexCoord1sARB(disp, parameters) (*((disp)->MultiTexCoord1sARB)) parameters -#define GET_MultiTexCoord1sARB(disp) ((disp)->MultiTexCoord1sARB) -#define SET_MultiTexCoord1sARB(disp, fn) ((disp)->MultiTexCoord1sARB = fn) -#define CALL_MultiTexCoord1svARB(disp, parameters) (*((disp)->MultiTexCoord1svARB)) parameters -#define GET_MultiTexCoord1svARB(disp) ((disp)->MultiTexCoord1svARB) -#define SET_MultiTexCoord1svARB(disp, fn) ((disp)->MultiTexCoord1svARB = fn) -#define CALL_MultiTexCoord2dARB(disp, parameters) (*((disp)->MultiTexCoord2dARB)) parameters -#define GET_MultiTexCoord2dARB(disp) ((disp)->MultiTexCoord2dARB) -#define SET_MultiTexCoord2dARB(disp, fn) ((disp)->MultiTexCoord2dARB = fn) -#define CALL_MultiTexCoord2dvARB(disp, parameters) (*((disp)->MultiTexCoord2dvARB)) parameters -#define GET_MultiTexCoord2dvARB(disp) ((disp)->MultiTexCoord2dvARB) -#define SET_MultiTexCoord2dvARB(disp, fn) ((disp)->MultiTexCoord2dvARB = fn) -#define CALL_MultiTexCoord2fARB(disp, parameters) (*((disp)->MultiTexCoord2fARB)) parameters -#define GET_MultiTexCoord2fARB(disp) ((disp)->MultiTexCoord2fARB) -#define SET_MultiTexCoord2fARB(disp, fn) ((disp)->MultiTexCoord2fARB = fn) -#define CALL_MultiTexCoord2fvARB(disp, parameters) (*((disp)->MultiTexCoord2fvARB)) parameters -#define GET_MultiTexCoord2fvARB(disp) ((disp)->MultiTexCoord2fvARB) -#define SET_MultiTexCoord2fvARB(disp, fn) ((disp)->MultiTexCoord2fvARB = fn) -#define CALL_MultiTexCoord2iARB(disp, parameters) (*((disp)->MultiTexCoord2iARB)) parameters -#define GET_MultiTexCoord2iARB(disp) ((disp)->MultiTexCoord2iARB) -#define SET_MultiTexCoord2iARB(disp, fn) ((disp)->MultiTexCoord2iARB = fn) -#define CALL_MultiTexCoord2ivARB(disp, parameters) (*((disp)->MultiTexCoord2ivARB)) parameters -#define GET_MultiTexCoord2ivARB(disp) ((disp)->MultiTexCoord2ivARB) -#define SET_MultiTexCoord2ivARB(disp, fn) ((disp)->MultiTexCoord2ivARB = fn) -#define CALL_MultiTexCoord2sARB(disp, parameters) (*((disp)->MultiTexCoord2sARB)) parameters -#define GET_MultiTexCoord2sARB(disp) ((disp)->MultiTexCoord2sARB) -#define SET_MultiTexCoord2sARB(disp, fn) ((disp)->MultiTexCoord2sARB = fn) -#define CALL_MultiTexCoord2svARB(disp, parameters) (*((disp)->MultiTexCoord2svARB)) parameters -#define GET_MultiTexCoord2svARB(disp) ((disp)->MultiTexCoord2svARB) -#define SET_MultiTexCoord2svARB(disp, fn) ((disp)->MultiTexCoord2svARB = fn) -#define CALL_MultiTexCoord3dARB(disp, parameters) (*((disp)->MultiTexCoord3dARB)) parameters -#define GET_MultiTexCoord3dARB(disp) ((disp)->MultiTexCoord3dARB) -#define SET_MultiTexCoord3dARB(disp, fn) ((disp)->MultiTexCoord3dARB = fn) -#define CALL_MultiTexCoord3dvARB(disp, parameters) (*((disp)->MultiTexCoord3dvARB)) parameters -#define GET_MultiTexCoord3dvARB(disp) ((disp)->MultiTexCoord3dvARB) -#define SET_MultiTexCoord3dvARB(disp, fn) ((disp)->MultiTexCoord3dvARB = fn) -#define CALL_MultiTexCoord3fARB(disp, parameters) (*((disp)->MultiTexCoord3fARB)) parameters -#define GET_MultiTexCoord3fARB(disp) ((disp)->MultiTexCoord3fARB) -#define SET_MultiTexCoord3fARB(disp, fn) ((disp)->MultiTexCoord3fARB = fn) -#define CALL_MultiTexCoord3fvARB(disp, parameters) (*((disp)->MultiTexCoord3fvARB)) parameters -#define GET_MultiTexCoord3fvARB(disp) ((disp)->MultiTexCoord3fvARB) -#define SET_MultiTexCoord3fvARB(disp, fn) ((disp)->MultiTexCoord3fvARB = fn) -#define CALL_MultiTexCoord3iARB(disp, parameters) (*((disp)->MultiTexCoord3iARB)) parameters -#define GET_MultiTexCoord3iARB(disp) ((disp)->MultiTexCoord3iARB) -#define SET_MultiTexCoord3iARB(disp, fn) ((disp)->MultiTexCoord3iARB = fn) -#define CALL_MultiTexCoord3ivARB(disp, parameters) (*((disp)->MultiTexCoord3ivARB)) parameters -#define GET_MultiTexCoord3ivARB(disp) ((disp)->MultiTexCoord3ivARB) -#define SET_MultiTexCoord3ivARB(disp, fn) ((disp)->MultiTexCoord3ivARB = fn) -#define CALL_MultiTexCoord3sARB(disp, parameters) (*((disp)->MultiTexCoord3sARB)) parameters -#define GET_MultiTexCoord3sARB(disp) ((disp)->MultiTexCoord3sARB) -#define SET_MultiTexCoord3sARB(disp, fn) ((disp)->MultiTexCoord3sARB = fn) -#define CALL_MultiTexCoord3svARB(disp, parameters) (*((disp)->MultiTexCoord3svARB)) parameters -#define GET_MultiTexCoord3svARB(disp) ((disp)->MultiTexCoord3svARB) -#define SET_MultiTexCoord3svARB(disp, fn) ((disp)->MultiTexCoord3svARB = fn) -#define CALL_MultiTexCoord4dARB(disp, parameters) (*((disp)->MultiTexCoord4dARB)) parameters -#define GET_MultiTexCoord4dARB(disp) ((disp)->MultiTexCoord4dARB) -#define SET_MultiTexCoord4dARB(disp, fn) ((disp)->MultiTexCoord4dARB = fn) -#define CALL_MultiTexCoord4dvARB(disp, parameters) (*((disp)->MultiTexCoord4dvARB)) parameters -#define GET_MultiTexCoord4dvARB(disp) ((disp)->MultiTexCoord4dvARB) -#define SET_MultiTexCoord4dvARB(disp, fn) ((disp)->MultiTexCoord4dvARB = fn) -#define CALL_MultiTexCoord4fARB(disp, parameters) (*((disp)->MultiTexCoord4fARB)) parameters -#define GET_MultiTexCoord4fARB(disp) ((disp)->MultiTexCoord4fARB) -#define SET_MultiTexCoord4fARB(disp, fn) ((disp)->MultiTexCoord4fARB = fn) -#define CALL_MultiTexCoord4fvARB(disp, parameters) (*((disp)->MultiTexCoord4fvARB)) parameters -#define GET_MultiTexCoord4fvARB(disp) ((disp)->MultiTexCoord4fvARB) -#define SET_MultiTexCoord4fvARB(disp, fn) ((disp)->MultiTexCoord4fvARB = fn) -#define CALL_MultiTexCoord4iARB(disp, parameters) (*((disp)->MultiTexCoord4iARB)) parameters -#define GET_MultiTexCoord4iARB(disp) ((disp)->MultiTexCoord4iARB) -#define SET_MultiTexCoord4iARB(disp, fn) ((disp)->MultiTexCoord4iARB = fn) -#define CALL_MultiTexCoord4ivARB(disp, parameters) (*((disp)->MultiTexCoord4ivARB)) parameters -#define GET_MultiTexCoord4ivARB(disp) ((disp)->MultiTexCoord4ivARB) -#define SET_MultiTexCoord4ivARB(disp, fn) ((disp)->MultiTexCoord4ivARB = fn) -#define CALL_MultiTexCoord4sARB(disp, parameters) (*((disp)->MultiTexCoord4sARB)) parameters -#define GET_MultiTexCoord4sARB(disp) ((disp)->MultiTexCoord4sARB) -#define SET_MultiTexCoord4sARB(disp, fn) ((disp)->MultiTexCoord4sARB = fn) -#define CALL_MultiTexCoord4svARB(disp, parameters) (*((disp)->MultiTexCoord4svARB)) parameters -#define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) -#define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) - -#if !defined(IN_DRI_DRIVER) - -#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters -#define GET_AttachShader(disp) ((disp)->AttachShader) -#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn) -#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters -#define GET_CreateProgram(disp) ((disp)->CreateProgram) -#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn) -#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters -#define GET_CreateShader(disp) ((disp)->CreateShader) -#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn) -#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters -#define GET_DeleteProgram(disp) ((disp)->DeleteProgram) -#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn) -#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters -#define GET_DeleteShader(disp) ((disp)->DeleteShader) -#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn) -#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters -#define GET_DetachShader(disp) ((disp)->DetachShader) -#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn) -#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters -#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders) -#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn) -#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters -#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog) -#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn) -#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters -#define GET_GetProgramiv(disp) ((disp)->GetProgramiv) -#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn) -#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters -#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog) -#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn) -#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters -#define GET_GetShaderiv(disp) ((disp)->GetShaderiv) -#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn) -#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters -#define GET_IsProgram(disp) ((disp)->IsProgram) -#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn) -#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters -#define GET_IsShader(disp) ((disp)->IsShader) -#define SET_IsShader(disp, fn) ((disp)->IsShader = fn) -#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters -#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate) -#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn) -#define CALL_StencilMaskSeparate(disp, parameters) (*((disp)->StencilMaskSeparate)) parameters -#define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) -#define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) -#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters -#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate) -#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn) -#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters -#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv) -#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn) -#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters -#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv) -#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn) -#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters -#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv) -#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn) -#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters -#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv) -#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn) -#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters -#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv) -#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn) -#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters -#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv) -#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn) -#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters -#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB) -#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn) -#define CALL_LoadTransposeMatrixfARB(disp, parameters) (*((disp)->LoadTransposeMatrixfARB)) parameters -#define GET_LoadTransposeMatrixfARB(disp) ((disp)->LoadTransposeMatrixfARB) -#define SET_LoadTransposeMatrixfARB(disp, fn) ((disp)->LoadTransposeMatrixfARB = fn) -#define CALL_MultTransposeMatrixdARB(disp, parameters) (*((disp)->MultTransposeMatrixdARB)) parameters -#define GET_MultTransposeMatrixdARB(disp) ((disp)->MultTransposeMatrixdARB) -#define SET_MultTransposeMatrixdARB(disp, fn) ((disp)->MultTransposeMatrixdARB = fn) -#define CALL_MultTransposeMatrixfARB(disp, parameters) (*((disp)->MultTransposeMatrixfARB)) parameters -#define GET_MultTransposeMatrixfARB(disp) ((disp)->MultTransposeMatrixfARB) -#define SET_MultTransposeMatrixfARB(disp, fn) ((disp)->MultTransposeMatrixfARB = fn) -#define CALL_SampleCoverageARB(disp, parameters) (*((disp)->SampleCoverageARB)) parameters -#define GET_SampleCoverageARB(disp) ((disp)->SampleCoverageARB) -#define SET_SampleCoverageARB(disp, fn) ((disp)->SampleCoverageARB = fn) -#define CALL_CompressedTexImage1DARB(disp, parameters) (*((disp)->CompressedTexImage1DARB)) parameters -#define GET_CompressedTexImage1DARB(disp) ((disp)->CompressedTexImage1DARB) -#define SET_CompressedTexImage1DARB(disp, fn) ((disp)->CompressedTexImage1DARB = fn) -#define CALL_CompressedTexImage2DARB(disp, parameters) (*((disp)->CompressedTexImage2DARB)) parameters -#define GET_CompressedTexImage2DARB(disp) ((disp)->CompressedTexImage2DARB) -#define SET_CompressedTexImage2DARB(disp, fn) ((disp)->CompressedTexImage2DARB = fn) -#define CALL_CompressedTexImage3DARB(disp, parameters) (*((disp)->CompressedTexImage3DARB)) parameters -#define GET_CompressedTexImage3DARB(disp) ((disp)->CompressedTexImage3DARB) -#define SET_CompressedTexImage3DARB(disp, fn) ((disp)->CompressedTexImage3DARB = fn) -#define CALL_CompressedTexSubImage1DARB(disp, parameters) (*((disp)->CompressedTexSubImage1DARB)) parameters -#define GET_CompressedTexSubImage1DARB(disp) ((disp)->CompressedTexSubImage1DARB) -#define SET_CompressedTexSubImage1DARB(disp, fn) ((disp)->CompressedTexSubImage1DARB = fn) -#define CALL_CompressedTexSubImage2DARB(disp, parameters) (*((disp)->CompressedTexSubImage2DARB)) parameters -#define GET_CompressedTexSubImage2DARB(disp) ((disp)->CompressedTexSubImage2DARB) -#define SET_CompressedTexSubImage2DARB(disp, fn) ((disp)->CompressedTexSubImage2DARB = fn) -#define CALL_CompressedTexSubImage3DARB(disp, parameters) (*((disp)->CompressedTexSubImage3DARB)) parameters -#define GET_CompressedTexSubImage3DARB(disp) ((disp)->CompressedTexSubImage3DARB) -#define SET_CompressedTexSubImage3DARB(disp, fn) ((disp)->CompressedTexSubImage3DARB = fn) -#define CALL_GetCompressedTexImageARB(disp, parameters) (*((disp)->GetCompressedTexImageARB)) parameters -#define GET_GetCompressedTexImageARB(disp) ((disp)->GetCompressedTexImageARB) -#define SET_GetCompressedTexImageARB(disp, fn) ((disp)->GetCompressedTexImageARB = fn) -#define CALL_DisableVertexAttribArrayARB(disp, parameters) (*((disp)->DisableVertexAttribArrayARB)) parameters -#define GET_DisableVertexAttribArrayARB(disp) ((disp)->DisableVertexAttribArrayARB) -#define SET_DisableVertexAttribArrayARB(disp, fn) ((disp)->DisableVertexAttribArrayARB = fn) -#define CALL_EnableVertexAttribArrayARB(disp, parameters) (*((disp)->EnableVertexAttribArrayARB)) parameters -#define GET_EnableVertexAttribArrayARB(disp) ((disp)->EnableVertexAttribArrayARB) -#define SET_EnableVertexAttribArrayARB(disp, fn) ((disp)->EnableVertexAttribArrayARB = fn) -#define CALL_GetProgramEnvParameterdvARB(disp, parameters) (*((disp)->GetProgramEnvParameterdvARB)) parameters -#define GET_GetProgramEnvParameterdvARB(disp) ((disp)->GetProgramEnvParameterdvARB) -#define SET_GetProgramEnvParameterdvARB(disp, fn) ((disp)->GetProgramEnvParameterdvARB = fn) -#define CALL_GetProgramEnvParameterfvARB(disp, parameters) (*((disp)->GetProgramEnvParameterfvARB)) parameters -#define GET_GetProgramEnvParameterfvARB(disp) ((disp)->GetProgramEnvParameterfvARB) -#define SET_GetProgramEnvParameterfvARB(disp, fn) ((disp)->GetProgramEnvParameterfvARB = fn) -#define CALL_GetProgramLocalParameterdvARB(disp, parameters) (*((disp)->GetProgramLocalParameterdvARB)) parameters -#define GET_GetProgramLocalParameterdvARB(disp) ((disp)->GetProgramLocalParameterdvARB) -#define SET_GetProgramLocalParameterdvARB(disp, fn) ((disp)->GetProgramLocalParameterdvARB = fn) -#define CALL_GetProgramLocalParameterfvARB(disp, parameters) (*((disp)->GetProgramLocalParameterfvARB)) parameters -#define GET_GetProgramLocalParameterfvARB(disp) ((disp)->GetProgramLocalParameterfvARB) -#define SET_GetProgramLocalParameterfvARB(disp, fn) ((disp)->GetProgramLocalParameterfvARB = fn) -#define CALL_GetProgramStringARB(disp, parameters) (*((disp)->GetProgramStringARB)) parameters -#define GET_GetProgramStringARB(disp) ((disp)->GetProgramStringARB) -#define SET_GetProgramStringARB(disp, fn) ((disp)->GetProgramStringARB = fn) -#define CALL_GetProgramivARB(disp, parameters) (*((disp)->GetProgramivARB)) parameters -#define GET_GetProgramivARB(disp) ((disp)->GetProgramivARB) -#define SET_GetProgramivARB(disp, fn) ((disp)->GetProgramivARB = fn) -#define CALL_GetVertexAttribdvARB(disp, parameters) (*((disp)->GetVertexAttribdvARB)) parameters -#define GET_GetVertexAttribdvARB(disp) ((disp)->GetVertexAttribdvARB) -#define SET_GetVertexAttribdvARB(disp, fn) ((disp)->GetVertexAttribdvARB = fn) -#define CALL_GetVertexAttribfvARB(disp, parameters) (*((disp)->GetVertexAttribfvARB)) parameters -#define GET_GetVertexAttribfvARB(disp) ((disp)->GetVertexAttribfvARB) -#define SET_GetVertexAttribfvARB(disp, fn) ((disp)->GetVertexAttribfvARB = fn) -#define CALL_GetVertexAttribivARB(disp, parameters) (*((disp)->GetVertexAttribivARB)) parameters -#define GET_GetVertexAttribivARB(disp) ((disp)->GetVertexAttribivARB) -#define SET_GetVertexAttribivARB(disp, fn) ((disp)->GetVertexAttribivARB = fn) -#define CALL_ProgramEnvParameter4dARB(disp, parameters) (*((disp)->ProgramEnvParameter4dARB)) parameters -#define GET_ProgramEnvParameter4dARB(disp) ((disp)->ProgramEnvParameter4dARB) -#define SET_ProgramEnvParameter4dARB(disp, fn) ((disp)->ProgramEnvParameter4dARB = fn) -#define CALL_ProgramEnvParameter4dvARB(disp, parameters) (*((disp)->ProgramEnvParameter4dvARB)) parameters -#define GET_ProgramEnvParameter4dvARB(disp) ((disp)->ProgramEnvParameter4dvARB) -#define SET_ProgramEnvParameter4dvARB(disp, fn) ((disp)->ProgramEnvParameter4dvARB = fn) -#define CALL_ProgramEnvParameter4fARB(disp, parameters) (*((disp)->ProgramEnvParameter4fARB)) parameters -#define GET_ProgramEnvParameter4fARB(disp) ((disp)->ProgramEnvParameter4fARB) -#define SET_ProgramEnvParameter4fARB(disp, fn) ((disp)->ProgramEnvParameter4fARB = fn) -#define CALL_ProgramEnvParameter4fvARB(disp, parameters) (*((disp)->ProgramEnvParameter4fvARB)) parameters -#define GET_ProgramEnvParameter4fvARB(disp) ((disp)->ProgramEnvParameter4fvARB) -#define SET_ProgramEnvParameter4fvARB(disp, fn) ((disp)->ProgramEnvParameter4fvARB = fn) -#define CALL_ProgramLocalParameter4dARB(disp, parameters) (*((disp)->ProgramLocalParameter4dARB)) parameters -#define GET_ProgramLocalParameter4dARB(disp) ((disp)->ProgramLocalParameter4dARB) -#define SET_ProgramLocalParameter4dARB(disp, fn) ((disp)->ProgramLocalParameter4dARB = fn) -#define CALL_ProgramLocalParameter4dvARB(disp, parameters) (*((disp)->ProgramLocalParameter4dvARB)) parameters -#define GET_ProgramLocalParameter4dvARB(disp) ((disp)->ProgramLocalParameter4dvARB) -#define SET_ProgramLocalParameter4dvARB(disp, fn) ((disp)->ProgramLocalParameter4dvARB = fn) -#define CALL_ProgramLocalParameter4fARB(disp, parameters) (*((disp)->ProgramLocalParameter4fARB)) parameters -#define GET_ProgramLocalParameter4fARB(disp) ((disp)->ProgramLocalParameter4fARB) -#define SET_ProgramLocalParameter4fARB(disp, fn) ((disp)->ProgramLocalParameter4fARB = fn) -#define CALL_ProgramLocalParameter4fvARB(disp, parameters) (*((disp)->ProgramLocalParameter4fvARB)) parameters -#define GET_ProgramLocalParameter4fvARB(disp) ((disp)->ProgramLocalParameter4fvARB) -#define SET_ProgramLocalParameter4fvARB(disp, fn) ((disp)->ProgramLocalParameter4fvARB = fn) -#define CALL_ProgramStringARB(disp, parameters) (*((disp)->ProgramStringARB)) parameters -#define GET_ProgramStringARB(disp) ((disp)->ProgramStringARB) -#define SET_ProgramStringARB(disp, fn) ((disp)->ProgramStringARB = fn) -#define CALL_VertexAttrib1dARB(disp, parameters) (*((disp)->VertexAttrib1dARB)) parameters -#define GET_VertexAttrib1dARB(disp) ((disp)->VertexAttrib1dARB) -#define SET_VertexAttrib1dARB(disp, fn) ((disp)->VertexAttrib1dARB = fn) -#define CALL_VertexAttrib1dvARB(disp, parameters) (*((disp)->VertexAttrib1dvARB)) parameters -#define GET_VertexAttrib1dvARB(disp) ((disp)->VertexAttrib1dvARB) -#define SET_VertexAttrib1dvARB(disp, fn) ((disp)->VertexAttrib1dvARB = fn) -#define CALL_VertexAttrib1fARB(disp, parameters) (*((disp)->VertexAttrib1fARB)) parameters -#define GET_VertexAttrib1fARB(disp) ((disp)->VertexAttrib1fARB) -#define SET_VertexAttrib1fARB(disp, fn) ((disp)->VertexAttrib1fARB = fn) -#define CALL_VertexAttrib1fvARB(disp, parameters) (*((disp)->VertexAttrib1fvARB)) parameters -#define GET_VertexAttrib1fvARB(disp) ((disp)->VertexAttrib1fvARB) -#define SET_VertexAttrib1fvARB(disp, fn) ((disp)->VertexAttrib1fvARB = fn) -#define CALL_VertexAttrib1sARB(disp, parameters) (*((disp)->VertexAttrib1sARB)) parameters -#define GET_VertexAttrib1sARB(disp) ((disp)->VertexAttrib1sARB) -#define SET_VertexAttrib1sARB(disp, fn) ((disp)->VertexAttrib1sARB = fn) -#define CALL_VertexAttrib1svARB(disp, parameters) (*((disp)->VertexAttrib1svARB)) parameters -#define GET_VertexAttrib1svARB(disp) ((disp)->VertexAttrib1svARB) -#define SET_VertexAttrib1svARB(disp, fn) ((disp)->VertexAttrib1svARB = fn) -#define CALL_VertexAttrib2dARB(disp, parameters) (*((disp)->VertexAttrib2dARB)) parameters -#define GET_VertexAttrib2dARB(disp) ((disp)->VertexAttrib2dARB) -#define SET_VertexAttrib2dARB(disp, fn) ((disp)->VertexAttrib2dARB = fn) -#define CALL_VertexAttrib2dvARB(disp, parameters) (*((disp)->VertexAttrib2dvARB)) parameters -#define GET_VertexAttrib2dvARB(disp) ((disp)->VertexAttrib2dvARB) -#define SET_VertexAttrib2dvARB(disp, fn) ((disp)->VertexAttrib2dvARB = fn) -#define CALL_VertexAttrib2fARB(disp, parameters) (*((disp)->VertexAttrib2fARB)) parameters -#define GET_VertexAttrib2fARB(disp) ((disp)->VertexAttrib2fARB) -#define SET_VertexAttrib2fARB(disp, fn) ((disp)->VertexAttrib2fARB = fn) -#define CALL_VertexAttrib2fvARB(disp, parameters) (*((disp)->VertexAttrib2fvARB)) parameters -#define GET_VertexAttrib2fvARB(disp) ((disp)->VertexAttrib2fvARB) -#define SET_VertexAttrib2fvARB(disp, fn) ((disp)->VertexAttrib2fvARB = fn) -#define CALL_VertexAttrib2sARB(disp, parameters) (*((disp)->VertexAttrib2sARB)) parameters -#define GET_VertexAttrib2sARB(disp) ((disp)->VertexAttrib2sARB) -#define SET_VertexAttrib2sARB(disp, fn) ((disp)->VertexAttrib2sARB = fn) -#define CALL_VertexAttrib2svARB(disp, parameters) (*((disp)->VertexAttrib2svARB)) parameters -#define GET_VertexAttrib2svARB(disp) ((disp)->VertexAttrib2svARB) -#define SET_VertexAttrib2svARB(disp, fn) ((disp)->VertexAttrib2svARB = fn) -#define CALL_VertexAttrib3dARB(disp, parameters) (*((disp)->VertexAttrib3dARB)) parameters -#define GET_VertexAttrib3dARB(disp) ((disp)->VertexAttrib3dARB) -#define SET_VertexAttrib3dARB(disp, fn) ((disp)->VertexAttrib3dARB = fn) -#define CALL_VertexAttrib3dvARB(disp, parameters) (*((disp)->VertexAttrib3dvARB)) parameters -#define GET_VertexAttrib3dvARB(disp) ((disp)->VertexAttrib3dvARB) -#define SET_VertexAttrib3dvARB(disp, fn) ((disp)->VertexAttrib3dvARB = fn) -#define CALL_VertexAttrib3fARB(disp, parameters) (*((disp)->VertexAttrib3fARB)) parameters -#define GET_VertexAttrib3fARB(disp) ((disp)->VertexAttrib3fARB) -#define SET_VertexAttrib3fARB(disp, fn) ((disp)->VertexAttrib3fARB = fn) -#define CALL_VertexAttrib3fvARB(disp, parameters) (*((disp)->VertexAttrib3fvARB)) parameters -#define GET_VertexAttrib3fvARB(disp) ((disp)->VertexAttrib3fvARB) -#define SET_VertexAttrib3fvARB(disp, fn) ((disp)->VertexAttrib3fvARB = fn) -#define CALL_VertexAttrib3sARB(disp, parameters) (*((disp)->VertexAttrib3sARB)) parameters -#define GET_VertexAttrib3sARB(disp) ((disp)->VertexAttrib3sARB) -#define SET_VertexAttrib3sARB(disp, fn) ((disp)->VertexAttrib3sARB = fn) -#define CALL_VertexAttrib3svARB(disp, parameters) (*((disp)->VertexAttrib3svARB)) parameters -#define GET_VertexAttrib3svARB(disp) ((disp)->VertexAttrib3svARB) -#define SET_VertexAttrib3svARB(disp, fn) ((disp)->VertexAttrib3svARB = fn) -#define CALL_VertexAttrib4NbvARB(disp, parameters) (*((disp)->VertexAttrib4NbvARB)) parameters -#define GET_VertexAttrib4NbvARB(disp) ((disp)->VertexAttrib4NbvARB) -#define SET_VertexAttrib4NbvARB(disp, fn) ((disp)->VertexAttrib4NbvARB = fn) -#define CALL_VertexAttrib4NivARB(disp, parameters) (*((disp)->VertexAttrib4NivARB)) parameters -#define GET_VertexAttrib4NivARB(disp) ((disp)->VertexAttrib4NivARB) -#define SET_VertexAttrib4NivARB(disp, fn) ((disp)->VertexAttrib4NivARB = fn) -#define CALL_VertexAttrib4NsvARB(disp, parameters) (*((disp)->VertexAttrib4NsvARB)) parameters -#define GET_VertexAttrib4NsvARB(disp) ((disp)->VertexAttrib4NsvARB) -#define SET_VertexAttrib4NsvARB(disp, fn) ((disp)->VertexAttrib4NsvARB = fn) -#define CALL_VertexAttrib4NubARB(disp, parameters) (*((disp)->VertexAttrib4NubARB)) parameters -#define GET_VertexAttrib4NubARB(disp) ((disp)->VertexAttrib4NubARB) -#define SET_VertexAttrib4NubARB(disp, fn) ((disp)->VertexAttrib4NubARB = fn) -#define CALL_VertexAttrib4NubvARB(disp, parameters) (*((disp)->VertexAttrib4NubvARB)) parameters -#define GET_VertexAttrib4NubvARB(disp) ((disp)->VertexAttrib4NubvARB) -#define SET_VertexAttrib4NubvARB(disp, fn) ((disp)->VertexAttrib4NubvARB = fn) -#define CALL_VertexAttrib4NuivARB(disp, parameters) (*((disp)->VertexAttrib4NuivARB)) parameters -#define GET_VertexAttrib4NuivARB(disp) ((disp)->VertexAttrib4NuivARB) -#define SET_VertexAttrib4NuivARB(disp, fn) ((disp)->VertexAttrib4NuivARB = fn) -#define CALL_VertexAttrib4NusvARB(disp, parameters) (*((disp)->VertexAttrib4NusvARB)) parameters -#define GET_VertexAttrib4NusvARB(disp) ((disp)->VertexAttrib4NusvARB) -#define SET_VertexAttrib4NusvARB(disp, fn) ((disp)->VertexAttrib4NusvARB = fn) -#define CALL_VertexAttrib4bvARB(disp, parameters) (*((disp)->VertexAttrib4bvARB)) parameters -#define GET_VertexAttrib4bvARB(disp) ((disp)->VertexAttrib4bvARB) -#define SET_VertexAttrib4bvARB(disp, fn) ((disp)->VertexAttrib4bvARB = fn) -#define CALL_VertexAttrib4dARB(disp, parameters) (*((disp)->VertexAttrib4dARB)) parameters -#define GET_VertexAttrib4dARB(disp) ((disp)->VertexAttrib4dARB) -#define SET_VertexAttrib4dARB(disp, fn) ((disp)->VertexAttrib4dARB = fn) -#define CALL_VertexAttrib4dvARB(disp, parameters) (*((disp)->VertexAttrib4dvARB)) parameters -#define GET_VertexAttrib4dvARB(disp) ((disp)->VertexAttrib4dvARB) -#define SET_VertexAttrib4dvARB(disp, fn) ((disp)->VertexAttrib4dvARB = fn) -#define CALL_VertexAttrib4fARB(disp, parameters) (*((disp)->VertexAttrib4fARB)) parameters -#define GET_VertexAttrib4fARB(disp) ((disp)->VertexAttrib4fARB) -#define SET_VertexAttrib4fARB(disp, fn) ((disp)->VertexAttrib4fARB = fn) -#define CALL_VertexAttrib4fvARB(disp, parameters) (*((disp)->VertexAttrib4fvARB)) parameters -#define GET_VertexAttrib4fvARB(disp) ((disp)->VertexAttrib4fvARB) -#define SET_VertexAttrib4fvARB(disp, fn) ((disp)->VertexAttrib4fvARB = fn) -#define CALL_VertexAttrib4ivARB(disp, parameters) (*((disp)->VertexAttrib4ivARB)) parameters -#define GET_VertexAttrib4ivARB(disp) ((disp)->VertexAttrib4ivARB) -#define SET_VertexAttrib4ivARB(disp, fn) ((disp)->VertexAttrib4ivARB = fn) -#define CALL_VertexAttrib4sARB(disp, parameters) (*((disp)->VertexAttrib4sARB)) parameters -#define GET_VertexAttrib4sARB(disp) ((disp)->VertexAttrib4sARB) -#define SET_VertexAttrib4sARB(disp, fn) ((disp)->VertexAttrib4sARB = fn) -#define CALL_VertexAttrib4svARB(disp, parameters) (*((disp)->VertexAttrib4svARB)) parameters -#define GET_VertexAttrib4svARB(disp) ((disp)->VertexAttrib4svARB) -#define SET_VertexAttrib4svARB(disp, fn) ((disp)->VertexAttrib4svARB = fn) -#define CALL_VertexAttrib4ubvARB(disp, parameters) (*((disp)->VertexAttrib4ubvARB)) parameters -#define GET_VertexAttrib4ubvARB(disp) ((disp)->VertexAttrib4ubvARB) -#define SET_VertexAttrib4ubvARB(disp, fn) ((disp)->VertexAttrib4ubvARB = fn) -#define CALL_VertexAttrib4uivARB(disp, parameters) (*((disp)->VertexAttrib4uivARB)) parameters -#define GET_VertexAttrib4uivARB(disp) ((disp)->VertexAttrib4uivARB) -#define SET_VertexAttrib4uivARB(disp, fn) ((disp)->VertexAttrib4uivARB = fn) -#define CALL_VertexAttrib4usvARB(disp, parameters) (*((disp)->VertexAttrib4usvARB)) parameters -#define GET_VertexAttrib4usvARB(disp) ((disp)->VertexAttrib4usvARB) -#define SET_VertexAttrib4usvARB(disp, fn) ((disp)->VertexAttrib4usvARB = fn) -#define CALL_VertexAttribPointerARB(disp, parameters) (*((disp)->VertexAttribPointerARB)) parameters -#define GET_VertexAttribPointerARB(disp) ((disp)->VertexAttribPointerARB) -#define SET_VertexAttribPointerARB(disp, fn) ((disp)->VertexAttribPointerARB = fn) -#define CALL_BindBufferARB(disp, parameters) (*((disp)->BindBufferARB)) parameters -#define GET_BindBufferARB(disp) ((disp)->BindBufferARB) -#define SET_BindBufferARB(disp, fn) ((disp)->BindBufferARB = fn) -#define CALL_BufferDataARB(disp, parameters) (*((disp)->BufferDataARB)) parameters -#define GET_BufferDataARB(disp) ((disp)->BufferDataARB) -#define SET_BufferDataARB(disp, fn) ((disp)->BufferDataARB = fn) -#define CALL_BufferSubDataARB(disp, parameters) (*((disp)->BufferSubDataARB)) parameters -#define GET_BufferSubDataARB(disp) ((disp)->BufferSubDataARB) -#define SET_BufferSubDataARB(disp, fn) ((disp)->BufferSubDataARB = fn) -#define CALL_DeleteBuffersARB(disp, parameters) (*((disp)->DeleteBuffersARB)) parameters -#define GET_DeleteBuffersARB(disp) ((disp)->DeleteBuffersARB) -#define SET_DeleteBuffersARB(disp, fn) ((disp)->DeleteBuffersARB = fn) -#define CALL_GenBuffersARB(disp, parameters) (*((disp)->GenBuffersARB)) parameters -#define GET_GenBuffersARB(disp) ((disp)->GenBuffersARB) -#define SET_GenBuffersARB(disp, fn) ((disp)->GenBuffersARB = fn) -#define CALL_GetBufferParameterivARB(disp, parameters) (*((disp)->GetBufferParameterivARB)) parameters -#define GET_GetBufferParameterivARB(disp) ((disp)->GetBufferParameterivARB) -#define SET_GetBufferParameterivARB(disp, fn) ((disp)->GetBufferParameterivARB = fn) -#define CALL_GetBufferPointervARB(disp, parameters) (*((disp)->GetBufferPointervARB)) parameters -#define GET_GetBufferPointervARB(disp) ((disp)->GetBufferPointervARB) -#define SET_GetBufferPointervARB(disp, fn) ((disp)->GetBufferPointervARB = fn) -#define CALL_GetBufferSubDataARB(disp, parameters) (*((disp)->GetBufferSubDataARB)) parameters -#define GET_GetBufferSubDataARB(disp) ((disp)->GetBufferSubDataARB) -#define SET_GetBufferSubDataARB(disp, fn) ((disp)->GetBufferSubDataARB = fn) -#define CALL_IsBufferARB(disp, parameters) (*((disp)->IsBufferARB)) parameters -#define GET_IsBufferARB(disp) ((disp)->IsBufferARB) -#define SET_IsBufferARB(disp, fn) ((disp)->IsBufferARB = fn) -#define CALL_MapBufferARB(disp, parameters) (*((disp)->MapBufferARB)) parameters -#define GET_MapBufferARB(disp) ((disp)->MapBufferARB) -#define SET_MapBufferARB(disp, fn) ((disp)->MapBufferARB = fn) -#define CALL_UnmapBufferARB(disp, parameters) (*((disp)->UnmapBufferARB)) parameters -#define GET_UnmapBufferARB(disp) ((disp)->UnmapBufferARB) -#define SET_UnmapBufferARB(disp, fn) ((disp)->UnmapBufferARB = fn) -#define CALL_BeginQueryARB(disp, parameters) (*((disp)->BeginQueryARB)) parameters -#define GET_BeginQueryARB(disp) ((disp)->BeginQueryARB) -#define SET_BeginQueryARB(disp, fn) ((disp)->BeginQueryARB = fn) -#define CALL_DeleteQueriesARB(disp, parameters) (*((disp)->DeleteQueriesARB)) parameters -#define GET_DeleteQueriesARB(disp) ((disp)->DeleteQueriesARB) -#define SET_DeleteQueriesARB(disp, fn) ((disp)->DeleteQueriesARB = fn) -#define CALL_EndQueryARB(disp, parameters) (*((disp)->EndQueryARB)) parameters -#define GET_EndQueryARB(disp) ((disp)->EndQueryARB) -#define SET_EndQueryARB(disp, fn) ((disp)->EndQueryARB = fn) -#define CALL_GenQueriesARB(disp, parameters) (*((disp)->GenQueriesARB)) parameters -#define GET_GenQueriesARB(disp) ((disp)->GenQueriesARB) -#define SET_GenQueriesARB(disp, fn) ((disp)->GenQueriesARB = fn) -#define CALL_GetQueryObjectivARB(disp, parameters) (*((disp)->GetQueryObjectivARB)) parameters -#define GET_GetQueryObjectivARB(disp) ((disp)->GetQueryObjectivARB) -#define SET_GetQueryObjectivARB(disp, fn) ((disp)->GetQueryObjectivARB = fn) -#define CALL_GetQueryObjectuivARB(disp, parameters) (*((disp)->GetQueryObjectuivARB)) parameters -#define GET_GetQueryObjectuivARB(disp) ((disp)->GetQueryObjectuivARB) -#define SET_GetQueryObjectuivARB(disp, fn) ((disp)->GetQueryObjectuivARB = fn) -#define CALL_GetQueryivARB(disp, parameters) (*((disp)->GetQueryivARB)) parameters -#define GET_GetQueryivARB(disp) ((disp)->GetQueryivARB) -#define SET_GetQueryivARB(disp, fn) ((disp)->GetQueryivARB = fn) -#define CALL_IsQueryARB(disp, parameters) (*((disp)->IsQueryARB)) parameters -#define GET_IsQueryARB(disp) ((disp)->IsQueryARB) -#define SET_IsQueryARB(disp, fn) ((disp)->IsQueryARB = fn) -#define CALL_AttachObjectARB(disp, parameters) (*((disp)->AttachObjectARB)) parameters -#define GET_AttachObjectARB(disp) ((disp)->AttachObjectARB) -#define SET_AttachObjectARB(disp, fn) ((disp)->AttachObjectARB = fn) -#define CALL_CompileShaderARB(disp, parameters) (*((disp)->CompileShaderARB)) parameters -#define GET_CompileShaderARB(disp) ((disp)->CompileShaderARB) -#define SET_CompileShaderARB(disp, fn) ((disp)->CompileShaderARB = fn) -#define CALL_CreateProgramObjectARB(disp, parameters) (*((disp)->CreateProgramObjectARB)) parameters -#define GET_CreateProgramObjectARB(disp) ((disp)->CreateProgramObjectARB) -#define SET_CreateProgramObjectARB(disp, fn) ((disp)->CreateProgramObjectARB = fn) -#define CALL_CreateShaderObjectARB(disp, parameters) (*((disp)->CreateShaderObjectARB)) parameters -#define GET_CreateShaderObjectARB(disp) ((disp)->CreateShaderObjectARB) -#define SET_CreateShaderObjectARB(disp, fn) ((disp)->CreateShaderObjectARB = fn) -#define CALL_DeleteObjectARB(disp, parameters) (*((disp)->DeleteObjectARB)) parameters -#define GET_DeleteObjectARB(disp) ((disp)->DeleteObjectARB) -#define SET_DeleteObjectARB(disp, fn) ((disp)->DeleteObjectARB = fn) -#define CALL_DetachObjectARB(disp, parameters) (*((disp)->DetachObjectARB)) parameters -#define GET_DetachObjectARB(disp) ((disp)->DetachObjectARB) -#define SET_DetachObjectARB(disp, fn) ((disp)->DetachObjectARB = fn) -#define CALL_GetActiveUniformARB(disp, parameters) (*((disp)->GetActiveUniformARB)) parameters -#define GET_GetActiveUniformARB(disp) ((disp)->GetActiveUniformARB) -#define SET_GetActiveUniformARB(disp, fn) ((disp)->GetActiveUniformARB = fn) -#define CALL_GetAttachedObjectsARB(disp, parameters) (*((disp)->GetAttachedObjectsARB)) parameters -#define GET_GetAttachedObjectsARB(disp) ((disp)->GetAttachedObjectsARB) -#define SET_GetAttachedObjectsARB(disp, fn) ((disp)->GetAttachedObjectsARB = fn) -#define CALL_GetHandleARB(disp, parameters) (*((disp)->GetHandleARB)) parameters -#define GET_GetHandleARB(disp) ((disp)->GetHandleARB) -#define SET_GetHandleARB(disp, fn) ((disp)->GetHandleARB = fn) -#define CALL_GetInfoLogARB(disp, parameters) (*((disp)->GetInfoLogARB)) parameters -#define GET_GetInfoLogARB(disp) ((disp)->GetInfoLogARB) -#define SET_GetInfoLogARB(disp, fn) ((disp)->GetInfoLogARB = fn) -#define CALL_GetObjectParameterfvARB(disp, parameters) (*((disp)->GetObjectParameterfvARB)) parameters -#define GET_GetObjectParameterfvARB(disp) ((disp)->GetObjectParameterfvARB) -#define SET_GetObjectParameterfvARB(disp, fn) ((disp)->GetObjectParameterfvARB = fn) -#define CALL_GetObjectParameterivARB(disp, parameters) (*((disp)->GetObjectParameterivARB)) parameters -#define GET_GetObjectParameterivARB(disp) ((disp)->GetObjectParameterivARB) -#define SET_GetObjectParameterivARB(disp, fn) ((disp)->GetObjectParameterivARB = fn) -#define CALL_GetShaderSourceARB(disp, parameters) (*((disp)->GetShaderSourceARB)) parameters -#define GET_GetShaderSourceARB(disp) ((disp)->GetShaderSourceARB) -#define SET_GetShaderSourceARB(disp, fn) ((disp)->GetShaderSourceARB = fn) -#define CALL_GetUniformLocationARB(disp, parameters) (*((disp)->GetUniformLocationARB)) parameters -#define GET_GetUniformLocationARB(disp) ((disp)->GetUniformLocationARB) -#define SET_GetUniformLocationARB(disp, fn) ((disp)->GetUniformLocationARB = fn) -#define CALL_GetUniformfvARB(disp, parameters) (*((disp)->GetUniformfvARB)) parameters -#define GET_GetUniformfvARB(disp) ((disp)->GetUniformfvARB) -#define SET_GetUniformfvARB(disp, fn) ((disp)->GetUniformfvARB = fn) -#define CALL_GetUniformivARB(disp, parameters) (*((disp)->GetUniformivARB)) parameters -#define GET_GetUniformivARB(disp) ((disp)->GetUniformivARB) -#define SET_GetUniformivARB(disp, fn) ((disp)->GetUniformivARB = fn) -#define CALL_LinkProgramARB(disp, parameters) (*((disp)->LinkProgramARB)) parameters -#define GET_LinkProgramARB(disp) ((disp)->LinkProgramARB) -#define SET_LinkProgramARB(disp, fn) ((disp)->LinkProgramARB = fn) -#define CALL_ShaderSourceARB(disp, parameters) (*((disp)->ShaderSourceARB)) parameters -#define GET_ShaderSourceARB(disp) ((disp)->ShaderSourceARB) -#define SET_ShaderSourceARB(disp, fn) ((disp)->ShaderSourceARB = fn) -#define CALL_Uniform1fARB(disp, parameters) (*((disp)->Uniform1fARB)) parameters -#define GET_Uniform1fARB(disp) ((disp)->Uniform1fARB) -#define SET_Uniform1fARB(disp, fn) ((disp)->Uniform1fARB = fn) -#define CALL_Uniform1fvARB(disp, parameters) (*((disp)->Uniform1fvARB)) parameters -#define GET_Uniform1fvARB(disp) ((disp)->Uniform1fvARB) -#define SET_Uniform1fvARB(disp, fn) ((disp)->Uniform1fvARB = fn) -#define CALL_Uniform1iARB(disp, parameters) (*((disp)->Uniform1iARB)) parameters -#define GET_Uniform1iARB(disp) ((disp)->Uniform1iARB) -#define SET_Uniform1iARB(disp, fn) ((disp)->Uniform1iARB = fn) -#define CALL_Uniform1ivARB(disp, parameters) (*((disp)->Uniform1ivARB)) parameters -#define GET_Uniform1ivARB(disp) ((disp)->Uniform1ivARB) -#define SET_Uniform1ivARB(disp, fn) ((disp)->Uniform1ivARB = fn) -#define CALL_Uniform2fARB(disp, parameters) (*((disp)->Uniform2fARB)) parameters -#define GET_Uniform2fARB(disp) ((disp)->Uniform2fARB) -#define SET_Uniform2fARB(disp, fn) ((disp)->Uniform2fARB = fn) -#define CALL_Uniform2fvARB(disp, parameters) (*((disp)->Uniform2fvARB)) parameters -#define GET_Uniform2fvARB(disp) ((disp)->Uniform2fvARB) -#define SET_Uniform2fvARB(disp, fn) ((disp)->Uniform2fvARB = fn) -#define CALL_Uniform2iARB(disp, parameters) (*((disp)->Uniform2iARB)) parameters -#define GET_Uniform2iARB(disp) ((disp)->Uniform2iARB) -#define SET_Uniform2iARB(disp, fn) ((disp)->Uniform2iARB = fn) -#define CALL_Uniform2ivARB(disp, parameters) (*((disp)->Uniform2ivARB)) parameters -#define GET_Uniform2ivARB(disp) ((disp)->Uniform2ivARB) -#define SET_Uniform2ivARB(disp, fn) ((disp)->Uniform2ivARB = fn) -#define CALL_Uniform3fARB(disp, parameters) (*((disp)->Uniform3fARB)) parameters -#define GET_Uniform3fARB(disp) ((disp)->Uniform3fARB) -#define SET_Uniform3fARB(disp, fn) ((disp)->Uniform3fARB = fn) -#define CALL_Uniform3fvARB(disp, parameters) (*((disp)->Uniform3fvARB)) parameters -#define GET_Uniform3fvARB(disp) ((disp)->Uniform3fvARB) -#define SET_Uniform3fvARB(disp, fn) ((disp)->Uniform3fvARB = fn) -#define CALL_Uniform3iARB(disp, parameters) (*((disp)->Uniform3iARB)) parameters -#define GET_Uniform3iARB(disp) ((disp)->Uniform3iARB) -#define SET_Uniform3iARB(disp, fn) ((disp)->Uniform3iARB = fn) -#define CALL_Uniform3ivARB(disp, parameters) (*((disp)->Uniform3ivARB)) parameters -#define GET_Uniform3ivARB(disp) ((disp)->Uniform3ivARB) -#define SET_Uniform3ivARB(disp, fn) ((disp)->Uniform3ivARB = fn) -#define CALL_Uniform4fARB(disp, parameters) (*((disp)->Uniform4fARB)) parameters -#define GET_Uniform4fARB(disp) ((disp)->Uniform4fARB) -#define SET_Uniform4fARB(disp, fn) ((disp)->Uniform4fARB = fn) -#define CALL_Uniform4fvARB(disp, parameters) (*((disp)->Uniform4fvARB)) parameters -#define GET_Uniform4fvARB(disp) ((disp)->Uniform4fvARB) -#define SET_Uniform4fvARB(disp, fn) ((disp)->Uniform4fvARB = fn) -#define CALL_Uniform4iARB(disp, parameters) (*((disp)->Uniform4iARB)) parameters -#define GET_Uniform4iARB(disp) ((disp)->Uniform4iARB) -#define SET_Uniform4iARB(disp, fn) ((disp)->Uniform4iARB = fn) -#define CALL_Uniform4ivARB(disp, parameters) (*((disp)->Uniform4ivARB)) parameters -#define GET_Uniform4ivARB(disp) ((disp)->Uniform4ivARB) -#define SET_Uniform4ivARB(disp, fn) ((disp)->Uniform4ivARB = fn) -#define CALL_UniformMatrix2fvARB(disp, parameters) (*((disp)->UniformMatrix2fvARB)) parameters -#define GET_UniformMatrix2fvARB(disp) ((disp)->UniformMatrix2fvARB) -#define SET_UniformMatrix2fvARB(disp, fn) ((disp)->UniformMatrix2fvARB = fn) -#define CALL_UniformMatrix3fvARB(disp, parameters) (*((disp)->UniformMatrix3fvARB)) parameters -#define GET_UniformMatrix3fvARB(disp) ((disp)->UniformMatrix3fvARB) -#define SET_UniformMatrix3fvARB(disp, fn) ((disp)->UniformMatrix3fvARB = fn) -#define CALL_UniformMatrix4fvARB(disp, parameters) (*((disp)->UniformMatrix4fvARB)) parameters -#define GET_UniformMatrix4fvARB(disp) ((disp)->UniformMatrix4fvARB) -#define SET_UniformMatrix4fvARB(disp, fn) ((disp)->UniformMatrix4fvARB = fn) -#define CALL_UseProgramObjectARB(disp, parameters) (*((disp)->UseProgramObjectARB)) parameters -#define GET_UseProgramObjectARB(disp) ((disp)->UseProgramObjectARB) -#define SET_UseProgramObjectARB(disp, fn) ((disp)->UseProgramObjectARB = fn) -#define CALL_ValidateProgramARB(disp, parameters) (*((disp)->ValidateProgramARB)) parameters -#define GET_ValidateProgramARB(disp) ((disp)->ValidateProgramARB) -#define SET_ValidateProgramARB(disp, fn) ((disp)->ValidateProgramARB = fn) -#define CALL_BindAttribLocationARB(disp, parameters) (*((disp)->BindAttribLocationARB)) parameters -#define GET_BindAttribLocationARB(disp) ((disp)->BindAttribLocationARB) -#define SET_BindAttribLocationARB(disp, fn) ((disp)->BindAttribLocationARB = fn) -#define CALL_GetActiveAttribARB(disp, parameters) (*((disp)->GetActiveAttribARB)) parameters -#define GET_GetActiveAttribARB(disp) ((disp)->GetActiveAttribARB) -#define SET_GetActiveAttribARB(disp, fn) ((disp)->GetActiveAttribARB = fn) -#define CALL_GetAttribLocationARB(disp, parameters) (*((disp)->GetAttribLocationARB)) parameters -#define GET_GetAttribLocationARB(disp) ((disp)->GetAttribLocationARB) -#define SET_GetAttribLocationARB(disp, fn) ((disp)->GetAttribLocationARB = fn) -#define CALL_DrawBuffersARB(disp, parameters) (*((disp)->DrawBuffersARB)) parameters -#define GET_DrawBuffersARB(disp) ((disp)->DrawBuffersARB) -#define SET_DrawBuffersARB(disp, fn) ((disp)->DrawBuffersARB = fn) -#define CALL_RenderbufferStorageMultisample(disp, parameters) (*((disp)->RenderbufferStorageMultisample)) parameters -#define GET_RenderbufferStorageMultisample(disp) ((disp)->RenderbufferStorageMultisample) -#define SET_RenderbufferStorageMultisample(disp, fn) ((disp)->RenderbufferStorageMultisample = fn) -#define CALL_FlushMappedBufferRange(disp, parameters) (*((disp)->FlushMappedBufferRange)) parameters -#define GET_FlushMappedBufferRange(disp) ((disp)->FlushMappedBufferRange) -#define SET_FlushMappedBufferRange(disp, fn) ((disp)->FlushMappedBufferRange = fn) -#define CALL_MapBufferRange(disp, parameters) (*((disp)->MapBufferRange)) parameters -#define GET_MapBufferRange(disp) ((disp)->MapBufferRange) -#define SET_MapBufferRange(disp, fn) ((disp)->MapBufferRange = fn) -#define CALL_BindVertexArray(disp, parameters) (*((disp)->BindVertexArray)) parameters -#define GET_BindVertexArray(disp) ((disp)->BindVertexArray) -#define SET_BindVertexArray(disp, fn) ((disp)->BindVertexArray = fn) -#define CALL_GenVertexArrays(disp, parameters) (*((disp)->GenVertexArrays)) parameters -#define GET_GenVertexArrays(disp) ((disp)->GenVertexArrays) -#define SET_GenVertexArrays(disp, fn) ((disp)->GenVertexArrays = fn) -#define CALL_CopyBufferSubData(disp, parameters) (*((disp)->CopyBufferSubData)) parameters -#define GET_CopyBufferSubData(disp) ((disp)->CopyBufferSubData) -#define SET_CopyBufferSubData(disp, fn) ((disp)->CopyBufferSubData = fn) -#define CALL_ClientWaitSync(disp, parameters) (*((disp)->ClientWaitSync)) parameters -#define GET_ClientWaitSync(disp) ((disp)->ClientWaitSync) -#define SET_ClientWaitSync(disp, fn) ((disp)->ClientWaitSync = fn) -#define CALL_DeleteSync(disp, parameters) (*((disp)->DeleteSync)) parameters -#define GET_DeleteSync(disp) ((disp)->DeleteSync) -#define SET_DeleteSync(disp, fn) ((disp)->DeleteSync = fn) -#define CALL_FenceSync(disp, parameters) (*((disp)->FenceSync)) parameters -#define GET_FenceSync(disp) ((disp)->FenceSync) -#define SET_FenceSync(disp, fn) ((disp)->FenceSync = fn) -#define CALL_GetInteger64v(disp, parameters) (*((disp)->GetInteger64v)) parameters -#define GET_GetInteger64v(disp) ((disp)->GetInteger64v) -#define SET_GetInteger64v(disp, fn) ((disp)->GetInteger64v = fn) -#define CALL_GetSynciv(disp, parameters) (*((disp)->GetSynciv)) parameters -#define GET_GetSynciv(disp) ((disp)->GetSynciv) -#define SET_GetSynciv(disp, fn) ((disp)->GetSynciv = fn) -#define CALL_IsSync(disp, parameters) (*((disp)->IsSync)) parameters -#define GET_IsSync(disp) ((disp)->IsSync) -#define SET_IsSync(disp, fn) ((disp)->IsSync = fn) -#define CALL_WaitSync(disp, parameters) (*((disp)->WaitSync)) parameters -#define GET_WaitSync(disp) ((disp)->WaitSync) -#define SET_WaitSync(disp, fn) ((disp)->WaitSync = fn) -#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters -#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) -#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) -#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters -#define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS) -#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn) -#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterivSGIS)) parameters -#define GET_GetPixelTexGenParameterivSGIS(disp) ((disp)->GetPixelTexGenParameterivSGIS) -#define SET_GetPixelTexGenParameterivSGIS(disp, fn) ((disp)->GetPixelTexGenParameterivSGIS = fn) -#define CALL_PixelTexGenParameterfSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfSGIS)) parameters -#define GET_PixelTexGenParameterfSGIS(disp) ((disp)->PixelTexGenParameterfSGIS) -#define SET_PixelTexGenParameterfSGIS(disp, fn) ((disp)->PixelTexGenParameterfSGIS = fn) -#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfvSGIS)) parameters -#define GET_PixelTexGenParameterfvSGIS(disp) ((disp)->PixelTexGenParameterfvSGIS) -#define SET_PixelTexGenParameterfvSGIS(disp, fn) ((disp)->PixelTexGenParameterfvSGIS = fn) -#define CALL_PixelTexGenParameteriSGIS(disp, parameters) (*((disp)->PixelTexGenParameteriSGIS)) parameters -#define GET_PixelTexGenParameteriSGIS(disp) ((disp)->PixelTexGenParameteriSGIS) -#define SET_PixelTexGenParameteriSGIS(disp, fn) ((disp)->PixelTexGenParameteriSGIS = fn) -#define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters -#define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS) -#define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn) -#define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters -#define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS) -#define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn) -#define CALL_SamplePatternSGIS(disp, parameters) (*((disp)->SamplePatternSGIS)) parameters -#define GET_SamplePatternSGIS(disp) ((disp)->SamplePatternSGIS) -#define SET_SamplePatternSGIS(disp, fn) ((disp)->SamplePatternSGIS = fn) -#define CALL_ColorPointerEXT(disp, parameters) (*((disp)->ColorPointerEXT)) parameters -#define GET_ColorPointerEXT(disp) ((disp)->ColorPointerEXT) -#define SET_ColorPointerEXT(disp, fn) ((disp)->ColorPointerEXT = fn) -#define CALL_EdgeFlagPointerEXT(disp, parameters) (*((disp)->EdgeFlagPointerEXT)) parameters -#define GET_EdgeFlagPointerEXT(disp) ((disp)->EdgeFlagPointerEXT) -#define SET_EdgeFlagPointerEXT(disp, fn) ((disp)->EdgeFlagPointerEXT = fn) -#define CALL_IndexPointerEXT(disp, parameters) (*((disp)->IndexPointerEXT)) parameters -#define GET_IndexPointerEXT(disp) ((disp)->IndexPointerEXT) -#define SET_IndexPointerEXT(disp, fn) ((disp)->IndexPointerEXT = fn) -#define CALL_NormalPointerEXT(disp, parameters) (*((disp)->NormalPointerEXT)) parameters -#define GET_NormalPointerEXT(disp) ((disp)->NormalPointerEXT) -#define SET_NormalPointerEXT(disp, fn) ((disp)->NormalPointerEXT = fn) -#define CALL_TexCoordPointerEXT(disp, parameters) (*((disp)->TexCoordPointerEXT)) parameters -#define GET_TexCoordPointerEXT(disp) ((disp)->TexCoordPointerEXT) -#define SET_TexCoordPointerEXT(disp, fn) ((disp)->TexCoordPointerEXT = fn) -#define CALL_VertexPointerEXT(disp, parameters) (*((disp)->VertexPointerEXT)) parameters -#define GET_VertexPointerEXT(disp) ((disp)->VertexPointerEXT) -#define SET_VertexPointerEXT(disp, fn) ((disp)->VertexPointerEXT = fn) -#define CALL_PointParameterfEXT(disp, parameters) (*((disp)->PointParameterfEXT)) parameters -#define GET_PointParameterfEXT(disp) ((disp)->PointParameterfEXT) -#define SET_PointParameterfEXT(disp, fn) ((disp)->PointParameterfEXT = fn) -#define CALL_PointParameterfvEXT(disp, parameters) (*((disp)->PointParameterfvEXT)) parameters -#define GET_PointParameterfvEXT(disp) ((disp)->PointParameterfvEXT) -#define SET_PointParameterfvEXT(disp, fn) ((disp)->PointParameterfvEXT = fn) -#define CALL_LockArraysEXT(disp, parameters) (*((disp)->LockArraysEXT)) parameters -#define GET_LockArraysEXT(disp) ((disp)->LockArraysEXT) -#define SET_LockArraysEXT(disp, fn) ((disp)->LockArraysEXT = fn) -#define CALL_UnlockArraysEXT(disp, parameters) (*((disp)->UnlockArraysEXT)) parameters -#define GET_UnlockArraysEXT(disp) ((disp)->UnlockArraysEXT) -#define SET_UnlockArraysEXT(disp, fn) ((disp)->UnlockArraysEXT = fn) -#define CALL_CullParameterdvEXT(disp, parameters) (*((disp)->CullParameterdvEXT)) parameters -#define GET_CullParameterdvEXT(disp) ((disp)->CullParameterdvEXT) -#define SET_CullParameterdvEXT(disp, fn) ((disp)->CullParameterdvEXT = fn) -#define CALL_CullParameterfvEXT(disp, parameters) (*((disp)->CullParameterfvEXT)) parameters -#define GET_CullParameterfvEXT(disp) ((disp)->CullParameterfvEXT) -#define SET_CullParameterfvEXT(disp, fn) ((disp)->CullParameterfvEXT = fn) -#define CALL_SecondaryColor3bEXT(disp, parameters) (*((disp)->SecondaryColor3bEXT)) parameters -#define GET_SecondaryColor3bEXT(disp) ((disp)->SecondaryColor3bEXT) -#define SET_SecondaryColor3bEXT(disp, fn) ((disp)->SecondaryColor3bEXT = fn) -#define CALL_SecondaryColor3bvEXT(disp, parameters) (*((disp)->SecondaryColor3bvEXT)) parameters -#define GET_SecondaryColor3bvEXT(disp) ((disp)->SecondaryColor3bvEXT) -#define SET_SecondaryColor3bvEXT(disp, fn) ((disp)->SecondaryColor3bvEXT = fn) -#define CALL_SecondaryColor3dEXT(disp, parameters) (*((disp)->SecondaryColor3dEXT)) parameters -#define GET_SecondaryColor3dEXT(disp) ((disp)->SecondaryColor3dEXT) -#define SET_SecondaryColor3dEXT(disp, fn) ((disp)->SecondaryColor3dEXT = fn) -#define CALL_SecondaryColor3dvEXT(disp, parameters) (*((disp)->SecondaryColor3dvEXT)) parameters -#define GET_SecondaryColor3dvEXT(disp) ((disp)->SecondaryColor3dvEXT) -#define SET_SecondaryColor3dvEXT(disp, fn) ((disp)->SecondaryColor3dvEXT = fn) -#define CALL_SecondaryColor3fEXT(disp, parameters) (*((disp)->SecondaryColor3fEXT)) parameters -#define GET_SecondaryColor3fEXT(disp) ((disp)->SecondaryColor3fEXT) -#define SET_SecondaryColor3fEXT(disp, fn) ((disp)->SecondaryColor3fEXT = fn) -#define CALL_SecondaryColor3fvEXT(disp, parameters) (*((disp)->SecondaryColor3fvEXT)) parameters -#define GET_SecondaryColor3fvEXT(disp) ((disp)->SecondaryColor3fvEXT) -#define SET_SecondaryColor3fvEXT(disp, fn) ((disp)->SecondaryColor3fvEXT = fn) -#define CALL_SecondaryColor3iEXT(disp, parameters) (*((disp)->SecondaryColor3iEXT)) parameters -#define GET_SecondaryColor3iEXT(disp) ((disp)->SecondaryColor3iEXT) -#define SET_SecondaryColor3iEXT(disp, fn) ((disp)->SecondaryColor3iEXT = fn) -#define CALL_SecondaryColor3ivEXT(disp, parameters) (*((disp)->SecondaryColor3ivEXT)) parameters -#define GET_SecondaryColor3ivEXT(disp) ((disp)->SecondaryColor3ivEXT) -#define SET_SecondaryColor3ivEXT(disp, fn) ((disp)->SecondaryColor3ivEXT = fn) -#define CALL_SecondaryColor3sEXT(disp, parameters) (*((disp)->SecondaryColor3sEXT)) parameters -#define GET_SecondaryColor3sEXT(disp) ((disp)->SecondaryColor3sEXT) -#define SET_SecondaryColor3sEXT(disp, fn) ((disp)->SecondaryColor3sEXT = fn) -#define CALL_SecondaryColor3svEXT(disp, parameters) (*((disp)->SecondaryColor3svEXT)) parameters -#define GET_SecondaryColor3svEXT(disp) ((disp)->SecondaryColor3svEXT) -#define SET_SecondaryColor3svEXT(disp, fn) ((disp)->SecondaryColor3svEXT = fn) -#define CALL_SecondaryColor3ubEXT(disp, parameters) (*((disp)->SecondaryColor3ubEXT)) parameters -#define GET_SecondaryColor3ubEXT(disp) ((disp)->SecondaryColor3ubEXT) -#define SET_SecondaryColor3ubEXT(disp, fn) ((disp)->SecondaryColor3ubEXT = fn) -#define CALL_SecondaryColor3ubvEXT(disp, parameters) (*((disp)->SecondaryColor3ubvEXT)) parameters -#define GET_SecondaryColor3ubvEXT(disp) ((disp)->SecondaryColor3ubvEXT) -#define SET_SecondaryColor3ubvEXT(disp, fn) ((disp)->SecondaryColor3ubvEXT = fn) -#define CALL_SecondaryColor3uiEXT(disp, parameters) (*((disp)->SecondaryColor3uiEXT)) parameters -#define GET_SecondaryColor3uiEXT(disp) ((disp)->SecondaryColor3uiEXT) -#define SET_SecondaryColor3uiEXT(disp, fn) ((disp)->SecondaryColor3uiEXT = fn) -#define CALL_SecondaryColor3uivEXT(disp, parameters) (*((disp)->SecondaryColor3uivEXT)) parameters -#define GET_SecondaryColor3uivEXT(disp) ((disp)->SecondaryColor3uivEXT) -#define SET_SecondaryColor3uivEXT(disp, fn) ((disp)->SecondaryColor3uivEXT = fn) -#define CALL_SecondaryColor3usEXT(disp, parameters) (*((disp)->SecondaryColor3usEXT)) parameters -#define GET_SecondaryColor3usEXT(disp) ((disp)->SecondaryColor3usEXT) -#define SET_SecondaryColor3usEXT(disp, fn) ((disp)->SecondaryColor3usEXT = fn) -#define CALL_SecondaryColor3usvEXT(disp, parameters) (*((disp)->SecondaryColor3usvEXT)) parameters -#define GET_SecondaryColor3usvEXT(disp) ((disp)->SecondaryColor3usvEXT) -#define SET_SecondaryColor3usvEXT(disp, fn) ((disp)->SecondaryColor3usvEXT = fn) -#define CALL_SecondaryColorPointerEXT(disp, parameters) (*((disp)->SecondaryColorPointerEXT)) parameters -#define GET_SecondaryColorPointerEXT(disp) ((disp)->SecondaryColorPointerEXT) -#define SET_SecondaryColorPointerEXT(disp, fn) ((disp)->SecondaryColorPointerEXT = fn) -#define CALL_MultiDrawArraysEXT(disp, parameters) (*((disp)->MultiDrawArraysEXT)) parameters -#define GET_MultiDrawArraysEXT(disp) ((disp)->MultiDrawArraysEXT) -#define SET_MultiDrawArraysEXT(disp, fn) ((disp)->MultiDrawArraysEXT = fn) -#define CALL_MultiDrawElementsEXT(disp, parameters) (*((disp)->MultiDrawElementsEXT)) parameters -#define GET_MultiDrawElementsEXT(disp) ((disp)->MultiDrawElementsEXT) -#define SET_MultiDrawElementsEXT(disp, fn) ((disp)->MultiDrawElementsEXT = fn) -#define CALL_FogCoordPointerEXT(disp, parameters) (*((disp)->FogCoordPointerEXT)) parameters -#define GET_FogCoordPointerEXT(disp) ((disp)->FogCoordPointerEXT) -#define SET_FogCoordPointerEXT(disp, fn) ((disp)->FogCoordPointerEXT = fn) -#define CALL_FogCoorddEXT(disp, parameters) (*((disp)->FogCoorddEXT)) parameters -#define GET_FogCoorddEXT(disp) ((disp)->FogCoorddEXT) -#define SET_FogCoorddEXT(disp, fn) ((disp)->FogCoorddEXT = fn) -#define CALL_FogCoorddvEXT(disp, parameters) (*((disp)->FogCoorddvEXT)) parameters -#define GET_FogCoorddvEXT(disp) ((disp)->FogCoorddvEXT) -#define SET_FogCoorddvEXT(disp, fn) ((disp)->FogCoorddvEXT = fn) -#define CALL_FogCoordfEXT(disp, parameters) (*((disp)->FogCoordfEXT)) parameters -#define GET_FogCoordfEXT(disp) ((disp)->FogCoordfEXT) -#define SET_FogCoordfEXT(disp, fn) ((disp)->FogCoordfEXT = fn) -#define CALL_FogCoordfvEXT(disp, parameters) (*((disp)->FogCoordfvEXT)) parameters -#define GET_FogCoordfvEXT(disp) ((disp)->FogCoordfvEXT) -#define SET_FogCoordfvEXT(disp, fn) ((disp)->FogCoordfvEXT = fn) -#define CALL_PixelTexGenSGIX(disp, parameters) (*((disp)->PixelTexGenSGIX)) parameters -#define GET_PixelTexGenSGIX(disp) ((disp)->PixelTexGenSGIX) -#define SET_PixelTexGenSGIX(disp, fn) ((disp)->PixelTexGenSGIX = fn) -#define CALL_BlendFuncSeparateEXT(disp, parameters) (*((disp)->BlendFuncSeparateEXT)) parameters -#define GET_BlendFuncSeparateEXT(disp) ((disp)->BlendFuncSeparateEXT) -#define SET_BlendFuncSeparateEXT(disp, fn) ((disp)->BlendFuncSeparateEXT = fn) -#define CALL_FlushVertexArrayRangeNV(disp, parameters) (*((disp)->FlushVertexArrayRangeNV)) parameters -#define GET_FlushVertexArrayRangeNV(disp) ((disp)->FlushVertexArrayRangeNV) -#define SET_FlushVertexArrayRangeNV(disp, fn) ((disp)->FlushVertexArrayRangeNV = fn) -#define CALL_VertexArrayRangeNV(disp, parameters) (*((disp)->VertexArrayRangeNV)) parameters -#define GET_VertexArrayRangeNV(disp) ((disp)->VertexArrayRangeNV) -#define SET_VertexArrayRangeNV(disp, fn) ((disp)->VertexArrayRangeNV = fn) -#define CALL_CombinerInputNV(disp, parameters) (*((disp)->CombinerInputNV)) parameters -#define GET_CombinerInputNV(disp) ((disp)->CombinerInputNV) -#define SET_CombinerInputNV(disp, fn) ((disp)->CombinerInputNV = fn) -#define CALL_CombinerOutputNV(disp, parameters) (*((disp)->CombinerOutputNV)) parameters -#define GET_CombinerOutputNV(disp) ((disp)->CombinerOutputNV) -#define SET_CombinerOutputNV(disp, fn) ((disp)->CombinerOutputNV = fn) -#define CALL_CombinerParameterfNV(disp, parameters) (*((disp)->CombinerParameterfNV)) parameters -#define GET_CombinerParameterfNV(disp) ((disp)->CombinerParameterfNV) -#define SET_CombinerParameterfNV(disp, fn) ((disp)->CombinerParameterfNV = fn) -#define CALL_CombinerParameterfvNV(disp, parameters) (*((disp)->CombinerParameterfvNV)) parameters -#define GET_CombinerParameterfvNV(disp) ((disp)->CombinerParameterfvNV) -#define SET_CombinerParameterfvNV(disp, fn) ((disp)->CombinerParameterfvNV = fn) -#define CALL_CombinerParameteriNV(disp, parameters) (*((disp)->CombinerParameteriNV)) parameters -#define GET_CombinerParameteriNV(disp) ((disp)->CombinerParameteriNV) -#define SET_CombinerParameteriNV(disp, fn) ((disp)->CombinerParameteriNV = fn) -#define CALL_CombinerParameterivNV(disp, parameters) (*((disp)->CombinerParameterivNV)) parameters -#define GET_CombinerParameterivNV(disp) ((disp)->CombinerParameterivNV) -#define SET_CombinerParameterivNV(disp, fn) ((disp)->CombinerParameterivNV = fn) -#define CALL_FinalCombinerInputNV(disp, parameters) (*((disp)->FinalCombinerInputNV)) parameters -#define GET_FinalCombinerInputNV(disp) ((disp)->FinalCombinerInputNV) -#define SET_FinalCombinerInputNV(disp, fn) ((disp)->FinalCombinerInputNV = fn) -#define CALL_GetCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetCombinerInputParameterfvNV)) parameters -#define GET_GetCombinerInputParameterfvNV(disp) ((disp)->GetCombinerInputParameterfvNV) -#define SET_GetCombinerInputParameterfvNV(disp, fn) ((disp)->GetCombinerInputParameterfvNV = fn) -#define CALL_GetCombinerInputParameterivNV(disp, parameters) (*((disp)->GetCombinerInputParameterivNV)) parameters -#define GET_GetCombinerInputParameterivNV(disp) ((disp)->GetCombinerInputParameterivNV) -#define SET_GetCombinerInputParameterivNV(disp, fn) ((disp)->GetCombinerInputParameterivNV = fn) -#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) (*((disp)->GetCombinerOutputParameterfvNV)) parameters -#define GET_GetCombinerOutputParameterfvNV(disp) ((disp)->GetCombinerOutputParameterfvNV) -#define SET_GetCombinerOutputParameterfvNV(disp, fn) ((disp)->GetCombinerOutputParameterfvNV = fn) -#define CALL_GetCombinerOutputParameterivNV(disp, parameters) (*((disp)->GetCombinerOutputParameterivNV)) parameters -#define GET_GetCombinerOutputParameterivNV(disp) ((disp)->GetCombinerOutputParameterivNV) -#define SET_GetCombinerOutputParameterivNV(disp, fn) ((disp)->GetCombinerOutputParameterivNV = fn) -#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterfvNV)) parameters -#define GET_GetFinalCombinerInputParameterfvNV(disp) ((disp)->GetFinalCombinerInputParameterfvNV) -#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) ((disp)->GetFinalCombinerInputParameterfvNV = fn) -#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterivNV)) parameters -#define GET_GetFinalCombinerInputParameterivNV(disp) ((disp)->GetFinalCombinerInputParameterivNV) -#define SET_GetFinalCombinerInputParameterivNV(disp, fn) ((disp)->GetFinalCombinerInputParameterivNV = fn) -#define CALL_ResizeBuffersMESA(disp, parameters) (*((disp)->ResizeBuffersMESA)) parameters -#define GET_ResizeBuffersMESA(disp) ((disp)->ResizeBuffersMESA) -#define SET_ResizeBuffersMESA(disp, fn) ((disp)->ResizeBuffersMESA = fn) -#define CALL_WindowPos2dMESA(disp, parameters) (*((disp)->WindowPos2dMESA)) parameters -#define GET_WindowPos2dMESA(disp) ((disp)->WindowPos2dMESA) -#define SET_WindowPos2dMESA(disp, fn) ((disp)->WindowPos2dMESA = fn) -#define CALL_WindowPos2dvMESA(disp, parameters) (*((disp)->WindowPos2dvMESA)) parameters -#define GET_WindowPos2dvMESA(disp) ((disp)->WindowPos2dvMESA) -#define SET_WindowPos2dvMESA(disp, fn) ((disp)->WindowPos2dvMESA = fn) -#define CALL_WindowPos2fMESA(disp, parameters) (*((disp)->WindowPos2fMESA)) parameters -#define GET_WindowPos2fMESA(disp) ((disp)->WindowPos2fMESA) -#define SET_WindowPos2fMESA(disp, fn) ((disp)->WindowPos2fMESA = fn) -#define CALL_WindowPos2fvMESA(disp, parameters) (*((disp)->WindowPos2fvMESA)) parameters -#define GET_WindowPos2fvMESA(disp) ((disp)->WindowPos2fvMESA) -#define SET_WindowPos2fvMESA(disp, fn) ((disp)->WindowPos2fvMESA = fn) -#define CALL_WindowPos2iMESA(disp, parameters) (*((disp)->WindowPos2iMESA)) parameters -#define GET_WindowPos2iMESA(disp) ((disp)->WindowPos2iMESA) -#define SET_WindowPos2iMESA(disp, fn) ((disp)->WindowPos2iMESA = fn) -#define CALL_WindowPos2ivMESA(disp, parameters) (*((disp)->WindowPos2ivMESA)) parameters -#define GET_WindowPos2ivMESA(disp) ((disp)->WindowPos2ivMESA) -#define SET_WindowPos2ivMESA(disp, fn) ((disp)->WindowPos2ivMESA = fn) -#define CALL_WindowPos2sMESA(disp, parameters) (*((disp)->WindowPos2sMESA)) parameters -#define GET_WindowPos2sMESA(disp) ((disp)->WindowPos2sMESA) -#define SET_WindowPos2sMESA(disp, fn) ((disp)->WindowPos2sMESA = fn) -#define CALL_WindowPos2svMESA(disp, parameters) (*((disp)->WindowPos2svMESA)) parameters -#define GET_WindowPos2svMESA(disp) ((disp)->WindowPos2svMESA) -#define SET_WindowPos2svMESA(disp, fn) ((disp)->WindowPos2svMESA = fn) -#define CALL_WindowPos3dMESA(disp, parameters) (*((disp)->WindowPos3dMESA)) parameters -#define GET_WindowPos3dMESA(disp) ((disp)->WindowPos3dMESA) -#define SET_WindowPos3dMESA(disp, fn) ((disp)->WindowPos3dMESA = fn) -#define CALL_WindowPos3dvMESA(disp, parameters) (*((disp)->WindowPos3dvMESA)) parameters -#define GET_WindowPos3dvMESA(disp) ((disp)->WindowPos3dvMESA) -#define SET_WindowPos3dvMESA(disp, fn) ((disp)->WindowPos3dvMESA = fn) -#define CALL_WindowPos3fMESA(disp, parameters) (*((disp)->WindowPos3fMESA)) parameters -#define GET_WindowPos3fMESA(disp) ((disp)->WindowPos3fMESA) -#define SET_WindowPos3fMESA(disp, fn) ((disp)->WindowPos3fMESA = fn) -#define CALL_WindowPos3fvMESA(disp, parameters) (*((disp)->WindowPos3fvMESA)) parameters -#define GET_WindowPos3fvMESA(disp) ((disp)->WindowPos3fvMESA) -#define SET_WindowPos3fvMESA(disp, fn) ((disp)->WindowPos3fvMESA = fn) -#define CALL_WindowPos3iMESA(disp, parameters) (*((disp)->WindowPos3iMESA)) parameters -#define GET_WindowPos3iMESA(disp) ((disp)->WindowPos3iMESA) -#define SET_WindowPos3iMESA(disp, fn) ((disp)->WindowPos3iMESA = fn) -#define CALL_WindowPos3ivMESA(disp, parameters) (*((disp)->WindowPos3ivMESA)) parameters -#define GET_WindowPos3ivMESA(disp) ((disp)->WindowPos3ivMESA) -#define SET_WindowPos3ivMESA(disp, fn) ((disp)->WindowPos3ivMESA = fn) -#define CALL_WindowPos3sMESA(disp, parameters) (*((disp)->WindowPos3sMESA)) parameters -#define GET_WindowPos3sMESA(disp) ((disp)->WindowPos3sMESA) -#define SET_WindowPos3sMESA(disp, fn) ((disp)->WindowPos3sMESA = fn) -#define CALL_WindowPos3svMESA(disp, parameters) (*((disp)->WindowPos3svMESA)) parameters -#define GET_WindowPos3svMESA(disp) ((disp)->WindowPos3svMESA) -#define SET_WindowPos3svMESA(disp, fn) ((disp)->WindowPos3svMESA = fn) -#define CALL_WindowPos4dMESA(disp, parameters) (*((disp)->WindowPos4dMESA)) parameters -#define GET_WindowPos4dMESA(disp) ((disp)->WindowPos4dMESA) -#define SET_WindowPos4dMESA(disp, fn) ((disp)->WindowPos4dMESA = fn) -#define CALL_WindowPos4dvMESA(disp, parameters) (*((disp)->WindowPos4dvMESA)) parameters -#define GET_WindowPos4dvMESA(disp) ((disp)->WindowPos4dvMESA) -#define SET_WindowPos4dvMESA(disp, fn) ((disp)->WindowPos4dvMESA = fn) -#define CALL_WindowPos4fMESA(disp, parameters) (*((disp)->WindowPos4fMESA)) parameters -#define GET_WindowPos4fMESA(disp) ((disp)->WindowPos4fMESA) -#define SET_WindowPos4fMESA(disp, fn) ((disp)->WindowPos4fMESA = fn) -#define CALL_WindowPos4fvMESA(disp, parameters) (*((disp)->WindowPos4fvMESA)) parameters -#define GET_WindowPos4fvMESA(disp) ((disp)->WindowPos4fvMESA) -#define SET_WindowPos4fvMESA(disp, fn) ((disp)->WindowPos4fvMESA = fn) -#define CALL_WindowPos4iMESA(disp, parameters) (*((disp)->WindowPos4iMESA)) parameters -#define GET_WindowPos4iMESA(disp) ((disp)->WindowPos4iMESA) -#define SET_WindowPos4iMESA(disp, fn) ((disp)->WindowPos4iMESA = fn) -#define CALL_WindowPos4ivMESA(disp, parameters) (*((disp)->WindowPos4ivMESA)) parameters -#define GET_WindowPos4ivMESA(disp) ((disp)->WindowPos4ivMESA) -#define SET_WindowPos4ivMESA(disp, fn) ((disp)->WindowPos4ivMESA = fn) -#define CALL_WindowPos4sMESA(disp, parameters) (*((disp)->WindowPos4sMESA)) parameters -#define GET_WindowPos4sMESA(disp) ((disp)->WindowPos4sMESA) -#define SET_WindowPos4sMESA(disp, fn) ((disp)->WindowPos4sMESA = fn) -#define CALL_WindowPos4svMESA(disp, parameters) (*((disp)->WindowPos4svMESA)) parameters -#define GET_WindowPos4svMESA(disp) ((disp)->WindowPos4svMESA) -#define SET_WindowPos4svMESA(disp, fn) ((disp)->WindowPos4svMESA = fn) -#define CALL_MultiModeDrawArraysIBM(disp, parameters) (*((disp)->MultiModeDrawArraysIBM)) parameters -#define GET_MultiModeDrawArraysIBM(disp) ((disp)->MultiModeDrawArraysIBM) -#define SET_MultiModeDrawArraysIBM(disp, fn) ((disp)->MultiModeDrawArraysIBM = fn) -#define CALL_MultiModeDrawElementsIBM(disp, parameters) (*((disp)->MultiModeDrawElementsIBM)) parameters -#define GET_MultiModeDrawElementsIBM(disp) ((disp)->MultiModeDrawElementsIBM) -#define SET_MultiModeDrawElementsIBM(disp, fn) ((disp)->MultiModeDrawElementsIBM = fn) -#define CALL_DeleteFencesNV(disp, parameters) (*((disp)->DeleteFencesNV)) parameters -#define GET_DeleteFencesNV(disp) ((disp)->DeleteFencesNV) -#define SET_DeleteFencesNV(disp, fn) ((disp)->DeleteFencesNV = fn) -#define CALL_FinishFenceNV(disp, parameters) (*((disp)->FinishFenceNV)) parameters -#define GET_FinishFenceNV(disp) ((disp)->FinishFenceNV) -#define SET_FinishFenceNV(disp, fn) ((disp)->FinishFenceNV = fn) -#define CALL_GenFencesNV(disp, parameters) (*((disp)->GenFencesNV)) parameters -#define GET_GenFencesNV(disp) ((disp)->GenFencesNV) -#define SET_GenFencesNV(disp, fn) ((disp)->GenFencesNV = fn) -#define CALL_GetFenceivNV(disp, parameters) (*((disp)->GetFenceivNV)) parameters -#define GET_GetFenceivNV(disp) ((disp)->GetFenceivNV) -#define SET_GetFenceivNV(disp, fn) ((disp)->GetFenceivNV = fn) -#define CALL_IsFenceNV(disp, parameters) (*((disp)->IsFenceNV)) parameters -#define GET_IsFenceNV(disp) ((disp)->IsFenceNV) -#define SET_IsFenceNV(disp, fn) ((disp)->IsFenceNV = fn) -#define CALL_SetFenceNV(disp, parameters) (*((disp)->SetFenceNV)) parameters -#define GET_SetFenceNV(disp) ((disp)->SetFenceNV) -#define SET_SetFenceNV(disp, fn) ((disp)->SetFenceNV = fn) -#define CALL_TestFenceNV(disp, parameters) (*((disp)->TestFenceNV)) parameters -#define GET_TestFenceNV(disp) ((disp)->TestFenceNV) -#define SET_TestFenceNV(disp, fn) ((disp)->TestFenceNV = fn) -#define CALL_AreProgramsResidentNV(disp, parameters) (*((disp)->AreProgramsResidentNV)) parameters -#define GET_AreProgramsResidentNV(disp) ((disp)->AreProgramsResidentNV) -#define SET_AreProgramsResidentNV(disp, fn) ((disp)->AreProgramsResidentNV = fn) -#define CALL_BindProgramNV(disp, parameters) (*((disp)->BindProgramNV)) parameters -#define GET_BindProgramNV(disp) ((disp)->BindProgramNV) -#define SET_BindProgramNV(disp, fn) ((disp)->BindProgramNV = fn) -#define CALL_DeleteProgramsNV(disp, parameters) (*((disp)->DeleteProgramsNV)) parameters -#define GET_DeleteProgramsNV(disp) ((disp)->DeleteProgramsNV) -#define SET_DeleteProgramsNV(disp, fn) ((disp)->DeleteProgramsNV = fn) -#define CALL_ExecuteProgramNV(disp, parameters) (*((disp)->ExecuteProgramNV)) parameters -#define GET_ExecuteProgramNV(disp) ((disp)->ExecuteProgramNV) -#define SET_ExecuteProgramNV(disp, fn) ((disp)->ExecuteProgramNV = fn) -#define CALL_GenProgramsNV(disp, parameters) (*((disp)->GenProgramsNV)) parameters -#define GET_GenProgramsNV(disp) ((disp)->GenProgramsNV) -#define SET_GenProgramsNV(disp, fn) ((disp)->GenProgramsNV = fn) -#define CALL_GetProgramParameterdvNV(disp, parameters) (*((disp)->GetProgramParameterdvNV)) parameters -#define GET_GetProgramParameterdvNV(disp) ((disp)->GetProgramParameterdvNV) -#define SET_GetProgramParameterdvNV(disp, fn) ((disp)->GetProgramParameterdvNV = fn) -#define CALL_GetProgramParameterfvNV(disp, parameters) (*((disp)->GetProgramParameterfvNV)) parameters -#define GET_GetProgramParameterfvNV(disp) ((disp)->GetProgramParameterfvNV) -#define SET_GetProgramParameterfvNV(disp, fn) ((disp)->GetProgramParameterfvNV = fn) -#define CALL_GetProgramStringNV(disp, parameters) (*((disp)->GetProgramStringNV)) parameters -#define GET_GetProgramStringNV(disp) ((disp)->GetProgramStringNV) -#define SET_GetProgramStringNV(disp, fn) ((disp)->GetProgramStringNV = fn) -#define CALL_GetProgramivNV(disp, parameters) (*((disp)->GetProgramivNV)) parameters -#define GET_GetProgramivNV(disp) ((disp)->GetProgramivNV) -#define SET_GetProgramivNV(disp, fn) ((disp)->GetProgramivNV = fn) -#define CALL_GetTrackMatrixivNV(disp, parameters) (*((disp)->GetTrackMatrixivNV)) parameters -#define GET_GetTrackMatrixivNV(disp) ((disp)->GetTrackMatrixivNV) -#define SET_GetTrackMatrixivNV(disp, fn) ((disp)->GetTrackMatrixivNV = fn) -#define CALL_GetVertexAttribPointervNV(disp, parameters) (*((disp)->GetVertexAttribPointervNV)) parameters -#define GET_GetVertexAttribPointervNV(disp) ((disp)->GetVertexAttribPointervNV) -#define SET_GetVertexAttribPointervNV(disp, fn) ((disp)->GetVertexAttribPointervNV = fn) -#define CALL_GetVertexAttribdvNV(disp, parameters) (*((disp)->GetVertexAttribdvNV)) parameters -#define GET_GetVertexAttribdvNV(disp) ((disp)->GetVertexAttribdvNV) -#define SET_GetVertexAttribdvNV(disp, fn) ((disp)->GetVertexAttribdvNV = fn) -#define CALL_GetVertexAttribfvNV(disp, parameters) (*((disp)->GetVertexAttribfvNV)) parameters -#define GET_GetVertexAttribfvNV(disp) ((disp)->GetVertexAttribfvNV) -#define SET_GetVertexAttribfvNV(disp, fn) ((disp)->GetVertexAttribfvNV = fn) -#define CALL_GetVertexAttribivNV(disp, parameters) (*((disp)->GetVertexAttribivNV)) parameters -#define GET_GetVertexAttribivNV(disp) ((disp)->GetVertexAttribivNV) -#define SET_GetVertexAttribivNV(disp, fn) ((disp)->GetVertexAttribivNV = fn) -#define CALL_IsProgramNV(disp, parameters) (*((disp)->IsProgramNV)) parameters -#define GET_IsProgramNV(disp) ((disp)->IsProgramNV) -#define SET_IsProgramNV(disp, fn) ((disp)->IsProgramNV = fn) -#define CALL_LoadProgramNV(disp, parameters) (*((disp)->LoadProgramNV)) parameters -#define GET_LoadProgramNV(disp) ((disp)->LoadProgramNV) -#define SET_LoadProgramNV(disp, fn) ((disp)->LoadProgramNV = fn) -#define CALL_ProgramParameters4dvNV(disp, parameters) (*((disp)->ProgramParameters4dvNV)) parameters -#define GET_ProgramParameters4dvNV(disp) ((disp)->ProgramParameters4dvNV) -#define SET_ProgramParameters4dvNV(disp, fn) ((disp)->ProgramParameters4dvNV = fn) -#define CALL_ProgramParameters4fvNV(disp, parameters) (*((disp)->ProgramParameters4fvNV)) parameters -#define GET_ProgramParameters4fvNV(disp) ((disp)->ProgramParameters4fvNV) -#define SET_ProgramParameters4fvNV(disp, fn) ((disp)->ProgramParameters4fvNV = fn) -#define CALL_RequestResidentProgramsNV(disp, parameters) (*((disp)->RequestResidentProgramsNV)) parameters -#define GET_RequestResidentProgramsNV(disp) ((disp)->RequestResidentProgramsNV) -#define SET_RequestResidentProgramsNV(disp, fn) ((disp)->RequestResidentProgramsNV = fn) -#define CALL_TrackMatrixNV(disp, parameters) (*((disp)->TrackMatrixNV)) parameters -#define GET_TrackMatrixNV(disp) ((disp)->TrackMatrixNV) -#define SET_TrackMatrixNV(disp, fn) ((disp)->TrackMatrixNV = fn) -#define CALL_VertexAttrib1dNV(disp, parameters) (*((disp)->VertexAttrib1dNV)) parameters -#define GET_VertexAttrib1dNV(disp) ((disp)->VertexAttrib1dNV) -#define SET_VertexAttrib1dNV(disp, fn) ((disp)->VertexAttrib1dNV = fn) -#define CALL_VertexAttrib1dvNV(disp, parameters) (*((disp)->VertexAttrib1dvNV)) parameters -#define GET_VertexAttrib1dvNV(disp) ((disp)->VertexAttrib1dvNV) -#define SET_VertexAttrib1dvNV(disp, fn) ((disp)->VertexAttrib1dvNV = fn) -#define CALL_VertexAttrib1fNV(disp, parameters) (*((disp)->VertexAttrib1fNV)) parameters -#define GET_VertexAttrib1fNV(disp) ((disp)->VertexAttrib1fNV) -#define SET_VertexAttrib1fNV(disp, fn) ((disp)->VertexAttrib1fNV = fn) -#define CALL_VertexAttrib1fvNV(disp, parameters) (*((disp)->VertexAttrib1fvNV)) parameters -#define GET_VertexAttrib1fvNV(disp) ((disp)->VertexAttrib1fvNV) -#define SET_VertexAttrib1fvNV(disp, fn) ((disp)->VertexAttrib1fvNV = fn) -#define CALL_VertexAttrib1sNV(disp, parameters) (*((disp)->VertexAttrib1sNV)) parameters -#define GET_VertexAttrib1sNV(disp) ((disp)->VertexAttrib1sNV) -#define SET_VertexAttrib1sNV(disp, fn) ((disp)->VertexAttrib1sNV = fn) -#define CALL_VertexAttrib1svNV(disp, parameters) (*((disp)->VertexAttrib1svNV)) parameters -#define GET_VertexAttrib1svNV(disp) ((disp)->VertexAttrib1svNV) -#define SET_VertexAttrib1svNV(disp, fn) ((disp)->VertexAttrib1svNV = fn) -#define CALL_VertexAttrib2dNV(disp, parameters) (*((disp)->VertexAttrib2dNV)) parameters -#define GET_VertexAttrib2dNV(disp) ((disp)->VertexAttrib2dNV) -#define SET_VertexAttrib2dNV(disp, fn) ((disp)->VertexAttrib2dNV = fn) -#define CALL_VertexAttrib2dvNV(disp, parameters) (*((disp)->VertexAttrib2dvNV)) parameters -#define GET_VertexAttrib2dvNV(disp) ((disp)->VertexAttrib2dvNV) -#define SET_VertexAttrib2dvNV(disp, fn) ((disp)->VertexAttrib2dvNV = fn) -#define CALL_VertexAttrib2fNV(disp, parameters) (*((disp)->VertexAttrib2fNV)) parameters -#define GET_VertexAttrib2fNV(disp) ((disp)->VertexAttrib2fNV) -#define SET_VertexAttrib2fNV(disp, fn) ((disp)->VertexAttrib2fNV = fn) -#define CALL_VertexAttrib2fvNV(disp, parameters) (*((disp)->VertexAttrib2fvNV)) parameters -#define GET_VertexAttrib2fvNV(disp) ((disp)->VertexAttrib2fvNV) -#define SET_VertexAttrib2fvNV(disp, fn) ((disp)->VertexAttrib2fvNV = fn) -#define CALL_VertexAttrib2sNV(disp, parameters) (*((disp)->VertexAttrib2sNV)) parameters -#define GET_VertexAttrib2sNV(disp) ((disp)->VertexAttrib2sNV) -#define SET_VertexAttrib2sNV(disp, fn) ((disp)->VertexAttrib2sNV = fn) -#define CALL_VertexAttrib2svNV(disp, parameters) (*((disp)->VertexAttrib2svNV)) parameters -#define GET_VertexAttrib2svNV(disp) ((disp)->VertexAttrib2svNV) -#define SET_VertexAttrib2svNV(disp, fn) ((disp)->VertexAttrib2svNV = fn) -#define CALL_VertexAttrib3dNV(disp, parameters) (*((disp)->VertexAttrib3dNV)) parameters -#define GET_VertexAttrib3dNV(disp) ((disp)->VertexAttrib3dNV) -#define SET_VertexAttrib3dNV(disp, fn) ((disp)->VertexAttrib3dNV = fn) -#define CALL_VertexAttrib3dvNV(disp, parameters) (*((disp)->VertexAttrib3dvNV)) parameters -#define GET_VertexAttrib3dvNV(disp) ((disp)->VertexAttrib3dvNV) -#define SET_VertexAttrib3dvNV(disp, fn) ((disp)->VertexAttrib3dvNV = fn) -#define CALL_VertexAttrib3fNV(disp, parameters) (*((disp)->VertexAttrib3fNV)) parameters -#define GET_VertexAttrib3fNV(disp) ((disp)->VertexAttrib3fNV) -#define SET_VertexAttrib3fNV(disp, fn) ((disp)->VertexAttrib3fNV = fn) -#define CALL_VertexAttrib3fvNV(disp, parameters) (*((disp)->VertexAttrib3fvNV)) parameters -#define GET_VertexAttrib3fvNV(disp) ((disp)->VertexAttrib3fvNV) -#define SET_VertexAttrib3fvNV(disp, fn) ((disp)->VertexAttrib3fvNV = fn) -#define CALL_VertexAttrib3sNV(disp, parameters) (*((disp)->VertexAttrib3sNV)) parameters -#define GET_VertexAttrib3sNV(disp) ((disp)->VertexAttrib3sNV) -#define SET_VertexAttrib3sNV(disp, fn) ((disp)->VertexAttrib3sNV = fn) -#define CALL_VertexAttrib3svNV(disp, parameters) (*((disp)->VertexAttrib3svNV)) parameters -#define GET_VertexAttrib3svNV(disp) ((disp)->VertexAttrib3svNV) -#define SET_VertexAttrib3svNV(disp, fn) ((disp)->VertexAttrib3svNV = fn) -#define CALL_VertexAttrib4dNV(disp, parameters) (*((disp)->VertexAttrib4dNV)) parameters -#define GET_VertexAttrib4dNV(disp) ((disp)->VertexAttrib4dNV) -#define SET_VertexAttrib4dNV(disp, fn) ((disp)->VertexAttrib4dNV = fn) -#define CALL_VertexAttrib4dvNV(disp, parameters) (*((disp)->VertexAttrib4dvNV)) parameters -#define GET_VertexAttrib4dvNV(disp) ((disp)->VertexAttrib4dvNV) -#define SET_VertexAttrib4dvNV(disp, fn) ((disp)->VertexAttrib4dvNV = fn) -#define CALL_VertexAttrib4fNV(disp, parameters) (*((disp)->VertexAttrib4fNV)) parameters -#define GET_VertexAttrib4fNV(disp) ((disp)->VertexAttrib4fNV) -#define SET_VertexAttrib4fNV(disp, fn) ((disp)->VertexAttrib4fNV = fn) -#define CALL_VertexAttrib4fvNV(disp, parameters) (*((disp)->VertexAttrib4fvNV)) parameters -#define GET_VertexAttrib4fvNV(disp) ((disp)->VertexAttrib4fvNV) -#define SET_VertexAttrib4fvNV(disp, fn) ((disp)->VertexAttrib4fvNV = fn) -#define CALL_VertexAttrib4sNV(disp, parameters) (*((disp)->VertexAttrib4sNV)) parameters -#define GET_VertexAttrib4sNV(disp) ((disp)->VertexAttrib4sNV) -#define SET_VertexAttrib4sNV(disp, fn) ((disp)->VertexAttrib4sNV = fn) -#define CALL_VertexAttrib4svNV(disp, parameters) (*((disp)->VertexAttrib4svNV)) parameters -#define GET_VertexAttrib4svNV(disp) ((disp)->VertexAttrib4svNV) -#define SET_VertexAttrib4svNV(disp, fn) ((disp)->VertexAttrib4svNV = fn) -#define CALL_VertexAttrib4ubNV(disp, parameters) (*((disp)->VertexAttrib4ubNV)) parameters -#define GET_VertexAttrib4ubNV(disp) ((disp)->VertexAttrib4ubNV) -#define SET_VertexAttrib4ubNV(disp, fn) ((disp)->VertexAttrib4ubNV = fn) -#define CALL_VertexAttrib4ubvNV(disp, parameters) (*((disp)->VertexAttrib4ubvNV)) parameters -#define GET_VertexAttrib4ubvNV(disp) ((disp)->VertexAttrib4ubvNV) -#define SET_VertexAttrib4ubvNV(disp, fn) ((disp)->VertexAttrib4ubvNV = fn) -#define CALL_VertexAttribPointerNV(disp, parameters) (*((disp)->VertexAttribPointerNV)) parameters -#define GET_VertexAttribPointerNV(disp) ((disp)->VertexAttribPointerNV) -#define SET_VertexAttribPointerNV(disp, fn) ((disp)->VertexAttribPointerNV = fn) -#define CALL_VertexAttribs1dvNV(disp, parameters) (*((disp)->VertexAttribs1dvNV)) parameters -#define GET_VertexAttribs1dvNV(disp) ((disp)->VertexAttribs1dvNV) -#define SET_VertexAttribs1dvNV(disp, fn) ((disp)->VertexAttribs1dvNV = fn) -#define CALL_VertexAttribs1fvNV(disp, parameters) (*((disp)->VertexAttribs1fvNV)) parameters -#define GET_VertexAttribs1fvNV(disp) ((disp)->VertexAttribs1fvNV) -#define SET_VertexAttribs1fvNV(disp, fn) ((disp)->VertexAttribs1fvNV = fn) -#define CALL_VertexAttribs1svNV(disp, parameters) (*((disp)->VertexAttribs1svNV)) parameters -#define GET_VertexAttribs1svNV(disp) ((disp)->VertexAttribs1svNV) -#define SET_VertexAttribs1svNV(disp, fn) ((disp)->VertexAttribs1svNV = fn) -#define CALL_VertexAttribs2dvNV(disp, parameters) (*((disp)->VertexAttribs2dvNV)) parameters -#define GET_VertexAttribs2dvNV(disp) ((disp)->VertexAttribs2dvNV) -#define SET_VertexAttribs2dvNV(disp, fn) ((disp)->VertexAttribs2dvNV = fn) -#define CALL_VertexAttribs2fvNV(disp, parameters) (*((disp)->VertexAttribs2fvNV)) parameters -#define GET_VertexAttribs2fvNV(disp) ((disp)->VertexAttribs2fvNV) -#define SET_VertexAttribs2fvNV(disp, fn) ((disp)->VertexAttribs2fvNV = fn) -#define CALL_VertexAttribs2svNV(disp, parameters) (*((disp)->VertexAttribs2svNV)) parameters -#define GET_VertexAttribs2svNV(disp) ((disp)->VertexAttribs2svNV) -#define SET_VertexAttribs2svNV(disp, fn) ((disp)->VertexAttribs2svNV = fn) -#define CALL_VertexAttribs3dvNV(disp, parameters) (*((disp)->VertexAttribs3dvNV)) parameters -#define GET_VertexAttribs3dvNV(disp) ((disp)->VertexAttribs3dvNV) -#define SET_VertexAttribs3dvNV(disp, fn) ((disp)->VertexAttribs3dvNV = fn) -#define CALL_VertexAttribs3fvNV(disp, parameters) (*((disp)->VertexAttribs3fvNV)) parameters -#define GET_VertexAttribs3fvNV(disp) ((disp)->VertexAttribs3fvNV) -#define SET_VertexAttribs3fvNV(disp, fn) ((disp)->VertexAttribs3fvNV = fn) -#define CALL_VertexAttribs3svNV(disp, parameters) (*((disp)->VertexAttribs3svNV)) parameters -#define GET_VertexAttribs3svNV(disp) ((disp)->VertexAttribs3svNV) -#define SET_VertexAttribs3svNV(disp, fn) ((disp)->VertexAttribs3svNV = fn) -#define CALL_VertexAttribs4dvNV(disp, parameters) (*((disp)->VertexAttribs4dvNV)) parameters -#define GET_VertexAttribs4dvNV(disp) ((disp)->VertexAttribs4dvNV) -#define SET_VertexAttribs4dvNV(disp, fn) ((disp)->VertexAttribs4dvNV = fn) -#define CALL_VertexAttribs4fvNV(disp, parameters) (*((disp)->VertexAttribs4fvNV)) parameters -#define GET_VertexAttribs4fvNV(disp) ((disp)->VertexAttribs4fvNV) -#define SET_VertexAttribs4fvNV(disp, fn) ((disp)->VertexAttribs4fvNV = fn) -#define CALL_VertexAttribs4svNV(disp, parameters) (*((disp)->VertexAttribs4svNV)) parameters -#define GET_VertexAttribs4svNV(disp) ((disp)->VertexAttribs4svNV) -#define SET_VertexAttribs4svNV(disp, fn) ((disp)->VertexAttribs4svNV = fn) -#define CALL_VertexAttribs4ubvNV(disp, parameters) (*((disp)->VertexAttribs4ubvNV)) parameters -#define GET_VertexAttribs4ubvNV(disp) ((disp)->VertexAttribs4ubvNV) -#define SET_VertexAttribs4ubvNV(disp, fn) ((disp)->VertexAttribs4ubvNV = fn) -#define CALL_GetTexBumpParameterfvATI(disp, parameters) (*((disp)->GetTexBumpParameterfvATI)) parameters -#define GET_GetTexBumpParameterfvATI(disp) ((disp)->GetTexBumpParameterfvATI) -#define SET_GetTexBumpParameterfvATI(disp, fn) ((disp)->GetTexBumpParameterfvATI = fn) -#define CALL_GetTexBumpParameterivATI(disp, parameters) (*((disp)->GetTexBumpParameterivATI)) parameters -#define GET_GetTexBumpParameterivATI(disp) ((disp)->GetTexBumpParameterivATI) -#define SET_GetTexBumpParameterivATI(disp, fn) ((disp)->GetTexBumpParameterivATI = fn) -#define CALL_TexBumpParameterfvATI(disp, parameters) (*((disp)->TexBumpParameterfvATI)) parameters -#define GET_TexBumpParameterfvATI(disp) ((disp)->TexBumpParameterfvATI) -#define SET_TexBumpParameterfvATI(disp, fn) ((disp)->TexBumpParameterfvATI = fn) -#define CALL_TexBumpParameterivATI(disp, parameters) (*((disp)->TexBumpParameterivATI)) parameters -#define GET_TexBumpParameterivATI(disp) ((disp)->TexBumpParameterivATI) -#define SET_TexBumpParameterivATI(disp, fn) ((disp)->TexBumpParameterivATI = fn) -#define CALL_AlphaFragmentOp1ATI(disp, parameters) (*((disp)->AlphaFragmentOp1ATI)) parameters -#define GET_AlphaFragmentOp1ATI(disp) ((disp)->AlphaFragmentOp1ATI) -#define SET_AlphaFragmentOp1ATI(disp, fn) ((disp)->AlphaFragmentOp1ATI = fn) -#define CALL_AlphaFragmentOp2ATI(disp, parameters) (*((disp)->AlphaFragmentOp2ATI)) parameters -#define GET_AlphaFragmentOp2ATI(disp) ((disp)->AlphaFragmentOp2ATI) -#define SET_AlphaFragmentOp2ATI(disp, fn) ((disp)->AlphaFragmentOp2ATI = fn) -#define CALL_AlphaFragmentOp3ATI(disp, parameters) (*((disp)->AlphaFragmentOp3ATI)) parameters -#define GET_AlphaFragmentOp3ATI(disp) ((disp)->AlphaFragmentOp3ATI) -#define SET_AlphaFragmentOp3ATI(disp, fn) ((disp)->AlphaFragmentOp3ATI = fn) -#define CALL_BeginFragmentShaderATI(disp, parameters) (*((disp)->BeginFragmentShaderATI)) parameters -#define GET_BeginFragmentShaderATI(disp) ((disp)->BeginFragmentShaderATI) -#define SET_BeginFragmentShaderATI(disp, fn) ((disp)->BeginFragmentShaderATI = fn) -#define CALL_BindFragmentShaderATI(disp, parameters) (*((disp)->BindFragmentShaderATI)) parameters -#define GET_BindFragmentShaderATI(disp) ((disp)->BindFragmentShaderATI) -#define SET_BindFragmentShaderATI(disp, fn) ((disp)->BindFragmentShaderATI = fn) -#define CALL_ColorFragmentOp1ATI(disp, parameters) (*((disp)->ColorFragmentOp1ATI)) parameters -#define GET_ColorFragmentOp1ATI(disp) ((disp)->ColorFragmentOp1ATI) -#define SET_ColorFragmentOp1ATI(disp, fn) ((disp)->ColorFragmentOp1ATI = fn) -#define CALL_ColorFragmentOp2ATI(disp, parameters) (*((disp)->ColorFragmentOp2ATI)) parameters -#define GET_ColorFragmentOp2ATI(disp) ((disp)->ColorFragmentOp2ATI) -#define SET_ColorFragmentOp2ATI(disp, fn) ((disp)->ColorFragmentOp2ATI = fn) -#define CALL_ColorFragmentOp3ATI(disp, parameters) (*((disp)->ColorFragmentOp3ATI)) parameters -#define GET_ColorFragmentOp3ATI(disp) ((disp)->ColorFragmentOp3ATI) -#define SET_ColorFragmentOp3ATI(disp, fn) ((disp)->ColorFragmentOp3ATI = fn) -#define CALL_DeleteFragmentShaderATI(disp, parameters) (*((disp)->DeleteFragmentShaderATI)) parameters -#define GET_DeleteFragmentShaderATI(disp) ((disp)->DeleteFragmentShaderATI) -#define SET_DeleteFragmentShaderATI(disp, fn) ((disp)->DeleteFragmentShaderATI = fn) -#define CALL_EndFragmentShaderATI(disp, parameters) (*((disp)->EndFragmentShaderATI)) parameters -#define GET_EndFragmentShaderATI(disp) ((disp)->EndFragmentShaderATI) -#define SET_EndFragmentShaderATI(disp, fn) ((disp)->EndFragmentShaderATI = fn) -#define CALL_GenFragmentShadersATI(disp, parameters) (*((disp)->GenFragmentShadersATI)) parameters -#define GET_GenFragmentShadersATI(disp) ((disp)->GenFragmentShadersATI) -#define SET_GenFragmentShadersATI(disp, fn) ((disp)->GenFragmentShadersATI = fn) -#define CALL_PassTexCoordATI(disp, parameters) (*((disp)->PassTexCoordATI)) parameters -#define GET_PassTexCoordATI(disp) ((disp)->PassTexCoordATI) -#define SET_PassTexCoordATI(disp, fn) ((disp)->PassTexCoordATI = fn) -#define CALL_SampleMapATI(disp, parameters) (*((disp)->SampleMapATI)) parameters -#define GET_SampleMapATI(disp) ((disp)->SampleMapATI) -#define SET_SampleMapATI(disp, fn) ((disp)->SampleMapATI = fn) -#define CALL_SetFragmentShaderConstantATI(disp, parameters) (*((disp)->SetFragmentShaderConstantATI)) parameters -#define GET_SetFragmentShaderConstantATI(disp) ((disp)->SetFragmentShaderConstantATI) -#define SET_SetFragmentShaderConstantATI(disp, fn) ((disp)->SetFragmentShaderConstantATI = fn) -#define CALL_PointParameteriNV(disp, parameters) (*((disp)->PointParameteriNV)) parameters -#define GET_PointParameteriNV(disp) ((disp)->PointParameteriNV) -#define SET_PointParameteriNV(disp, fn) ((disp)->PointParameteriNV = fn) -#define CALL_PointParameterivNV(disp, parameters) (*((disp)->PointParameterivNV)) parameters -#define GET_PointParameterivNV(disp) ((disp)->PointParameterivNV) -#define SET_PointParameterivNV(disp, fn) ((disp)->PointParameterivNV = fn) -#define CALL_ActiveStencilFaceEXT(disp, parameters) (*((disp)->ActiveStencilFaceEXT)) parameters -#define GET_ActiveStencilFaceEXT(disp) ((disp)->ActiveStencilFaceEXT) -#define SET_ActiveStencilFaceEXT(disp, fn) ((disp)->ActiveStencilFaceEXT = fn) -#define CALL_BindVertexArrayAPPLE(disp, parameters) (*((disp)->BindVertexArrayAPPLE)) parameters -#define GET_BindVertexArrayAPPLE(disp) ((disp)->BindVertexArrayAPPLE) -#define SET_BindVertexArrayAPPLE(disp, fn) ((disp)->BindVertexArrayAPPLE = fn) -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) (*((disp)->DeleteVertexArraysAPPLE)) parameters -#define GET_DeleteVertexArraysAPPLE(disp) ((disp)->DeleteVertexArraysAPPLE) -#define SET_DeleteVertexArraysAPPLE(disp, fn) ((disp)->DeleteVertexArraysAPPLE = fn) -#define CALL_GenVertexArraysAPPLE(disp, parameters) (*((disp)->GenVertexArraysAPPLE)) parameters -#define GET_GenVertexArraysAPPLE(disp) ((disp)->GenVertexArraysAPPLE) -#define SET_GenVertexArraysAPPLE(disp, fn) ((disp)->GenVertexArraysAPPLE = fn) -#define CALL_IsVertexArrayAPPLE(disp, parameters) (*((disp)->IsVertexArrayAPPLE)) parameters -#define GET_IsVertexArrayAPPLE(disp) ((disp)->IsVertexArrayAPPLE) -#define SET_IsVertexArrayAPPLE(disp, fn) ((disp)->IsVertexArrayAPPLE = fn) -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) (*((disp)->GetProgramNamedParameterdvNV)) parameters -#define GET_GetProgramNamedParameterdvNV(disp) ((disp)->GetProgramNamedParameterdvNV) -#define SET_GetProgramNamedParameterdvNV(disp, fn) ((disp)->GetProgramNamedParameterdvNV = fn) -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) (*((disp)->GetProgramNamedParameterfvNV)) parameters -#define GET_GetProgramNamedParameterfvNV(disp) ((disp)->GetProgramNamedParameterfvNV) -#define SET_GetProgramNamedParameterfvNV(disp, fn) ((disp)->GetProgramNamedParameterfvNV = fn) -#define CALL_ProgramNamedParameter4dNV(disp, parameters) (*((disp)->ProgramNamedParameter4dNV)) parameters -#define GET_ProgramNamedParameter4dNV(disp) ((disp)->ProgramNamedParameter4dNV) -#define SET_ProgramNamedParameter4dNV(disp, fn) ((disp)->ProgramNamedParameter4dNV = fn) -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) (*((disp)->ProgramNamedParameter4dvNV)) parameters -#define GET_ProgramNamedParameter4dvNV(disp) ((disp)->ProgramNamedParameter4dvNV) -#define SET_ProgramNamedParameter4dvNV(disp, fn) ((disp)->ProgramNamedParameter4dvNV = fn) -#define CALL_ProgramNamedParameter4fNV(disp, parameters) (*((disp)->ProgramNamedParameter4fNV)) parameters -#define GET_ProgramNamedParameter4fNV(disp) ((disp)->ProgramNamedParameter4fNV) -#define SET_ProgramNamedParameter4fNV(disp, fn) ((disp)->ProgramNamedParameter4fNV = fn) -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) (*((disp)->ProgramNamedParameter4fvNV)) parameters -#define GET_ProgramNamedParameter4fvNV(disp) ((disp)->ProgramNamedParameter4fvNV) -#define SET_ProgramNamedParameter4fvNV(disp, fn) ((disp)->ProgramNamedParameter4fvNV = fn) -#define CALL_DepthBoundsEXT(disp, parameters) (*((disp)->DepthBoundsEXT)) parameters -#define GET_DepthBoundsEXT(disp) ((disp)->DepthBoundsEXT) -#define SET_DepthBoundsEXT(disp, fn) ((disp)->DepthBoundsEXT = fn) -#define CALL_BlendEquationSeparateEXT(disp, parameters) (*((disp)->BlendEquationSeparateEXT)) parameters -#define GET_BlendEquationSeparateEXT(disp) ((disp)->BlendEquationSeparateEXT) -#define SET_BlendEquationSeparateEXT(disp, fn) ((disp)->BlendEquationSeparateEXT = fn) -#define CALL_BindFramebufferEXT(disp, parameters) (*((disp)->BindFramebufferEXT)) parameters -#define GET_BindFramebufferEXT(disp) ((disp)->BindFramebufferEXT) -#define SET_BindFramebufferEXT(disp, fn) ((disp)->BindFramebufferEXT = fn) -#define CALL_BindRenderbufferEXT(disp, parameters) (*((disp)->BindRenderbufferEXT)) parameters -#define GET_BindRenderbufferEXT(disp) ((disp)->BindRenderbufferEXT) -#define SET_BindRenderbufferEXT(disp, fn) ((disp)->BindRenderbufferEXT = fn) -#define CALL_CheckFramebufferStatusEXT(disp, parameters) (*((disp)->CheckFramebufferStatusEXT)) parameters -#define GET_CheckFramebufferStatusEXT(disp) ((disp)->CheckFramebufferStatusEXT) -#define SET_CheckFramebufferStatusEXT(disp, fn) ((disp)->CheckFramebufferStatusEXT = fn) -#define CALL_DeleteFramebuffersEXT(disp, parameters) (*((disp)->DeleteFramebuffersEXT)) parameters -#define GET_DeleteFramebuffersEXT(disp) ((disp)->DeleteFramebuffersEXT) -#define SET_DeleteFramebuffersEXT(disp, fn) ((disp)->DeleteFramebuffersEXT = fn) -#define CALL_DeleteRenderbuffersEXT(disp, parameters) (*((disp)->DeleteRenderbuffersEXT)) parameters -#define GET_DeleteRenderbuffersEXT(disp) ((disp)->DeleteRenderbuffersEXT) -#define SET_DeleteRenderbuffersEXT(disp, fn) ((disp)->DeleteRenderbuffersEXT = fn) -#define CALL_FramebufferRenderbufferEXT(disp, parameters) (*((disp)->FramebufferRenderbufferEXT)) parameters -#define GET_FramebufferRenderbufferEXT(disp) ((disp)->FramebufferRenderbufferEXT) -#define SET_FramebufferRenderbufferEXT(disp, fn) ((disp)->FramebufferRenderbufferEXT = fn) -#define CALL_FramebufferTexture1DEXT(disp, parameters) (*((disp)->FramebufferTexture1DEXT)) parameters -#define GET_FramebufferTexture1DEXT(disp) ((disp)->FramebufferTexture1DEXT) -#define SET_FramebufferTexture1DEXT(disp, fn) ((disp)->FramebufferTexture1DEXT = fn) -#define CALL_FramebufferTexture2DEXT(disp, parameters) (*((disp)->FramebufferTexture2DEXT)) parameters -#define GET_FramebufferTexture2DEXT(disp) ((disp)->FramebufferTexture2DEXT) -#define SET_FramebufferTexture2DEXT(disp, fn) ((disp)->FramebufferTexture2DEXT = fn) -#define CALL_FramebufferTexture3DEXT(disp, parameters) (*((disp)->FramebufferTexture3DEXT)) parameters -#define GET_FramebufferTexture3DEXT(disp) ((disp)->FramebufferTexture3DEXT) -#define SET_FramebufferTexture3DEXT(disp, fn) ((disp)->FramebufferTexture3DEXT = fn) -#define CALL_GenFramebuffersEXT(disp, parameters) (*((disp)->GenFramebuffersEXT)) parameters -#define GET_GenFramebuffersEXT(disp) ((disp)->GenFramebuffersEXT) -#define SET_GenFramebuffersEXT(disp, fn) ((disp)->GenFramebuffersEXT = fn) -#define CALL_GenRenderbuffersEXT(disp, parameters) (*((disp)->GenRenderbuffersEXT)) parameters -#define GET_GenRenderbuffersEXT(disp) ((disp)->GenRenderbuffersEXT) -#define SET_GenRenderbuffersEXT(disp, fn) ((disp)->GenRenderbuffersEXT = fn) -#define CALL_GenerateMipmapEXT(disp, parameters) (*((disp)->GenerateMipmapEXT)) parameters -#define GET_GenerateMipmapEXT(disp) ((disp)->GenerateMipmapEXT) -#define SET_GenerateMipmapEXT(disp, fn) ((disp)->GenerateMipmapEXT = fn) -#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters -#define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT) -#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn) -#define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters -#define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT) -#define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn) -#define CALL_IsFramebufferEXT(disp, parameters) (*((disp)->IsFramebufferEXT)) parameters -#define GET_IsFramebufferEXT(disp) ((disp)->IsFramebufferEXT) -#define SET_IsFramebufferEXT(disp, fn) ((disp)->IsFramebufferEXT = fn) -#define CALL_IsRenderbufferEXT(disp, parameters) (*((disp)->IsRenderbufferEXT)) parameters -#define GET_IsRenderbufferEXT(disp) ((disp)->IsRenderbufferEXT) -#define SET_IsRenderbufferEXT(disp, fn) ((disp)->IsRenderbufferEXT = fn) -#define CALL_RenderbufferStorageEXT(disp, parameters) (*((disp)->RenderbufferStorageEXT)) parameters -#define GET_RenderbufferStorageEXT(disp) ((disp)->RenderbufferStorageEXT) -#define SET_RenderbufferStorageEXT(disp, fn) ((disp)->RenderbufferStorageEXT = fn) -#define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters -#define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT) -#define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn) -#define CALL_BufferParameteriAPPLE(disp, parameters) (*((disp)->BufferParameteriAPPLE)) parameters -#define GET_BufferParameteriAPPLE(disp) ((disp)->BufferParameteriAPPLE) -#define SET_BufferParameteriAPPLE(disp, fn) ((disp)->BufferParameteriAPPLE = fn) -#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) (*((disp)->FlushMappedBufferRangeAPPLE)) parameters -#define GET_FlushMappedBufferRangeAPPLE(disp) ((disp)->FlushMappedBufferRangeAPPLE) -#define SET_FlushMappedBufferRangeAPPLE(disp, fn) ((disp)->FlushMappedBufferRangeAPPLE = fn) -#define CALL_FramebufferTextureLayerEXT(disp, parameters) (*((disp)->FramebufferTextureLayerEXT)) parameters -#define GET_FramebufferTextureLayerEXT(disp) ((disp)->FramebufferTextureLayerEXT) -#define SET_FramebufferTextureLayerEXT(disp, fn) ((disp)->FramebufferTextureLayerEXT = fn) -#define CALL_ProvokingVertexEXT(disp, parameters) (*((disp)->ProvokingVertexEXT)) parameters -#define GET_ProvokingVertexEXT(disp) ((disp)->ProvokingVertexEXT) -#define SET_ProvokingVertexEXT(disp, fn) ((disp)->ProvokingVertexEXT = fn) -#define CALL_GetTexParameterPointervAPPLE(disp, parameters) (*((disp)->GetTexParameterPointervAPPLE)) parameters -#define GET_GetTexParameterPointervAPPLE(disp) ((disp)->GetTexParameterPointervAPPLE) -#define SET_GetTexParameterPointervAPPLE(disp, fn) ((disp)->GetTexParameterPointervAPPLE = fn) -#define CALL_TextureRangeAPPLE(disp, parameters) (*((disp)->TextureRangeAPPLE)) parameters -#define GET_TextureRangeAPPLE(disp) ((disp)->TextureRangeAPPLE) -#define SET_TextureRangeAPPLE(disp, fn) ((disp)->TextureRangeAPPLE = fn) -#define CALL_StencilFuncSeparateATI(disp, parameters) (*((disp)->StencilFuncSeparateATI)) parameters -#define GET_StencilFuncSeparateATI(disp) ((disp)->StencilFuncSeparateATI) -#define SET_StencilFuncSeparateATI(disp, fn) ((disp)->StencilFuncSeparateATI = fn) -#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters -#define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT) -#define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn) -#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters -#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT) -#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters -#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) -#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters -#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) -#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) - -#else - -#define driDispatchRemapTable_size 384 -extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; - -#define AttachShader_remap_index 0 -#define CreateProgram_remap_index 1 -#define CreateShader_remap_index 2 -#define DeleteProgram_remap_index 3 -#define DeleteShader_remap_index 4 -#define DetachShader_remap_index 5 -#define GetAttachedShaders_remap_index 6 -#define GetProgramInfoLog_remap_index 7 -#define GetProgramiv_remap_index 8 -#define GetShaderInfoLog_remap_index 9 -#define GetShaderiv_remap_index 10 -#define IsProgram_remap_index 11 -#define IsShader_remap_index 12 -#define StencilFuncSeparate_remap_index 13 -#define StencilMaskSeparate_remap_index 14 -#define StencilOpSeparate_remap_index 15 -#define UniformMatrix2x3fv_remap_index 16 -#define UniformMatrix2x4fv_remap_index 17 -#define UniformMatrix3x2fv_remap_index 18 -#define UniformMatrix3x4fv_remap_index 19 -#define UniformMatrix4x2fv_remap_index 20 -#define UniformMatrix4x3fv_remap_index 21 -#define LoadTransposeMatrixdARB_remap_index 22 -#define LoadTransposeMatrixfARB_remap_index 23 -#define MultTransposeMatrixdARB_remap_index 24 -#define MultTransposeMatrixfARB_remap_index 25 -#define SampleCoverageARB_remap_index 26 -#define CompressedTexImage1DARB_remap_index 27 -#define CompressedTexImage2DARB_remap_index 28 -#define CompressedTexImage3DARB_remap_index 29 -#define CompressedTexSubImage1DARB_remap_index 30 -#define CompressedTexSubImage2DARB_remap_index 31 -#define CompressedTexSubImage3DARB_remap_index 32 -#define GetCompressedTexImageARB_remap_index 33 -#define DisableVertexAttribArrayARB_remap_index 34 -#define EnableVertexAttribArrayARB_remap_index 35 -#define GetProgramEnvParameterdvARB_remap_index 36 -#define GetProgramEnvParameterfvARB_remap_index 37 -#define GetProgramLocalParameterdvARB_remap_index 38 -#define GetProgramLocalParameterfvARB_remap_index 39 -#define GetProgramStringARB_remap_index 40 -#define GetProgramivARB_remap_index 41 -#define GetVertexAttribdvARB_remap_index 42 -#define GetVertexAttribfvARB_remap_index 43 -#define GetVertexAttribivARB_remap_index 44 -#define ProgramEnvParameter4dARB_remap_index 45 -#define ProgramEnvParameter4dvARB_remap_index 46 -#define ProgramEnvParameter4fARB_remap_index 47 -#define ProgramEnvParameter4fvARB_remap_index 48 -#define ProgramLocalParameter4dARB_remap_index 49 -#define ProgramLocalParameter4dvARB_remap_index 50 -#define ProgramLocalParameter4fARB_remap_index 51 -#define ProgramLocalParameter4fvARB_remap_index 52 -#define ProgramStringARB_remap_index 53 -#define VertexAttrib1dARB_remap_index 54 -#define VertexAttrib1dvARB_remap_index 55 -#define VertexAttrib1fARB_remap_index 56 -#define VertexAttrib1fvARB_remap_index 57 -#define VertexAttrib1sARB_remap_index 58 -#define VertexAttrib1svARB_remap_index 59 -#define VertexAttrib2dARB_remap_index 60 -#define VertexAttrib2dvARB_remap_index 61 -#define VertexAttrib2fARB_remap_index 62 -#define VertexAttrib2fvARB_remap_index 63 -#define VertexAttrib2sARB_remap_index 64 -#define VertexAttrib2svARB_remap_index 65 -#define VertexAttrib3dARB_remap_index 66 -#define VertexAttrib3dvARB_remap_index 67 -#define VertexAttrib3fARB_remap_index 68 -#define VertexAttrib3fvARB_remap_index 69 -#define VertexAttrib3sARB_remap_index 70 -#define VertexAttrib3svARB_remap_index 71 -#define VertexAttrib4NbvARB_remap_index 72 -#define VertexAttrib4NivARB_remap_index 73 -#define VertexAttrib4NsvARB_remap_index 74 -#define VertexAttrib4NubARB_remap_index 75 -#define VertexAttrib4NubvARB_remap_index 76 -#define VertexAttrib4NuivARB_remap_index 77 -#define VertexAttrib4NusvARB_remap_index 78 -#define VertexAttrib4bvARB_remap_index 79 -#define VertexAttrib4dARB_remap_index 80 -#define VertexAttrib4dvARB_remap_index 81 -#define VertexAttrib4fARB_remap_index 82 -#define VertexAttrib4fvARB_remap_index 83 -#define VertexAttrib4ivARB_remap_index 84 -#define VertexAttrib4sARB_remap_index 85 -#define VertexAttrib4svARB_remap_index 86 -#define VertexAttrib4ubvARB_remap_index 87 -#define VertexAttrib4uivARB_remap_index 88 -#define VertexAttrib4usvARB_remap_index 89 -#define VertexAttribPointerARB_remap_index 90 -#define BindBufferARB_remap_index 91 -#define BufferDataARB_remap_index 92 -#define BufferSubDataARB_remap_index 93 -#define DeleteBuffersARB_remap_index 94 -#define GenBuffersARB_remap_index 95 -#define GetBufferParameterivARB_remap_index 96 -#define GetBufferPointervARB_remap_index 97 -#define GetBufferSubDataARB_remap_index 98 -#define IsBufferARB_remap_index 99 -#define MapBufferARB_remap_index 100 -#define UnmapBufferARB_remap_index 101 -#define BeginQueryARB_remap_index 102 -#define DeleteQueriesARB_remap_index 103 -#define EndQueryARB_remap_index 104 -#define GenQueriesARB_remap_index 105 -#define GetQueryObjectivARB_remap_index 106 -#define GetQueryObjectuivARB_remap_index 107 -#define GetQueryivARB_remap_index 108 -#define IsQueryARB_remap_index 109 -#define AttachObjectARB_remap_index 110 -#define CompileShaderARB_remap_index 111 -#define CreateProgramObjectARB_remap_index 112 -#define CreateShaderObjectARB_remap_index 113 -#define DeleteObjectARB_remap_index 114 -#define DetachObjectARB_remap_index 115 -#define GetActiveUniformARB_remap_index 116 -#define GetAttachedObjectsARB_remap_index 117 -#define GetHandleARB_remap_index 118 -#define GetInfoLogARB_remap_index 119 -#define GetObjectParameterfvARB_remap_index 120 -#define GetObjectParameterivARB_remap_index 121 -#define GetShaderSourceARB_remap_index 122 -#define GetUniformLocationARB_remap_index 123 -#define GetUniformfvARB_remap_index 124 -#define GetUniformivARB_remap_index 125 -#define LinkProgramARB_remap_index 126 -#define ShaderSourceARB_remap_index 127 -#define Uniform1fARB_remap_index 128 -#define Uniform1fvARB_remap_index 129 -#define Uniform1iARB_remap_index 130 -#define Uniform1ivARB_remap_index 131 -#define Uniform2fARB_remap_index 132 -#define Uniform2fvARB_remap_index 133 -#define Uniform2iARB_remap_index 134 -#define Uniform2ivARB_remap_index 135 -#define Uniform3fARB_remap_index 136 -#define Uniform3fvARB_remap_index 137 -#define Uniform3iARB_remap_index 138 -#define Uniform3ivARB_remap_index 139 -#define Uniform4fARB_remap_index 140 -#define Uniform4fvARB_remap_index 141 -#define Uniform4iARB_remap_index 142 -#define Uniform4ivARB_remap_index 143 -#define UniformMatrix2fvARB_remap_index 144 -#define UniformMatrix3fvARB_remap_index 145 -#define UniformMatrix4fvARB_remap_index 146 -#define UseProgramObjectARB_remap_index 147 -#define ValidateProgramARB_remap_index 148 -#define BindAttribLocationARB_remap_index 149 -#define GetActiveAttribARB_remap_index 150 -#define GetAttribLocationARB_remap_index 151 -#define DrawBuffersARB_remap_index 152 -#define RenderbufferStorageMultisample_remap_index 153 -#define FlushMappedBufferRange_remap_index 154 -#define MapBufferRange_remap_index 155 -#define BindVertexArray_remap_index 156 -#define GenVertexArrays_remap_index 157 -#define CopyBufferSubData_remap_index 158 -#define ClientWaitSync_remap_index 159 -#define DeleteSync_remap_index 160 -#define FenceSync_remap_index 161 -#define GetInteger64v_remap_index 162 -#define GetSynciv_remap_index 163 -#define IsSync_remap_index 164 -#define WaitSync_remap_index 165 -#define PolygonOffsetEXT_remap_index 166 -#define GetPixelTexGenParameterfvSGIS_remap_index 167 -#define GetPixelTexGenParameterivSGIS_remap_index 168 -#define PixelTexGenParameterfSGIS_remap_index 169 -#define PixelTexGenParameterfvSGIS_remap_index 170 -#define PixelTexGenParameteriSGIS_remap_index 171 -#define PixelTexGenParameterivSGIS_remap_index 172 -#define SampleMaskSGIS_remap_index 173 -#define SamplePatternSGIS_remap_index 174 -#define ColorPointerEXT_remap_index 175 -#define EdgeFlagPointerEXT_remap_index 176 -#define IndexPointerEXT_remap_index 177 -#define NormalPointerEXT_remap_index 178 -#define TexCoordPointerEXT_remap_index 179 -#define VertexPointerEXT_remap_index 180 -#define PointParameterfEXT_remap_index 181 -#define PointParameterfvEXT_remap_index 182 -#define LockArraysEXT_remap_index 183 -#define UnlockArraysEXT_remap_index 184 -#define CullParameterdvEXT_remap_index 185 -#define CullParameterfvEXT_remap_index 186 -#define SecondaryColor3bEXT_remap_index 187 -#define SecondaryColor3bvEXT_remap_index 188 -#define SecondaryColor3dEXT_remap_index 189 -#define SecondaryColor3dvEXT_remap_index 190 -#define SecondaryColor3fEXT_remap_index 191 -#define SecondaryColor3fvEXT_remap_index 192 -#define SecondaryColor3iEXT_remap_index 193 -#define SecondaryColor3ivEXT_remap_index 194 -#define SecondaryColor3sEXT_remap_index 195 -#define SecondaryColor3svEXT_remap_index 196 -#define SecondaryColor3ubEXT_remap_index 197 -#define SecondaryColor3ubvEXT_remap_index 198 -#define SecondaryColor3uiEXT_remap_index 199 -#define SecondaryColor3uivEXT_remap_index 200 -#define SecondaryColor3usEXT_remap_index 201 -#define SecondaryColor3usvEXT_remap_index 202 -#define SecondaryColorPointerEXT_remap_index 203 -#define MultiDrawArraysEXT_remap_index 204 -#define MultiDrawElementsEXT_remap_index 205 -#define FogCoordPointerEXT_remap_index 206 -#define FogCoorddEXT_remap_index 207 -#define FogCoorddvEXT_remap_index 208 -#define FogCoordfEXT_remap_index 209 -#define FogCoordfvEXT_remap_index 210 -#define PixelTexGenSGIX_remap_index 211 -#define BlendFuncSeparateEXT_remap_index 212 -#define FlushVertexArrayRangeNV_remap_index 213 -#define VertexArrayRangeNV_remap_index 214 -#define CombinerInputNV_remap_index 215 -#define CombinerOutputNV_remap_index 216 -#define CombinerParameterfNV_remap_index 217 -#define CombinerParameterfvNV_remap_index 218 -#define CombinerParameteriNV_remap_index 219 -#define CombinerParameterivNV_remap_index 220 -#define FinalCombinerInputNV_remap_index 221 -#define GetCombinerInputParameterfvNV_remap_index 222 -#define GetCombinerInputParameterivNV_remap_index 223 -#define GetCombinerOutputParameterfvNV_remap_index 224 -#define GetCombinerOutputParameterivNV_remap_index 225 -#define GetFinalCombinerInputParameterfvNV_remap_index 226 -#define GetFinalCombinerInputParameterivNV_remap_index 227 -#define ResizeBuffersMESA_remap_index 228 -#define WindowPos2dMESA_remap_index 229 -#define WindowPos2dvMESA_remap_index 230 -#define WindowPos2fMESA_remap_index 231 -#define WindowPos2fvMESA_remap_index 232 -#define WindowPos2iMESA_remap_index 233 -#define WindowPos2ivMESA_remap_index 234 -#define WindowPos2sMESA_remap_index 235 -#define WindowPos2svMESA_remap_index 236 -#define WindowPos3dMESA_remap_index 237 -#define WindowPos3dvMESA_remap_index 238 -#define WindowPos3fMESA_remap_index 239 -#define WindowPos3fvMESA_remap_index 240 -#define WindowPos3iMESA_remap_index 241 -#define WindowPos3ivMESA_remap_index 242 -#define WindowPos3sMESA_remap_index 243 -#define WindowPos3svMESA_remap_index 244 -#define WindowPos4dMESA_remap_index 245 -#define WindowPos4dvMESA_remap_index 246 -#define WindowPos4fMESA_remap_index 247 -#define WindowPos4fvMESA_remap_index 248 -#define WindowPos4iMESA_remap_index 249 -#define WindowPos4ivMESA_remap_index 250 -#define WindowPos4sMESA_remap_index 251 -#define WindowPos4svMESA_remap_index 252 -#define MultiModeDrawArraysIBM_remap_index 253 -#define MultiModeDrawElementsIBM_remap_index 254 -#define DeleteFencesNV_remap_index 255 -#define FinishFenceNV_remap_index 256 -#define GenFencesNV_remap_index 257 -#define GetFenceivNV_remap_index 258 -#define IsFenceNV_remap_index 259 -#define SetFenceNV_remap_index 260 -#define TestFenceNV_remap_index 261 -#define AreProgramsResidentNV_remap_index 262 -#define BindProgramNV_remap_index 263 -#define DeleteProgramsNV_remap_index 264 -#define ExecuteProgramNV_remap_index 265 -#define GenProgramsNV_remap_index 266 -#define GetProgramParameterdvNV_remap_index 267 -#define GetProgramParameterfvNV_remap_index 268 -#define GetProgramStringNV_remap_index 269 -#define GetProgramivNV_remap_index 270 -#define GetTrackMatrixivNV_remap_index 271 -#define GetVertexAttribPointervNV_remap_index 272 -#define GetVertexAttribdvNV_remap_index 273 -#define GetVertexAttribfvNV_remap_index 274 -#define GetVertexAttribivNV_remap_index 275 -#define IsProgramNV_remap_index 276 -#define LoadProgramNV_remap_index 277 -#define ProgramParameters4dvNV_remap_index 278 -#define ProgramParameters4fvNV_remap_index 279 -#define RequestResidentProgramsNV_remap_index 280 -#define TrackMatrixNV_remap_index 281 -#define VertexAttrib1dNV_remap_index 282 -#define VertexAttrib1dvNV_remap_index 283 -#define VertexAttrib1fNV_remap_index 284 -#define VertexAttrib1fvNV_remap_index 285 -#define VertexAttrib1sNV_remap_index 286 -#define VertexAttrib1svNV_remap_index 287 -#define VertexAttrib2dNV_remap_index 288 -#define VertexAttrib2dvNV_remap_index 289 -#define VertexAttrib2fNV_remap_index 290 -#define VertexAttrib2fvNV_remap_index 291 -#define VertexAttrib2sNV_remap_index 292 -#define VertexAttrib2svNV_remap_index 293 -#define VertexAttrib3dNV_remap_index 294 -#define VertexAttrib3dvNV_remap_index 295 -#define VertexAttrib3fNV_remap_index 296 -#define VertexAttrib3fvNV_remap_index 297 -#define VertexAttrib3sNV_remap_index 298 -#define VertexAttrib3svNV_remap_index 299 -#define VertexAttrib4dNV_remap_index 300 -#define VertexAttrib4dvNV_remap_index 301 -#define VertexAttrib4fNV_remap_index 302 -#define VertexAttrib4fvNV_remap_index 303 -#define VertexAttrib4sNV_remap_index 304 -#define VertexAttrib4svNV_remap_index 305 -#define VertexAttrib4ubNV_remap_index 306 -#define VertexAttrib4ubvNV_remap_index 307 -#define VertexAttribPointerNV_remap_index 308 -#define VertexAttribs1dvNV_remap_index 309 -#define VertexAttribs1fvNV_remap_index 310 -#define VertexAttribs1svNV_remap_index 311 -#define VertexAttribs2dvNV_remap_index 312 -#define VertexAttribs2fvNV_remap_index 313 -#define VertexAttribs2svNV_remap_index 314 -#define VertexAttribs3dvNV_remap_index 315 -#define VertexAttribs3fvNV_remap_index 316 -#define VertexAttribs3svNV_remap_index 317 -#define VertexAttribs4dvNV_remap_index 318 -#define VertexAttribs4fvNV_remap_index 319 -#define VertexAttribs4svNV_remap_index 320 -#define VertexAttribs4ubvNV_remap_index 321 -#define GetTexBumpParameterfvATI_remap_index 322 -#define GetTexBumpParameterivATI_remap_index 323 -#define TexBumpParameterfvATI_remap_index 324 -#define TexBumpParameterivATI_remap_index 325 -#define AlphaFragmentOp1ATI_remap_index 326 -#define AlphaFragmentOp2ATI_remap_index 327 -#define AlphaFragmentOp3ATI_remap_index 328 -#define BeginFragmentShaderATI_remap_index 329 -#define BindFragmentShaderATI_remap_index 330 -#define ColorFragmentOp1ATI_remap_index 331 -#define ColorFragmentOp2ATI_remap_index 332 -#define ColorFragmentOp3ATI_remap_index 333 -#define DeleteFragmentShaderATI_remap_index 334 -#define EndFragmentShaderATI_remap_index 335 -#define GenFragmentShadersATI_remap_index 336 -#define PassTexCoordATI_remap_index 337 -#define SampleMapATI_remap_index 338 -#define SetFragmentShaderConstantATI_remap_index 339 -#define PointParameteriNV_remap_index 340 -#define PointParameterivNV_remap_index 341 -#define ActiveStencilFaceEXT_remap_index 342 -#define BindVertexArrayAPPLE_remap_index 343 -#define DeleteVertexArraysAPPLE_remap_index 344 -#define GenVertexArraysAPPLE_remap_index 345 -#define IsVertexArrayAPPLE_remap_index 346 -#define GetProgramNamedParameterdvNV_remap_index 347 -#define GetProgramNamedParameterfvNV_remap_index 348 -#define ProgramNamedParameter4dNV_remap_index 349 -#define ProgramNamedParameter4dvNV_remap_index 350 -#define ProgramNamedParameter4fNV_remap_index 351 -#define ProgramNamedParameter4fvNV_remap_index 352 -#define DepthBoundsEXT_remap_index 353 -#define BlendEquationSeparateEXT_remap_index 354 -#define BindFramebufferEXT_remap_index 355 -#define BindRenderbufferEXT_remap_index 356 -#define CheckFramebufferStatusEXT_remap_index 357 -#define DeleteFramebuffersEXT_remap_index 358 -#define DeleteRenderbuffersEXT_remap_index 359 -#define FramebufferRenderbufferEXT_remap_index 360 -#define FramebufferTexture1DEXT_remap_index 361 -#define FramebufferTexture2DEXT_remap_index 362 -#define FramebufferTexture3DEXT_remap_index 363 -#define GenFramebuffersEXT_remap_index 364 -#define GenRenderbuffersEXT_remap_index 365 -#define GenerateMipmapEXT_remap_index 366 -#define GetFramebufferAttachmentParameterivEXT_remap_index 367 -#define GetRenderbufferParameterivEXT_remap_index 368 -#define IsFramebufferEXT_remap_index 369 -#define IsRenderbufferEXT_remap_index 370 -#define RenderbufferStorageEXT_remap_index 371 -#define BlitFramebufferEXT_remap_index 372 -#define BufferParameteriAPPLE_remap_index 373 -#define FlushMappedBufferRangeAPPLE_remap_index 374 -#define FramebufferTextureLayerEXT_remap_index 375 -#define ProvokingVertexEXT_remap_index 376 -#define GetTexParameterPointervAPPLE_remap_index 377 -#define TextureRangeAPPLE_remap_index 378 -#define StencilFuncSeparateATI_remap_index 379 -#define ProgramEnvParameters4fvEXT_remap_index 380 -#define ProgramLocalParameters4fvEXT_remap_index 381 -#define GetQueryObjecti64vEXT_remap_index 382 -#define GetQueryObjectui64vEXT_remap_index 383 - -#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) -#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) -#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn) -#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters) -#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index]) -#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn) -#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters) -#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index]) -#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn) -#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters) -#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index]) -#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn) -#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters) -#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index]) -#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn) -#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters) -#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index]) -#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn) -#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters) -#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index]) -#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn) -#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters) -#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index]) -#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn) -#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters) -#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index]) -#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn) -#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters) -#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index]) -#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn) -#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters) -#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index]) -#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn) -#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters) -#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index]) -#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn) -#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters) -#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index]) -#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn) -#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) -#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) -#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) -#define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) -#define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) -#define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) -#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) -#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) -#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) -#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters) -#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index]) -#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn) -#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters) -#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index]) -#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn) -#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters) -#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index]) -#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn) -#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters) -#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index]) -#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn) -#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters) -#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index]) -#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn) -#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters) -#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index]) -#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn) -#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) -#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) -#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) -#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) -#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) -#define SET_LoadTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], fn) -#define CALL_MultTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], parameters) -#define GET_MultTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]) -#define SET_MultTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], fn) -#define CALL_MultTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], parameters) -#define GET_MultTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index]) -#define SET_MultTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], fn) -#define CALL_SampleCoverageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleCoverageARB_remap_index], parameters) -#define GET_SampleCoverageARB(disp) GET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index]) -#define SET_SampleCoverageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index], fn) -#define CALL_CompressedTexImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage1DARB_remap_index], parameters) -#define GET_CompressedTexImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index]) -#define SET_CompressedTexImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index], fn) -#define CALL_CompressedTexImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage2DARB_remap_index], parameters) -#define GET_CompressedTexImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index]) -#define SET_CompressedTexImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index], fn) -#define CALL_CompressedTexImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage3DARB_remap_index], parameters) -#define GET_CompressedTexImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index]) -#define SET_CompressedTexImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index], fn) -#define CALL_CompressedTexSubImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], parameters) -#define GET_CompressedTexSubImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index]) -#define SET_CompressedTexSubImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], fn) -#define CALL_CompressedTexSubImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], parameters) -#define GET_CompressedTexSubImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index]) -#define SET_CompressedTexSubImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], fn) -#define CALL_CompressedTexSubImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], parameters) -#define GET_CompressedTexSubImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index]) -#define SET_CompressedTexSubImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], fn) -#define CALL_GetCompressedTexImageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLvoid *)), driDispatchRemapTable[GetCompressedTexImageARB_remap_index], parameters) -#define GET_GetCompressedTexImageARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index]) -#define SET_GetCompressedTexImageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index], fn) -#define CALL_DisableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], parameters) -#define GET_DisableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index]) -#define SET_DisableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], fn) -#define CALL_EnableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], parameters) -#define GET_EnableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index]) -#define SET_EnableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], fn) -#define CALL_GetProgramEnvParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], parameters) -#define GET_GetProgramEnvParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index]) -#define SET_GetProgramEnvParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], fn) -#define CALL_GetProgramEnvParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], parameters) -#define GET_GetProgramEnvParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index]) -#define SET_GetProgramEnvParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], fn) -#define CALL_GetProgramLocalParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], parameters) -#define GET_GetProgramLocalParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index]) -#define SET_GetProgramLocalParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], fn) -#define CALL_GetProgramLocalParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], parameters) -#define GET_GetProgramLocalParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index]) -#define SET_GetProgramLocalParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], fn) -#define CALL_GetProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetProgramStringARB_remap_index], parameters) -#define GET_GetProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index]) -#define SET_GetProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index], fn) -#define CALL_GetProgramivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetProgramivARB_remap_index], parameters) -#define GET_GetProgramivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index]) -#define SET_GetProgramivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index], fn) -#define CALL_GetVertexAttribdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvARB_remap_index], parameters) -#define GET_GetVertexAttribdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index]) -#define SET_GetVertexAttribdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index], fn) -#define CALL_GetVertexAttribfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvARB_remap_index], parameters) -#define GET_GetVertexAttribfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index]) -#define SET_GetVertexAttribfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index], fn) -#define CALL_GetVertexAttribivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivARB_remap_index], parameters) -#define GET_GetVertexAttribivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index]) -#define SET_GetVertexAttribivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index], fn) -#define CALL_ProgramEnvParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], parameters) -#define GET_ProgramEnvParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index]) -#define SET_ProgramEnvParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], fn) -#define CALL_ProgramEnvParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], parameters) -#define GET_ProgramEnvParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index]) -#define SET_ProgramEnvParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], fn) -#define CALL_ProgramEnvParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], parameters) -#define GET_ProgramEnvParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index]) -#define SET_ProgramEnvParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], fn) -#define CALL_ProgramEnvParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], parameters) -#define GET_ProgramEnvParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index]) -#define SET_ProgramEnvParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], fn) -#define CALL_ProgramLocalParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], parameters) -#define GET_ProgramLocalParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index]) -#define SET_ProgramLocalParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], fn) -#define CALL_ProgramLocalParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], parameters) -#define GET_ProgramLocalParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index]) -#define SET_ProgramLocalParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], fn) -#define CALL_ProgramLocalParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], parameters) -#define GET_ProgramLocalParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index]) -#define SET_ProgramLocalParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], fn) -#define CALL_ProgramLocalParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], parameters) -#define GET_ProgramLocalParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index]) -#define SET_ProgramLocalParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], fn) -#define CALL_ProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[ProgramStringARB_remap_index], parameters) -#define GET_ProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index]) -#define SET_ProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index], fn) -#define CALL_VertexAttrib1dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dARB_remap_index], parameters) -#define GET_VertexAttrib1dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index]) -#define SET_VertexAttrib1dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index], fn) -#define CALL_VertexAttrib1dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvARB_remap_index], parameters) -#define GET_VertexAttrib1dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index]) -#define SET_VertexAttrib1dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index], fn) -#define CALL_VertexAttrib1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fARB_remap_index], parameters) -#define GET_VertexAttrib1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index]) -#define SET_VertexAttrib1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index], fn) -#define CALL_VertexAttrib1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvARB_remap_index], parameters) -#define GET_VertexAttrib1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index]) -#define SET_VertexAttrib1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index], fn) -#define CALL_VertexAttrib1sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sARB_remap_index], parameters) -#define GET_VertexAttrib1sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index]) -#define SET_VertexAttrib1sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index], fn) -#define CALL_VertexAttrib1svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svARB_remap_index], parameters) -#define GET_VertexAttrib1svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index]) -#define SET_VertexAttrib1svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index], fn) -#define CALL_VertexAttrib2dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dARB_remap_index], parameters) -#define GET_VertexAttrib2dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index]) -#define SET_VertexAttrib2dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index], fn) -#define CALL_VertexAttrib2dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvARB_remap_index], parameters) -#define GET_VertexAttrib2dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index]) -#define SET_VertexAttrib2dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index], fn) -#define CALL_VertexAttrib2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fARB_remap_index], parameters) -#define GET_VertexAttrib2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index]) -#define SET_VertexAttrib2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index], fn) -#define CALL_VertexAttrib2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvARB_remap_index], parameters) -#define GET_VertexAttrib2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index]) -#define SET_VertexAttrib2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index], fn) -#define CALL_VertexAttrib2sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sARB_remap_index], parameters) -#define GET_VertexAttrib2sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index]) -#define SET_VertexAttrib2sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index], fn) -#define CALL_VertexAttrib2svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svARB_remap_index], parameters) -#define GET_VertexAttrib2svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index]) -#define SET_VertexAttrib2svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index], fn) -#define CALL_VertexAttrib3dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dARB_remap_index], parameters) -#define GET_VertexAttrib3dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index]) -#define SET_VertexAttrib3dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index], fn) -#define CALL_VertexAttrib3dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvARB_remap_index], parameters) -#define GET_VertexAttrib3dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index]) -#define SET_VertexAttrib3dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index], fn) -#define CALL_VertexAttrib3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fARB_remap_index], parameters) -#define GET_VertexAttrib3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index]) -#define SET_VertexAttrib3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index], fn) -#define CALL_VertexAttrib3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvARB_remap_index], parameters) -#define GET_VertexAttrib3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index]) -#define SET_VertexAttrib3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index], fn) -#define CALL_VertexAttrib3sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sARB_remap_index], parameters) -#define GET_VertexAttrib3sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index]) -#define SET_VertexAttrib3sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index], fn) -#define CALL_VertexAttrib3svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svARB_remap_index], parameters) -#define GET_VertexAttrib3svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index]) -#define SET_VertexAttrib3svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index], fn) -#define CALL_VertexAttrib4NbvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], parameters) -#define GET_VertexAttrib4NbvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index]) -#define SET_VertexAttrib4NbvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], fn) -#define CALL_VertexAttrib4NivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4NivARB_remap_index], parameters) -#define GET_VertexAttrib4NivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index]) -#define SET_VertexAttrib4NivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index], fn) -#define CALL_VertexAttrib4NsvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], parameters) -#define GET_VertexAttrib4NsvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index]) -#define SET_VertexAttrib4NsvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], fn) -#define CALL_VertexAttrib4NubARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4NubARB_remap_index], parameters) -#define GET_VertexAttrib4NubARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index]) -#define SET_VertexAttrib4NubARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index], fn) -#define CALL_VertexAttrib4NubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], parameters) -#define GET_VertexAttrib4NubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index]) -#define SET_VertexAttrib4NubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], fn) -#define CALL_VertexAttrib4NuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], parameters) -#define GET_VertexAttrib4NuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index]) -#define SET_VertexAttrib4NuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], fn) -#define CALL_VertexAttrib4NusvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], parameters) -#define GET_VertexAttrib4NusvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index]) -#define SET_VertexAttrib4NusvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], fn) -#define CALL_VertexAttrib4bvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4bvARB_remap_index], parameters) -#define GET_VertexAttrib4bvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index]) -#define SET_VertexAttrib4bvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index], fn) -#define CALL_VertexAttrib4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dARB_remap_index], parameters) -#define GET_VertexAttrib4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index]) -#define SET_VertexAttrib4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index], fn) -#define CALL_VertexAttrib4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvARB_remap_index], parameters) -#define GET_VertexAttrib4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index]) -#define SET_VertexAttrib4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index], fn) -#define CALL_VertexAttrib4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fARB_remap_index], parameters) -#define GET_VertexAttrib4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index]) -#define SET_VertexAttrib4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index], fn) -#define CALL_VertexAttrib4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvARB_remap_index], parameters) -#define GET_VertexAttrib4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index]) -#define SET_VertexAttrib4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index], fn) -#define CALL_VertexAttrib4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4ivARB_remap_index], parameters) -#define GET_VertexAttrib4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index]) -#define SET_VertexAttrib4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index], fn) -#define CALL_VertexAttrib4sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sARB_remap_index], parameters) -#define GET_VertexAttrib4sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index]) -#define SET_VertexAttrib4sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index], fn) -#define CALL_VertexAttrib4svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svARB_remap_index], parameters) -#define GET_VertexAttrib4svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index]) -#define SET_VertexAttrib4svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index], fn) -#define CALL_VertexAttrib4ubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], parameters) -#define GET_VertexAttrib4ubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index]) -#define SET_VertexAttrib4ubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], fn) -#define CALL_VertexAttrib4uivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4uivARB_remap_index], parameters) -#define GET_VertexAttrib4uivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index]) -#define SET_VertexAttrib4uivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index], fn) -#define CALL_VertexAttrib4usvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4usvARB_remap_index], parameters) -#define GET_VertexAttrib4usvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index]) -#define SET_VertexAttrib4usvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index], fn) -#define CALL_VertexAttribPointerARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerARB_remap_index], parameters) -#define GET_VertexAttribPointerARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index]) -#define SET_VertexAttribPointerARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index], fn) -#define CALL_BindBufferARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindBufferARB_remap_index], parameters) -#define GET_BindBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index]) -#define SET_BindBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index], fn) -#define CALL_BufferDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)), driDispatchRemapTable[BufferDataARB_remap_index], parameters) -#define GET_BufferDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index]) -#define SET_BufferDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index], fn) -#define CALL_BufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)), driDispatchRemapTable[BufferSubDataARB_remap_index], parameters) -#define GET_BufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index]) -#define SET_BufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index], fn) -#define CALL_DeleteBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteBuffersARB_remap_index], parameters) -#define GET_DeleteBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index]) -#define SET_DeleteBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index], fn) -#define CALL_GenBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenBuffersARB_remap_index], parameters) -#define GET_GenBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index]) -#define SET_GenBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index], fn) -#define CALL_GetBufferParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetBufferParameterivARB_remap_index], parameters) -#define GET_GetBufferParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index]) -#define SET_GetBufferParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index], fn) -#define CALL_GetBufferPointervARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetBufferPointervARB_remap_index], parameters) -#define GET_GetBufferPointervARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index]) -#define SET_GetBufferPointervARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index], fn) -#define CALL_GetBufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)), driDispatchRemapTable[GetBufferSubDataARB_remap_index], parameters) -#define GET_GetBufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index]) -#define SET_GetBufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index], fn) -#define CALL_IsBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsBufferARB_remap_index], parameters) -#define GET_IsBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index]) -#define SET_IsBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index], fn) -#define CALL_MapBufferARB(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[MapBufferARB_remap_index], parameters) -#define GET_MapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index]) -#define SET_MapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index], fn) -#define CALL_UnmapBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[UnmapBufferARB_remap_index], parameters) -#define GET_UnmapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index]) -#define SET_UnmapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index], fn) -#define CALL_BeginQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BeginQueryARB_remap_index], parameters) -#define GET_BeginQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index]) -#define SET_BeginQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index], fn) -#define CALL_DeleteQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteQueriesARB_remap_index], parameters) -#define GET_DeleteQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index]) -#define SET_DeleteQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index], fn) -#define CALL_EndQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[EndQueryARB_remap_index], parameters) -#define GET_EndQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index]) -#define SET_EndQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index], fn) -#define CALL_GenQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenQueriesARB_remap_index], parameters) -#define GET_GenQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index]) -#define SET_GenQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index], fn) -#define CALL_GetQueryObjectivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetQueryObjectivARB_remap_index], parameters) -#define GET_GetQueryObjectivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index]) -#define SET_GetQueryObjectivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index], fn) -#define CALL_GetQueryObjectuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint *)), driDispatchRemapTable[GetQueryObjectuivARB_remap_index], parameters) -#define GET_GetQueryObjectuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index]) -#define SET_GetQueryObjectuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index], fn) -#define CALL_GetQueryivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetQueryivARB_remap_index], parameters) -#define GET_GetQueryivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index]) -#define SET_GetQueryivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index], fn) -#define CALL_IsQueryARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsQueryARB_remap_index], parameters) -#define GET_IsQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index]) -#define SET_IsQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index], fn) -#define CALL_AttachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[AttachObjectARB_remap_index], parameters) -#define GET_AttachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index]) -#define SET_AttachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index], fn) -#define CALL_CompileShaderARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[CompileShaderARB_remap_index], parameters) -#define GET_CompileShaderARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index]) -#define SET_CompileShaderARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index], fn) -#define CALL_CreateProgramObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgramObjectARB_remap_index], parameters) -#define GET_CreateProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index]) -#define SET_CreateProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index], fn) -#define CALL_CreateShaderObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShaderObjectARB_remap_index], parameters) -#define GET_CreateShaderObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index]) -#define SET_CreateShaderObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index], fn) -#define CALL_DeleteObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[DeleteObjectARB_remap_index], parameters) -#define GET_DeleteObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index]) -#define SET_DeleteObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index], fn) -#define CALL_DetachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[DetachObjectARB_remap_index], parameters) -#define GET_DetachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index]) -#define SET_DetachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index], fn) -#define CALL_GetActiveUniformARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveUniformARB_remap_index], parameters) -#define GET_GetActiveUniformARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index]) -#define SET_GetActiveUniformARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index], fn) -#define CALL_GetAttachedObjectsARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *)), driDispatchRemapTable[GetAttachedObjectsARB_remap_index], parameters) -#define GET_GetAttachedObjectsARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index]) -#define SET_GetAttachedObjectsARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index], fn) -#define CALL_GetHandleARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GetHandleARB_remap_index], parameters) -#define GET_GetHandleARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index]) -#define SET_GetHandleARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index], fn) -#define CALL_GetInfoLogARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetInfoLogARB_remap_index], parameters) -#define GET_GetInfoLogARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index]) -#define SET_GetInfoLogARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index], fn) -#define CALL_GetObjectParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLfloat *)), driDispatchRemapTable[GetObjectParameterfvARB_remap_index], parameters) -#define GET_GetObjectParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index]) -#define SET_GetObjectParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index], fn) -#define CALL_GetObjectParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivARB_remap_index], parameters) -#define GET_GetObjectParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index]) -#define SET_GetObjectParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index], fn) -#define CALL_GetShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetShaderSourceARB_remap_index], parameters) -#define GET_GetShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index]) -#define SET_GetShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index], fn) -#define CALL_GetUniformLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetUniformLocationARB_remap_index], parameters) -#define GET_GetUniformLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index]) -#define SET_GetUniformLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index], fn) -#define CALL_GetUniformfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLfloat *)), driDispatchRemapTable[GetUniformfvARB_remap_index], parameters) -#define GET_GetUniformfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index]) -#define SET_GetUniformfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index], fn) -#define CALL_GetUniformivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLint *)), driDispatchRemapTable[GetUniformivARB_remap_index], parameters) -#define GET_GetUniformivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index]) -#define SET_GetUniformivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index], fn) -#define CALL_LinkProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[LinkProgramARB_remap_index], parameters) -#define GET_LinkProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index]) -#define SET_LinkProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index], fn) -#define CALL_ShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)), driDispatchRemapTable[ShaderSourceARB_remap_index], parameters) -#define GET_ShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index]) -#define SET_ShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index], fn) -#define CALL_Uniform1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat)), driDispatchRemapTable[Uniform1fARB_remap_index], parameters) -#define GET_Uniform1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index]) -#define SET_Uniform1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index], fn) -#define CALL_Uniform1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform1fvARB_remap_index], parameters) -#define GET_Uniform1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index]) -#define SET_Uniform1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index], fn) -#define CALL_Uniform1iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[Uniform1iARB_remap_index], parameters) -#define GET_Uniform1iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index]) -#define SET_Uniform1iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index], fn) -#define CALL_Uniform1ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform1ivARB_remap_index], parameters) -#define GET_Uniform1ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index]) -#define SET_Uniform1ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index], fn) -#define CALL_Uniform2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat)), driDispatchRemapTable[Uniform2fARB_remap_index], parameters) -#define GET_Uniform2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index]) -#define SET_Uniform2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index], fn) -#define CALL_Uniform2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform2fvARB_remap_index], parameters) -#define GET_Uniform2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index]) -#define SET_Uniform2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index], fn) -#define CALL_Uniform2iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[Uniform2iARB_remap_index], parameters) -#define GET_Uniform2iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index]) -#define SET_Uniform2iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index], fn) -#define CALL_Uniform2ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform2ivARB_remap_index], parameters) -#define GET_Uniform2ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index]) -#define SET_Uniform2ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index], fn) -#define CALL_Uniform3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform3fARB_remap_index], parameters) -#define GET_Uniform3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index]) -#define SET_Uniform3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index], fn) -#define CALL_Uniform3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform3fvARB_remap_index], parameters) -#define GET_Uniform3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index]) -#define SET_Uniform3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index], fn) -#define CALL_Uniform3iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform3iARB_remap_index], parameters) -#define GET_Uniform3iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index]) -#define SET_Uniform3iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index], fn) -#define CALL_Uniform3ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform3ivARB_remap_index], parameters) -#define GET_Uniform3ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index]) -#define SET_Uniform3ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index], fn) -#define CALL_Uniform4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform4fARB_remap_index], parameters) -#define GET_Uniform4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index]) -#define SET_Uniform4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index], fn) -#define CALL_Uniform4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform4fvARB_remap_index], parameters) -#define GET_Uniform4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index]) -#define SET_Uniform4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index], fn) -#define CALL_Uniform4iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform4iARB_remap_index], parameters) -#define GET_Uniform4iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index]) -#define SET_Uniform4iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index], fn) -#define CALL_Uniform4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform4ivARB_remap_index], parameters) -#define GET_Uniform4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index]) -#define SET_Uniform4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index], fn) -#define CALL_UniformMatrix2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2fvARB_remap_index], parameters) -#define GET_UniformMatrix2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index]) -#define SET_UniformMatrix2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index], fn) -#define CALL_UniformMatrix3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3fvARB_remap_index], parameters) -#define GET_UniformMatrix3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index]) -#define SET_UniformMatrix3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index], fn) -#define CALL_UniformMatrix4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4fvARB_remap_index], parameters) -#define GET_UniformMatrix4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index]) -#define SET_UniformMatrix4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index], fn) -#define CALL_UseProgramObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[UseProgramObjectARB_remap_index], parameters) -#define GET_UseProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index]) -#define SET_UseProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index], fn) -#define CALL_ValidateProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[ValidateProgramARB_remap_index], parameters) -#define GET_ValidateProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index]) -#define SET_ValidateProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index], fn) -#define CALL_BindAttribLocationARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, const GLcharARB *)), driDispatchRemapTable[BindAttribLocationARB_remap_index], parameters) -#define GET_BindAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index]) -#define SET_BindAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index], fn) -#define CALL_GetActiveAttribARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveAttribARB_remap_index], parameters) -#define GET_GetActiveAttribARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index]) -#define SET_GetActiveAttribARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index], fn) -#define CALL_GetAttribLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetAttribLocationARB_remap_index], parameters) -#define GET_GetAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index]) -#define SET_GetAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index], fn) -#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters) -#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index]) -#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn) -#define CALL_RenderbufferStorageMultisample(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], parameters) -#define GET_RenderbufferStorageMultisample(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index]) -#define SET_RenderbufferStorageMultisample(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], fn) -#define CALL_FlushMappedBufferRange(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRange_remap_index], parameters) -#define GET_FlushMappedBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index]) -#define SET_FlushMappedBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index], fn) -#define CALL_MapBufferRange(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr, GLbitfield)), driDispatchRemapTable[MapBufferRange_remap_index], parameters) -#define GET_MapBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index]) -#define SET_MapBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index], fn) -#define CALL_BindVertexArray(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArray_remap_index], parameters) -#define GET_BindVertexArray(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index]) -#define SET_BindVertexArray(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index], fn) -#define CALL_GenVertexArrays(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArrays_remap_index], parameters) -#define GET_GenVertexArrays(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index]) -#define SET_GenVertexArrays(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index], fn) -#define CALL_CopyBufferSubData(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr)), driDispatchRemapTable[CopyBufferSubData_remap_index], parameters) -#define GET_CopyBufferSubData(disp) GET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index]) -#define SET_CopyBufferSubData(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index], fn) -#define CALL_ClientWaitSync(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[ClientWaitSync_remap_index], parameters) -#define GET_ClientWaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index]) -#define SET_ClientWaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index], fn) -#define CALL_DeleteSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[DeleteSync_remap_index], parameters) -#define GET_DeleteSync(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index]) -#define SET_DeleteSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index], fn) -#define CALL_FenceSync(disp, parameters) CALL_by_offset(disp, (GLsync (GLAPIENTRYP)(GLenum, GLbitfield)), driDispatchRemapTable[FenceSync_remap_index], parameters) -#define GET_FenceSync(disp) GET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index]) -#define SET_FenceSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index], fn) -#define CALL_GetInteger64v(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint64 *)), driDispatchRemapTable[GetInteger64v_remap_index], parameters) -#define GET_GetInteger64v(disp) GET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index]) -#define SET_GetInteger64v(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index], fn) -#define CALL_GetSynciv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLenum, GLsizei, GLsizei *, GLint *)), driDispatchRemapTable[GetSynciv_remap_index], parameters) -#define GET_GetSynciv(disp) GET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index]) -#define SET_GetSynciv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index], fn) -#define CALL_IsSync(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[IsSync_remap_index], parameters) -#define GET_IsSync(disp) GET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index]) -#define SET_IsSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index], fn) -#define CALL_WaitSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[WaitSync_remap_index], parameters) -#define GET_WaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index]) -#define SET_WaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index], fn) -#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) -#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) -#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) -#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) -#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) -#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) -#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], parameters) -#define GET_GetPixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]) -#define SET_GetPixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterfSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterfSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]) -#define SET_PixelTexGenParameterfSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]) -#define SET_PixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], fn) -#define CALL_PixelTexGenParameteriSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], parameters) -#define GET_PixelTexGenParameteriSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]) -#define SET_PixelTexGenParameteriSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) -#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) -#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) -#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) -#define CALL_SamplePatternSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[SamplePatternSGIS_remap_index], parameters) -#define GET_SamplePatternSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index]) -#define SET_SamplePatternSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index], fn) -#define CALL_ColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[ColorPointerEXT_remap_index], parameters) -#define GET_ColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index]) -#define SET_ColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index], fn) -#define CALL_EdgeFlagPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLsizei, const GLboolean *)), driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], parameters) -#define GET_EdgeFlagPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index]) -#define SET_EdgeFlagPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], fn) -#define CALL_IndexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[IndexPointerEXT_remap_index], parameters) -#define GET_IndexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index]) -#define SET_IndexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index], fn) -#define CALL_NormalPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[NormalPointerEXT_remap_index], parameters) -#define GET_NormalPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index]) -#define SET_NormalPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index], fn) -#define CALL_TexCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[TexCoordPointerEXT_remap_index], parameters) -#define GET_TexCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index]) -#define SET_TexCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index], fn) -#define CALL_VertexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexPointerEXT_remap_index], parameters) -#define GET_VertexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index]) -#define SET_VertexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index], fn) -#define CALL_PointParameterfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PointParameterfEXT_remap_index], parameters) -#define GET_PointParameterfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index]) -#define SET_PointParameterfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index], fn) -#define CALL_PointParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PointParameterfvEXT_remap_index], parameters) -#define GET_PointParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index]) -#define SET_PointParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index], fn) -#define CALL_LockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei)), driDispatchRemapTable[LockArraysEXT_remap_index], parameters) -#define GET_LockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index]) -#define SET_LockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index], fn) -#define CALL_UnlockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[UnlockArraysEXT_remap_index], parameters) -#define GET_UnlockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index]) -#define SET_UnlockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index], fn) -#define CALL_CullParameterdvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLdouble *)), driDispatchRemapTable[CullParameterdvEXT_remap_index], parameters) -#define GET_CullParameterdvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index]) -#define SET_CullParameterdvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index], fn) -#define CALL_CullParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[CullParameterfvEXT_remap_index], parameters) -#define GET_CullParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index]) -#define SET_CullParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index], fn) -#define CALL_SecondaryColor3bEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLbyte, GLbyte, GLbyte)), driDispatchRemapTable[SecondaryColor3bEXT_remap_index], parameters) -#define GET_SecondaryColor3bEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index]) -#define SET_SecondaryColor3bEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index], fn) -#define CALL_SecondaryColor3bvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLbyte *)), driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], parameters) -#define GET_SecondaryColor3bvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index]) -#define SET_SecondaryColor3bvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], fn) -#define CALL_SecondaryColor3dEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[SecondaryColor3dEXT_remap_index], parameters) -#define GET_SecondaryColor3dEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index]) -#define SET_SecondaryColor3dEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index], fn) -#define CALL_SecondaryColor3dvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], parameters) -#define GET_SecondaryColor3dvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index]) -#define SET_SecondaryColor3dvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], fn) -#define CALL_SecondaryColor3fEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[SecondaryColor3fEXT_remap_index], parameters) -#define GET_SecondaryColor3fEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index]) -#define SET_SecondaryColor3fEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index], fn) -#define CALL_SecondaryColor3fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], parameters) -#define GET_SecondaryColor3fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index]) -#define SET_SecondaryColor3fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], fn) -#define CALL_SecondaryColor3iEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[SecondaryColor3iEXT_remap_index], parameters) -#define GET_SecondaryColor3iEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index]) -#define SET_SecondaryColor3iEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index], fn) -#define CALL_SecondaryColor3ivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], parameters) -#define GET_SecondaryColor3ivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index]) -#define SET_SecondaryColor3ivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], fn) -#define CALL_SecondaryColor3sEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[SecondaryColor3sEXT_remap_index], parameters) -#define GET_SecondaryColor3sEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index]) -#define SET_SecondaryColor3sEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index], fn) -#define CALL_SecondaryColor3svEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[SecondaryColor3svEXT_remap_index], parameters) -#define GET_SecondaryColor3svEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index]) -#define SET_SecondaryColor3svEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index], fn) -#define CALL_SecondaryColor3ubEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], parameters) -#define GET_SecondaryColor3ubEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index]) -#define SET_SecondaryColor3ubEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], fn) -#define CALL_SecondaryColor3ubvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLubyte *)), driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], parameters) -#define GET_SecondaryColor3ubvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index]) -#define SET_SecondaryColor3ubvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], fn) -#define CALL_SecondaryColor3uiEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLuint)), driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], parameters) -#define GET_SecondaryColor3uiEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index]) -#define SET_SecondaryColor3uiEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], fn) -#define CALL_SecondaryColor3uivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLuint *)), driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], parameters) -#define GET_SecondaryColor3uivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index]) -#define SET_SecondaryColor3uivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], fn) -#define CALL_SecondaryColor3usEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLushort, GLushort, GLushort)), driDispatchRemapTable[SecondaryColor3usEXT_remap_index], parameters) -#define GET_SecondaryColor3usEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index]) -#define SET_SecondaryColor3usEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index], fn) -#define CALL_SecondaryColor3usvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLushort *)), driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], parameters) -#define GET_SecondaryColor3usvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index]) -#define SET_SecondaryColor3usvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], fn) -#define CALL_SecondaryColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], parameters) -#define GET_SecondaryColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index]) -#define SET_SecondaryColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], fn) -#define CALL_MultiDrawArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *, GLsizei *, GLsizei)), driDispatchRemapTable[MultiDrawArraysEXT_remap_index], parameters) -#define GET_MultiDrawArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index]) -#define SET_MultiDrawArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index], fn) -#define CALL_MultiDrawElementsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)), driDispatchRemapTable[MultiDrawElementsEXT_remap_index], parameters) -#define GET_MultiDrawElementsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index]) -#define SET_MultiDrawElementsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index], fn) -#define CALL_FogCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[FogCoordPointerEXT_remap_index], parameters) -#define GET_FogCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index]) -#define SET_FogCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index], fn) -#define CALL_FogCoorddEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble)), driDispatchRemapTable[FogCoorddEXT_remap_index], parameters) -#define GET_FogCoorddEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index]) -#define SET_FogCoorddEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index], fn) -#define CALL_FogCoorddvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[FogCoorddvEXT_remap_index], parameters) -#define GET_FogCoorddvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index]) -#define SET_FogCoorddvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index], fn) -#define CALL_FogCoordfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[FogCoordfEXT_remap_index], parameters) -#define GET_FogCoordfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index]) -#define SET_FogCoordfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index], fn) -#define CALL_FogCoordfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[FogCoordfvEXT_remap_index], parameters) -#define GET_FogCoordfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index]) -#define SET_FogCoordfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index], fn) -#define CALL_PixelTexGenSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[PixelTexGenSGIX_remap_index], parameters) -#define GET_PixelTexGenSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index]) -#define SET_PixelTexGenSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index], fn) -#define CALL_BlendFuncSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], parameters) -#define GET_BlendFuncSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index]) -#define SET_BlendFuncSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], fn) -#define CALL_FlushVertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], parameters) -#define GET_FlushVertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index]) -#define SET_FlushVertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], fn) -#define CALL_VertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLvoid *)), driDispatchRemapTable[VertexArrayRangeNV_remap_index], parameters) -#define GET_VertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index]) -#define SET_VertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index], fn) -#define CALL_CombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[CombinerInputNV_remap_index], parameters) -#define GET_CombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index]) -#define SET_CombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index], fn) -#define CALL_CombinerOutputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean)), driDispatchRemapTable[CombinerOutputNV_remap_index], parameters) -#define GET_CombinerOutputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index]) -#define SET_CombinerOutputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index], fn) -#define CALL_CombinerParameterfNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[CombinerParameterfNV_remap_index], parameters) -#define GET_CombinerParameterfNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index]) -#define SET_CombinerParameterfNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index], fn) -#define CALL_CombinerParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[CombinerParameterfvNV_remap_index], parameters) -#define GET_CombinerParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index]) -#define SET_CombinerParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index], fn) -#define CALL_CombinerParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[CombinerParameteriNV_remap_index], parameters) -#define GET_CombinerParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index]) -#define SET_CombinerParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index], fn) -#define CALL_CombinerParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[CombinerParameterivNV_remap_index], parameters) -#define GET_CombinerParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index]) -#define SET_CombinerParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index], fn) -#define CALL_FinalCombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[FinalCombinerInputNV_remap_index], parameters) -#define GET_FinalCombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index]) -#define SET_FinalCombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index], fn) -#define CALL_GetCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], parameters) -#define GET_GetCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index]) -#define SET_GetCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], fn) -#define CALL_GetCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], parameters) -#define GET_GetCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index]) -#define SET_GetCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], fn) -#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], parameters) -#define GET_GetCombinerOutputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index]) -#define SET_GetCombinerOutputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], fn) -#define CALL_GetCombinerOutputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], parameters) -#define GET_GetCombinerOutputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index]) -#define SET_GetCombinerOutputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], fn) -#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], parameters) -#define GET_GetFinalCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index]) -#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], fn) -#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], parameters) -#define GET_GetFinalCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index]) -#define SET_GetFinalCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], fn) -#define CALL_ResizeBuffersMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[ResizeBuffersMESA_remap_index], parameters) -#define GET_ResizeBuffersMESA(disp) GET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index]) -#define SET_ResizeBuffersMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index], fn) -#define CALL_WindowPos2dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble)), driDispatchRemapTable[WindowPos2dMESA_remap_index], parameters) -#define GET_WindowPos2dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index]) -#define SET_WindowPos2dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index], fn) -#define CALL_WindowPos2dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos2dvMESA_remap_index], parameters) -#define GET_WindowPos2dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index]) -#define SET_WindowPos2dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index], fn) -#define CALL_WindowPos2fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[WindowPos2fMESA_remap_index], parameters) -#define GET_WindowPos2fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index]) -#define SET_WindowPos2fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index], fn) -#define CALL_WindowPos2fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos2fvMESA_remap_index], parameters) -#define GET_WindowPos2fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index]) -#define SET_WindowPos2fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index], fn) -#define CALL_WindowPos2iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[WindowPos2iMESA_remap_index], parameters) -#define GET_WindowPos2iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index]) -#define SET_WindowPos2iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index], fn) -#define CALL_WindowPos2ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos2ivMESA_remap_index], parameters) -#define GET_WindowPos2ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index]) -#define SET_WindowPos2ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index], fn) -#define CALL_WindowPos2sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort)), driDispatchRemapTable[WindowPos2sMESA_remap_index], parameters) -#define GET_WindowPos2sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index]) -#define SET_WindowPos2sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index], fn) -#define CALL_WindowPos2svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos2svMESA_remap_index], parameters) -#define GET_WindowPos2svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index]) -#define SET_WindowPos2svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index], fn) -#define CALL_WindowPos3dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos3dMESA_remap_index], parameters) -#define GET_WindowPos3dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index]) -#define SET_WindowPos3dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index], fn) -#define CALL_WindowPos3dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos3dvMESA_remap_index], parameters) -#define GET_WindowPos3dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index]) -#define SET_WindowPos3dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index], fn) -#define CALL_WindowPos3fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos3fMESA_remap_index], parameters) -#define GET_WindowPos3fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index]) -#define SET_WindowPos3fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index], fn) -#define CALL_WindowPos3fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos3fvMESA_remap_index], parameters) -#define GET_WindowPos3fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index]) -#define SET_WindowPos3fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index], fn) -#define CALL_WindowPos3iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[WindowPos3iMESA_remap_index], parameters) -#define GET_WindowPos3iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index]) -#define SET_WindowPos3iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index], fn) -#define CALL_WindowPos3ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos3ivMESA_remap_index], parameters) -#define GET_WindowPos3ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index]) -#define SET_WindowPos3ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index], fn) -#define CALL_WindowPos3sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos3sMESA_remap_index], parameters) -#define GET_WindowPos3sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index]) -#define SET_WindowPos3sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index], fn) -#define CALL_WindowPos3svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos3svMESA_remap_index], parameters) -#define GET_WindowPos3svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index]) -#define SET_WindowPos3svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index], fn) -#define CALL_WindowPos4dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos4dMESA_remap_index], parameters) -#define GET_WindowPos4dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index]) -#define SET_WindowPos4dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index], fn) -#define CALL_WindowPos4dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos4dvMESA_remap_index], parameters) -#define GET_WindowPos4dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index]) -#define SET_WindowPos4dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index], fn) -#define CALL_WindowPos4fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos4fMESA_remap_index], parameters) -#define GET_WindowPos4fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index]) -#define SET_WindowPos4fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index], fn) -#define CALL_WindowPos4fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos4fvMESA_remap_index], parameters) -#define GET_WindowPos4fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index]) -#define SET_WindowPos4fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index], fn) -#define CALL_WindowPos4iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[WindowPos4iMESA_remap_index], parameters) -#define GET_WindowPos4iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index]) -#define SET_WindowPos4iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index], fn) -#define CALL_WindowPos4ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos4ivMESA_remap_index], parameters) -#define GET_WindowPos4ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index]) -#define SET_WindowPos4ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index], fn) -#define CALL_WindowPos4sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos4sMESA_remap_index], parameters) -#define GET_WindowPos4sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index]) -#define SET_WindowPos4sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index], fn) -#define CALL_WindowPos4svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos4svMESA_remap_index], parameters) -#define GET_WindowPos4svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index]) -#define SET_WindowPos4svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index], fn) -#define CALL_MultiModeDrawArraysIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], parameters) -#define GET_MultiModeDrawArraysIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index]) -#define SET_MultiModeDrawArraysIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], fn) -#define CALL_MultiModeDrawElementsIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], parameters) -#define GET_MultiModeDrawElementsIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index]) -#define SET_MultiModeDrawElementsIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], fn) -#define CALL_DeleteFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFencesNV_remap_index], parameters) -#define GET_DeleteFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index]) -#define SET_DeleteFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index], fn) -#define CALL_FinishFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[FinishFenceNV_remap_index], parameters) -#define GET_FinishFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index]) -#define SET_FinishFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index], fn) -#define CALL_GenFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFencesNV_remap_index], parameters) -#define GET_GenFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index]) -#define SET_GenFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index], fn) -#define CALL_GetFenceivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetFenceivNV_remap_index], parameters) -#define GET_GetFenceivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index]) -#define SET_GetFenceivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index], fn) -#define CALL_IsFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFenceNV_remap_index], parameters) -#define GET_IsFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index]) -#define SET_IsFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index], fn) -#define CALL_SetFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum)), driDispatchRemapTable[SetFenceNV_remap_index], parameters) -#define GET_SetFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index]) -#define SET_SetFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index], fn) -#define CALL_TestFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TestFenceNV_remap_index], parameters) -#define GET_TestFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index]) -#define SET_TestFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index], fn) -#define CALL_AreProgramsResidentNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreProgramsResidentNV_remap_index], parameters) -#define GET_AreProgramsResidentNV(disp) GET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index]) -#define SET_AreProgramsResidentNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index], fn) -#define CALL_BindProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindProgramNV_remap_index], parameters) -#define GET_BindProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index]) -#define SET_BindProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index], fn) -#define CALL_DeleteProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteProgramsNV_remap_index], parameters) -#define GET_DeleteProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index]) -#define SET_DeleteProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index], fn) -#define CALL_ExecuteProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ExecuteProgramNV_remap_index], parameters) -#define GET_ExecuteProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index]) -#define SET_ExecuteProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index], fn) -#define CALL_GenProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenProgramsNV_remap_index], parameters) -#define GET_GenProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index]) -#define SET_GenProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index], fn) -#define CALL_GetProgramParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetProgramParameterdvNV_remap_index], parameters) -#define GET_GetProgramParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index]) -#define SET_GetProgramParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index], fn) -#define CALL_GetProgramParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetProgramParameterfvNV_remap_index], parameters) -#define GET_GetProgramParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index]) -#define SET_GetProgramParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index], fn) -#define CALL_GetProgramStringNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)), driDispatchRemapTable[GetProgramStringNV_remap_index], parameters) -#define GET_GetProgramStringNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index]) -#define SET_GetProgramStringNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index], fn) -#define CALL_GetProgramivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramivNV_remap_index], parameters) -#define GET_GetProgramivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index]) -#define SET_GetProgramivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index], fn) -#define CALL_GetTrackMatrixivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetTrackMatrixivNV_remap_index], parameters) -#define GET_GetTrackMatrixivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index]) -#define SET_GetTrackMatrixivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index], fn) -#define CALL_GetVertexAttribPointervNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLvoid **)), driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], parameters) -#define GET_GetVertexAttribPointervNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index]) -#define SET_GetVertexAttribPointervNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], fn) -#define CALL_GetVertexAttribdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvNV_remap_index], parameters) -#define GET_GetVertexAttribdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index]) -#define SET_GetVertexAttribdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index], fn) -#define CALL_GetVertexAttribfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvNV_remap_index], parameters) -#define GET_GetVertexAttribfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index]) -#define SET_GetVertexAttribfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index], fn) -#define CALL_GetVertexAttribivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivNV_remap_index], parameters) -#define GET_GetVertexAttribivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index]) -#define SET_GetVertexAttribivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index], fn) -#define CALL_IsProgramNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgramNV_remap_index], parameters) -#define GET_IsProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index]) -#define SET_IsProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index], fn) -#define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters) -#define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index]) -#define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn) -#define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters) -#define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index]) -#define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn) -#define CALL_ProgramParameters4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameters4fvNV_remap_index], parameters) -#define GET_ProgramParameters4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index]) -#define SET_ProgramParameters4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index], fn) -#define CALL_RequestResidentProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[RequestResidentProgramsNV_remap_index], parameters) -#define GET_RequestResidentProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index]) -#define SET_RequestResidentProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index], fn) -#define CALL_TrackMatrixNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLenum)), driDispatchRemapTable[TrackMatrixNV_remap_index], parameters) -#define GET_TrackMatrixNV(disp) GET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index]) -#define SET_TrackMatrixNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index], fn) -#define CALL_VertexAttrib1dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dNV_remap_index], parameters) -#define GET_VertexAttrib1dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index]) -#define SET_VertexAttrib1dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index], fn) -#define CALL_VertexAttrib1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvNV_remap_index], parameters) -#define GET_VertexAttrib1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index]) -#define SET_VertexAttrib1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index], fn) -#define CALL_VertexAttrib1fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fNV_remap_index], parameters) -#define GET_VertexAttrib1fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index]) -#define SET_VertexAttrib1fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index], fn) -#define CALL_VertexAttrib1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvNV_remap_index], parameters) -#define GET_VertexAttrib1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index]) -#define SET_VertexAttrib1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index], fn) -#define CALL_VertexAttrib1sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sNV_remap_index], parameters) -#define GET_VertexAttrib1sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index]) -#define SET_VertexAttrib1sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index], fn) -#define CALL_VertexAttrib1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svNV_remap_index], parameters) -#define GET_VertexAttrib1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index]) -#define SET_VertexAttrib1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index], fn) -#define CALL_VertexAttrib2dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dNV_remap_index], parameters) -#define GET_VertexAttrib2dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index]) -#define SET_VertexAttrib2dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index], fn) -#define CALL_VertexAttrib2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvNV_remap_index], parameters) -#define GET_VertexAttrib2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index]) -#define SET_VertexAttrib2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index], fn) -#define CALL_VertexAttrib2fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fNV_remap_index], parameters) -#define GET_VertexAttrib2fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index]) -#define SET_VertexAttrib2fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index], fn) -#define CALL_VertexAttrib2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvNV_remap_index], parameters) -#define GET_VertexAttrib2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index]) -#define SET_VertexAttrib2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index], fn) -#define CALL_VertexAttrib2sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sNV_remap_index], parameters) -#define GET_VertexAttrib2sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index]) -#define SET_VertexAttrib2sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index], fn) -#define CALL_VertexAttrib2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svNV_remap_index], parameters) -#define GET_VertexAttrib2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index]) -#define SET_VertexAttrib2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index], fn) -#define CALL_VertexAttrib3dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dNV_remap_index], parameters) -#define GET_VertexAttrib3dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index]) -#define SET_VertexAttrib3dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index], fn) -#define CALL_VertexAttrib3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvNV_remap_index], parameters) -#define GET_VertexAttrib3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index]) -#define SET_VertexAttrib3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index], fn) -#define CALL_VertexAttrib3fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fNV_remap_index], parameters) -#define GET_VertexAttrib3fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index]) -#define SET_VertexAttrib3fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index], fn) -#define CALL_VertexAttrib3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvNV_remap_index], parameters) -#define GET_VertexAttrib3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index]) -#define SET_VertexAttrib3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index], fn) -#define CALL_VertexAttrib3sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sNV_remap_index], parameters) -#define GET_VertexAttrib3sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index]) -#define SET_VertexAttrib3sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index], fn) -#define CALL_VertexAttrib3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svNV_remap_index], parameters) -#define GET_VertexAttrib3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index]) -#define SET_VertexAttrib3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index], fn) -#define CALL_VertexAttrib4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dNV_remap_index], parameters) -#define GET_VertexAttrib4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index]) -#define SET_VertexAttrib4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index], fn) -#define CALL_VertexAttrib4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvNV_remap_index], parameters) -#define GET_VertexAttrib4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index]) -#define SET_VertexAttrib4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index], fn) -#define CALL_VertexAttrib4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fNV_remap_index], parameters) -#define GET_VertexAttrib4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index]) -#define SET_VertexAttrib4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index], fn) -#define CALL_VertexAttrib4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvNV_remap_index], parameters) -#define GET_VertexAttrib4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index]) -#define SET_VertexAttrib4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index], fn) -#define CALL_VertexAttrib4sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sNV_remap_index], parameters) -#define GET_VertexAttrib4sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index]) -#define SET_VertexAttrib4sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index], fn) -#define CALL_VertexAttrib4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svNV_remap_index], parameters) -#define GET_VertexAttrib4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index]) -#define SET_VertexAttrib4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index], fn) -#define CALL_VertexAttrib4ubNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4ubNV_remap_index], parameters) -#define GET_VertexAttrib4ubNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index]) -#define SET_VertexAttrib4ubNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index], fn) -#define CALL_VertexAttrib4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], parameters) -#define GET_VertexAttrib4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index]) -#define SET_VertexAttrib4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], fn) -#define CALL_VertexAttribPointerNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerNV_remap_index], parameters) -#define GET_VertexAttribPointerNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index]) -#define SET_VertexAttribPointerNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index], fn) -#define CALL_VertexAttribs1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs1dvNV_remap_index], parameters) -#define GET_VertexAttribs1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index]) -#define SET_VertexAttribs1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index], fn) -#define CALL_VertexAttribs1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs1fvNV_remap_index], parameters) -#define GET_VertexAttribs1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index]) -#define SET_VertexAttribs1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index], fn) -#define CALL_VertexAttribs1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs1svNV_remap_index], parameters) -#define GET_VertexAttribs1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index]) -#define SET_VertexAttribs1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index], fn) -#define CALL_VertexAttribs2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs2dvNV_remap_index], parameters) -#define GET_VertexAttribs2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index]) -#define SET_VertexAttribs2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index], fn) -#define CALL_VertexAttribs2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs2fvNV_remap_index], parameters) -#define GET_VertexAttribs2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index]) -#define SET_VertexAttribs2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index], fn) -#define CALL_VertexAttribs2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs2svNV_remap_index], parameters) -#define GET_VertexAttribs2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index]) -#define SET_VertexAttribs2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index], fn) -#define CALL_VertexAttribs3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs3dvNV_remap_index], parameters) -#define GET_VertexAttribs3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index]) -#define SET_VertexAttribs3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index], fn) -#define CALL_VertexAttribs3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs3fvNV_remap_index], parameters) -#define GET_VertexAttribs3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index]) -#define SET_VertexAttribs3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index], fn) -#define CALL_VertexAttribs3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs3svNV_remap_index], parameters) -#define GET_VertexAttribs3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index]) -#define SET_VertexAttribs3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index], fn) -#define CALL_VertexAttribs4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs4dvNV_remap_index], parameters) -#define GET_VertexAttribs4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index]) -#define SET_VertexAttribs4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index], fn) -#define CALL_VertexAttribs4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs4fvNV_remap_index], parameters) -#define GET_VertexAttribs4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index]) -#define SET_VertexAttribs4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index], fn) -#define CALL_VertexAttribs4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs4svNV_remap_index], parameters) -#define GET_VertexAttribs4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index]) -#define SET_VertexAttribs4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index], fn) -#define CALL_VertexAttribs4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], parameters) -#define GET_VertexAttribs4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index]) -#define SET_VertexAttribs4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], fn) -#define CALL_GetTexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], parameters) -#define GET_GetTexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index]) -#define SET_GetTexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], fn) -#define CALL_GetTexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], parameters) -#define GET_GetTexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index]) -#define SET_GetTexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], fn) -#define CALL_TexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[TexBumpParameterfvATI_remap_index], parameters) -#define GET_TexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index]) -#define SET_TexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index], fn) -#define CALL_TexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[TexBumpParameterivATI_remap_index], parameters) -#define GET_TexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index]) -#define SET_TexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index], fn) -#define CALL_AlphaFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], parameters) -#define GET_AlphaFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index]) -#define SET_AlphaFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], fn) -#define CALL_AlphaFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], parameters) -#define GET_AlphaFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index]) -#define SET_AlphaFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], fn) -#define CALL_AlphaFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], parameters) -#define GET_AlphaFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index]) -#define SET_AlphaFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], fn) -#define CALL_BeginFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[BeginFragmentShaderATI_remap_index], parameters) -#define GET_BeginFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index]) -#define SET_BeginFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index], fn) -#define CALL_BindFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindFragmentShaderATI_remap_index], parameters) -#define GET_BindFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index]) -#define SET_BindFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index], fn) -#define CALL_ColorFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], parameters) -#define GET_ColorFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index]) -#define SET_ColorFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], fn) -#define CALL_ColorFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], parameters) -#define GET_ColorFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index]) -#define SET_ColorFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], fn) -#define CALL_ColorFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], parameters) -#define GET_ColorFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index]) -#define SET_ColorFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], fn) -#define CALL_DeleteFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], parameters) -#define GET_DeleteFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index]) -#define SET_DeleteFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], fn) -#define CALL_EndFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[EndFragmentShaderATI_remap_index], parameters) -#define GET_EndFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index]) -#define SET_EndFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index], fn) -#define CALL_GenFragmentShadersATI(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[GenFragmentShadersATI_remap_index], parameters) -#define GET_GenFragmentShadersATI(disp) GET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index]) -#define SET_GenFragmentShadersATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index], fn) -#define CALL_PassTexCoordATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[PassTexCoordATI_remap_index], parameters) -#define GET_PassTexCoordATI(disp) GET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index]) -#define SET_PassTexCoordATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index], fn) -#define CALL_SampleMapATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[SampleMapATI_remap_index], parameters) -#define GET_SampleMapATI(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index]) -#define SET_SampleMapATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index], fn) -#define CALL_SetFragmentShaderConstantATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], parameters) -#define GET_SetFragmentShaderConstantATI(disp) GET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index]) -#define SET_SetFragmentShaderConstantATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], fn) -#define CALL_PointParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PointParameteriNV_remap_index], parameters) -#define GET_PointParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index]) -#define SET_PointParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index], fn) -#define CALL_PointParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PointParameterivNV_remap_index], parameters) -#define GET_PointParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index]) -#define SET_PointParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index], fn) -#define CALL_ActiveStencilFaceEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], parameters) -#define GET_ActiveStencilFaceEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index]) -#define SET_ActiveStencilFaceEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], fn) -#define CALL_BindVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], parameters) -#define GET_BindVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index]) -#define SET_BindVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], fn) -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], parameters) -#define GET_DeleteVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index]) -#define SET_DeleteVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], fn) -#define CALL_GenVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], parameters) -#define GET_GenVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index]) -#define SET_GenVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], fn) -#define CALL_IsVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], parameters) -#define GET_IsVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index]) -#define SET_IsVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], fn) -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble *)), driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], parameters) -#define GET_GetProgramNamedParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index]) -#define SET_GetProgramNamedParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], fn) -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat *)), driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], parameters) -#define GET_GetProgramNamedParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index]) -#define SET_GetProgramNamedParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], fn) -#define CALL_ProgramNamedParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], parameters) -#define GET_ProgramNamedParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index]) -#define SET_ProgramNamedParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], fn) -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLdouble *)), driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], parameters) -#define GET_ProgramNamedParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index]) -#define SET_ProgramNamedParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], fn) -#define CALL_ProgramNamedParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], parameters) -#define GET_ProgramNamedParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index]) -#define SET_ProgramNamedParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], fn) -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLfloat *)), driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], parameters) -#define GET_ProgramNamedParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index]) -#define SET_ProgramNamedParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], fn) -#define CALL_DepthBoundsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampd, GLclampd)), driDispatchRemapTable[DepthBoundsEXT_remap_index], parameters) -#define GET_DepthBoundsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index]) -#define SET_DepthBoundsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index], fn) -#define CALL_BlendEquationSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], parameters) -#define GET_BlendEquationSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index]) -#define SET_BlendEquationSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], fn) -#define CALL_BindFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindFramebufferEXT_remap_index], parameters) -#define GET_BindFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index]) -#define SET_BindFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index], fn) -#define CALL_BindRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindRenderbufferEXT_remap_index], parameters) -#define GET_BindRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index]) -#define SET_BindRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index], fn) -#define CALL_CheckFramebufferStatusEXT(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], parameters) -#define GET_CheckFramebufferStatusEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index]) -#define SET_CheckFramebufferStatusEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], fn) -#define CALL_DeleteFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], parameters) -#define GET_DeleteFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index]) -#define SET_DeleteFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], fn) -#define CALL_DeleteRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], parameters) -#define GET_DeleteRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index]) -#define SET_DeleteRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], fn) -#define CALL_FramebufferRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint)), driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], parameters) -#define GET_FramebufferRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index]) -#define SET_FramebufferRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], fn) -#define CALL_FramebufferTexture1DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], parameters) -#define GET_FramebufferTexture1DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index]) -#define SET_FramebufferTexture1DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], fn) -#define CALL_FramebufferTexture2DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], parameters) -#define GET_FramebufferTexture2DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index]) -#define SET_FramebufferTexture2DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], fn) -#define CALL_FramebufferTexture3DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], parameters) -#define GET_FramebufferTexture3DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index]) -#define SET_FramebufferTexture3DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], fn) -#define CALL_GenFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFramebuffersEXT_remap_index], parameters) -#define GET_GenFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index]) -#define SET_GenFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index], fn) -#define CALL_GenRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenRenderbuffersEXT_remap_index], parameters) -#define GET_GenRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index]) -#define SET_GenRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index], fn) -#define CALL_GenerateMipmapEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GenerateMipmapEXT_remap_index], parameters) -#define GET_GenerateMipmapEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index]) -#define SET_GenerateMipmapEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index], fn) -#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) -#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) -#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) -#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) -#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) -#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) -#define CALL_IsFramebufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFramebufferEXT_remap_index], parameters) -#define GET_IsFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index]) -#define SET_IsFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index], fn) -#define CALL_IsRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsRenderbufferEXT_remap_index], parameters) -#define GET_IsRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index]) -#define SET_IsRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index], fn) -#define CALL_RenderbufferStorageEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageEXT_remap_index], parameters) -#define GET_RenderbufferStorageEXT(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index]) -#define SET_RenderbufferStorageEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index], fn) -#define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters) -#define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index]) -#define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn) -#define CALL_BufferParameteriAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint)), driDispatchRemapTable[BufferParameteriAPPLE_remap_index], parameters) -#define GET_BufferParameteriAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index]) -#define SET_BufferParameteriAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index], fn) -#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], parameters) -#define GET_FlushMappedBufferRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index]) -#define SET_FlushMappedBufferRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], fn) -#define CALL_FramebufferTextureLayerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], parameters) -#define GET_FramebufferTextureLayerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index]) -#define SET_FramebufferTextureLayerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], fn) -#define CALL_ProvokingVertexEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ProvokingVertexEXT_remap_index], parameters) -#define GET_ProvokingVertexEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index]) -#define SET_ProvokingVertexEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index], fn) -#define CALL_GetTexParameterPointervAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], parameters) -#define GET_GetTexParameterPointervAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index]) -#define SET_GetTexParameterPointervAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], fn) -#define CALL_TextureRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLvoid *)), driDispatchRemapTable[TextureRangeAPPLE_remap_index], parameters) -#define GET_TextureRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index]) -#define SET_TextureRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index], fn) -#define CALL_StencilFuncSeparateATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparateATI_remap_index], parameters) -#define GET_StencilFuncSeparateATI(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index]) -#define SET_StencilFuncSeparateATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index], fn) -#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters) -#define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]) -#define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn) -#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters) -#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]) -#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) -#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) -#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) -#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) -#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) - -#endif /* !defined(IN_DRI_DRIVER) */ +#include "glapioffsets.h" +#include "glapidispatch.h" -#endif /* !defined( _DISPATCH_H_ ) */ +#endif /* _DISPATCH_H */ diff --git a/mesalib/src/mesa/glapi/extension_helper.py b/mesalib/src/mesa/glapi/extension_helper.py deleted file mode 100644 index 83471d89f..000000000 --- a/mesalib/src/mesa/glapi/extension_helper.py +++ /dev/null @@ -1,324 +0,0 @@ -#!/usr/bin/env python - -# (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 -# 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 - -import gl_XML -import license -import sys, getopt, string - -vtxfmt = [ - "ArrayElement", \ - "Color3f", \ - "Color3fv", \ - "Color4f", \ - "Color4fv", \ - "EdgeFlag", \ - "EdgeFlagv", \ - "EvalCoord1f", \ - "EvalCoord1fv", \ - "EvalCoord2f", \ - "EvalCoord2fv", \ - "EvalPoint1", \ - "EvalPoint2", \ - "FogCoordfEXT", \ - "FogCoordfvEXT", \ - "Indexf", \ - "Indexfv", \ - "Materialfv", \ - "MultiTexCoord1fARB", \ - "MultiTexCoord1fvARB", \ - "MultiTexCoord2fARB", \ - "MultiTexCoord2fvARB", \ - "MultiTexCoord3fARB", \ - "MultiTexCoord3fvARB", \ - "MultiTexCoord4fARB", \ - "MultiTexCoord4fvARB", \ - "Normal3f", \ - "Normal3fv", \ - "SecondaryColor3fEXT", \ - "SecondaryColor3fvEXT", \ - "TexCoord1f", \ - "TexCoord1fv", \ - "TexCoord2f", \ - "TexCoord2fv", \ - "TexCoord3f", \ - "TexCoord3fv", \ - "TexCoord4f", \ - "TexCoord4fv", \ - "Vertex2f", \ - "Vertex2fv", \ - "Vertex3f", \ - "Vertex3fv", \ - "Vertex4f", \ - "Vertex4fv", \ - "CallList", \ - "CallLists", \ - "Begin", \ - "End", \ - "VertexAttrib1fNV", \ - "VertexAttrib1fvNV", \ - "VertexAttrib2fNV", \ - "VertexAttrib2fvNV", \ - "VertexAttrib3fNV", \ - "VertexAttrib3fvNV", \ - "VertexAttrib4fNV", \ - "VertexAttrib4fvNV", \ - "VertexAttrib1fARB", \ - "VertexAttrib1fvARB", \ - "VertexAttrib2fARB", \ - "VertexAttrib2fvARB", \ - "VertexAttrib3fARB", \ - "VertexAttrib3fvARB", \ - "VertexAttrib4fARB", \ - "VertexAttrib4fvARB", \ - "Rectf", \ - "DrawArrays", \ - "DrawElements", \ - "DrawRangeElements", \ - "EvalMesh1", \ - "EvalMesh2", \ -] - -def all_entrypoints_in_abi(f, abi, api): - for n in f.entry_points: - [category, num] = api.get_category_for_name( n ) - if category not in abi: - return 0 - - return 1 - - -def any_entrypoints_in_abi(f, abi, api): - for n in f.entry_points: - [category, num] = api.get_category_for_name( n ) - if category in abi: - return 1 - - return 0 - - -def condition_for_function(f, abi, all_not_in_ABI): - """Create a C-preprocessor condition for the function. - - There are two modes of operation. If all_not_in_ABI is set, a - condition is only created is all of the entry-point names for f are - not in the selected ABI. If all_not_in_ABI is not set, a condition - is created if any entryp-point name is not in the selected ABI. - """ - - condition = [] - for n in f.entry_points: - [category, num] = api.get_category_for_name( n ) - if category not in abi: - condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) ) - elif all_not_in_ABI: - return [] - - return condition - - -class PrintGlExtensionGlue(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "extension_helper.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def printRealHeader(self): - print '#include "utils.h"' - print '#include "glapi/dispatch.h"' - print '' - return - - - def printBody(self, api): - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - - category_list = {} - - print '#ifndef NULL' - print '# define NULL 0' - print '#endif' - print '' - - for f in api.functionIterateAll(): - condition = condition_for_function(f, abi, 0) - if len(condition): - print '#if %s' % (string.join(condition, " || ")) - print 'static const char %s_names[] =' % (f.name) - - parameter_signature = '' - for p in f.parameterIterator(): - if p.is_padding: - continue - - # FIXME: This is a *really* ugly hack. :( - - tn = p.type_expr.get_base_type_node() - if p.is_pointer(): - parameter_signature += 'p' - elif tn.integer: - parameter_signature += 'i' - elif tn.size == 4: - parameter_signature += 'f' - else: - parameter_signature += 'd' - - print ' "%s\\0" /* Parameter signature */' % (parameter_signature) - - for n in f.entry_points: - print ' "gl%s\\0"' % (n) - - [category, num] = api.get_category_for_name( n ) - if category not in abi: - c = gl_XML.real_category_name(category) - if not category_list.has_key(c): - category_list[ c ] = [] - - category_list[ c ].append( f ) - - print ' "";' - print '#endif' - print '' - - keys = category_list.keys() - keys.sort() - - for category in keys: - print '#if defined(need_%s)' % (category) - print 'static const struct dri_extension_function %s_functions[] = {' % (category) - - for f in category_list[ category ]: - # A function either has an offset that is - # assigned by the ABI, or it has a remap - # index. - if any_entrypoints_in_abi(f, abi, api): - index_name = "-1" - offset = f.offset - else: - index_name = "%s_remap_index" % (f.name) - offset = -1 - - print ' { %s_names, %s, %d },' % (f.name, index_name, offset) - - - print ' { NULL, 0, 0 }' - print '};' - print '#endif' - print '' - - return - - -class PrintInitDispatch(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "extension_helper.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def do_function_body(self, api, abi, vtxfmt_only): - last_condition_string = None - for f in api.functionIterateByOffset(): - if (f.name in vtxfmt) and not vtxfmt_only: - continue - - if (f.name not in vtxfmt) and vtxfmt_only: - continue - - condition = condition_for_function(f, abi, 1) - condition_string = string.join(condition, " || ") - - if condition_string != last_condition_string: - if last_condition_string: - print '#endif /* %s */' % (last_condition_string) - - if condition_string: - print '#if %s' % (condition_string) - - if vtxfmt_only: - print ' disp->%s = vfmt->%s;' % (f.name, f.name) - else: - print ' disp->%s = _mesa_%s;' % (f.name, f.name) - - last_condition_string = condition_string - - if last_condition_string: - print '#endif /* %s */' % (last_condition_string) - - - - def printBody(self, api): - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - - print 'void driver_init_exec_table(struct _glapi_table *disp)' - print '{' - self.do_function_body(api, abi, 0) - print '}' - print '' - print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)' - print '{' - self.do_function_body(api, abi, 1) - print '}' - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") - except Exception,e: - show_usage() - - mode = "extensions" - for (arg,val) in args: - if arg == "-f": - file_name = val - if arg == '-m': - mode = val - - - api = gl_XML.parse_GL_API( file_name ) - - if mode == "extensions": - printer = PrintGlExtensionGlue() - elif mode == "exec_init": - printer = PrintInitDispatch() - else: - show_usage() - - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/glX_API.xml b/mesalib/src/mesa/glapi/glX_API.xml deleted file mode 100644 index 9e02aa498..000000000 --- a/mesalib/src/mesa/glapi/glX_API.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/glX_XML.py b/mesalib/src/mesa/glapi/glX_XML.py deleted file mode 100644 index 4c2e0f95b..000000000 --- a/mesalib/src/mesa/glapi/glX_XML.py +++ /dev/null @@ -1,570 +0,0 @@ -#!/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 - -import gl_XML -import license -import sys, getopt, string - - -class glx_item_factory(gl_XML.gl_item_factory): - """Factory to create GLX protocol oriented objects derived from gl_item.""" - - def create_item(self, name, element, context): - if name == "function": - return glx_function(element, context) - elif name == "enum": - return glx_enum(element, context) - elif name == "api": - return glx_api(self) - else: - return gl_XML.gl_item_factory.create_item(self, name, element, context) - - -class glx_enum(gl_XML.gl_enum): - def __init__(self, element, context): - gl_XML.gl_enum.__init__(self, element, context) - - self.functions = {} - - child = element.children - while child: - if child.type == "element" and child.name == "size": - n = child.nsProp( "name", None ) - c = child.nsProp( "count", None ) - m = child.nsProp( "mode", None ) - - if not c: - c = self.default_count - else: - c = int(c) - - if m == "get": - mode = 0 - else: - mode = 1 - - if not self.functions.has_key(n): - self.functions[ n ] = [c, mode] - - child = child.next - - return - - -class glx_function(gl_XML.gl_function): - def __init__(self, element, context): - self.glx_rop = 0 - self.glx_sop = 0 - self.glx_vendorpriv = 0 - - self.glx_vendorpriv_names = [] - - # If this is set to true, it means that GLdouble parameters should be - # written to the GLX protocol packet in the order they appear in the - # prototype. This is different from the "classic" ordering. In the - # classic ordering GLdoubles are written to the protocol packet first, - # followed by non-doubles. NV_vertex_program was the first extension - # to break with this tradition. - - self.glx_doubles_in_order = 0 - - self.vectorequiv = None - self.output = None - self.can_be_large = 0 - self.reply_always_array = 0 - self.dimensions_in_reply = 0 - self.img_reset = None - - self.server_handcode = 0 - self.client_handcode = 0 - self.ignore = 0 - - self.count_parameter_list = [] - self.counter_list = [] - self.parameters_by_name = {} - self.offsets_calculated = 0 - - gl_XML.gl_function.__init__(self, element, context) - return - - - def process_element(self, element): - gl_XML.gl_function.process_element(self, element) - - # If the function already has a vector equivalent set, don't - # set it again. This can happen if an alias to a function - # appears after the function that it aliases. - - if not self.vectorequiv: - self.vectorequiv = element.nsProp("vectorequiv", None) - - - name = element.nsProp("name", None) - if name == self.name: - for param in self.parameters: - self.parameters_by_name[ param.name ] = param - - if len(param.count_parameter_list): - self.count_parameter_list.extend( param.count_parameter_list ) - - if param.counter and param.counter not in self.counter_list: - self.counter_list.append(param.counter) - - - child = element.children - while child: - if child.type == "element" and child.name == "glx": - rop = child.nsProp( 'rop', None ) - sop = child.nsProp( 'sop', None ) - vop = child.nsProp( 'vendorpriv', None ) - - if rop: - self.glx_rop = int(rop) - - if sop: - self.glx_sop = int(sop) - - if vop: - self.glx_vendorpriv = int(vop) - self.glx_vendorpriv_names.append(name) - - self.img_reset = child.nsProp( 'img_reset', None ) - - # The 'handcode' attribute can be one of 'true', - # 'false', 'client', or 'server'. - - handcode = child.nsProp( 'handcode', None ) - if handcode == "false": - self.server_handcode = 0 - self.client_handcode = 0 - elif handcode == "true": - self.server_handcode = 1 - self.client_handcode = 1 - elif handcode == "client": - self.server_handcode = 0 - self.client_handcode = 1 - elif handcode == "server": - self.server_handcode = 1 - self.client_handcode = 0 - else: - raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name)) - - self.ignore = gl_XML.is_attr_true( child, 'ignore' ) - self.can_be_large = gl_XML.is_attr_true( child, 'large' ) - self.glx_doubles_in_order = gl_XML.is_attr_true( child, 'doubles_in_order' ) - self.reply_always_array = gl_XML.is_attr_true( child, 'always_array' ) - self.dimensions_in_reply = gl_XML.is_attr_true( child, 'dimensions_in_reply' ) - - child = child.next - - - # Do some validation of the GLX protocol information. As - # new tests are discovered, they should be added here. - - for param in self.parameters: - if param.is_output and self.glx_rop != 0: - raise RuntimeError("Render / RenderLarge commands cannot have outputs (%s)." % (self.name)) - - return - - - def has_variable_size_request(self): - """Determine if the GLX request packet is variable sized. - - The GLX request packet is variable sized in several common - situations. - - 1. The function has a non-output parameter that is counted - by another parameter (e.g., the 'textures' parameter of - glDeleteTextures). - - 2. The function has a non-output parameter whose count is - determined by another parameter that is an enum (e.g., the - 'params' parameter of glLightfv). - - 3. The function has a non-output parameter that is an - image. - - 4. The function must be hand-coded on the server. - """ - - if self.glx_rop == 0: - return 0 - - if self.server_handcode or self.images: - return 1 - - for param in self.parameters: - if not param.is_output: - if param.counter or len(param.count_parameter_list): - return 1 - - return 0 - - - def variable_length_parameter(self): - for param in self.parameters: - if not param.is_output: - if param.counter or len(param.count_parameter_list): - return param - - return None - - - def calculate_offsets(self): - if not self.offsets_calculated: - # Calculate the offset of the first function parameter - # in the GLX command packet. This byte offset is - # measured from the end of the Render / RenderLarge - # header. The offset for all non-pixel commends is - # zero. The offset for pixel commands depends on the - # number of dimensions of the pixel data. - - if len(self.images) and not self.images[0].is_output: - [dim, junk, junk, junk, junk] = self.images[0].get_dimensions() - - # The base size is the size of the pixel pack info - # header used by images with the specified number - # of dimensions. - - if dim <= 2: - offset = 20 - elif dim <= 4: - offset = 36 - else: - raise RuntimeError('Invalid number of dimensions %u for parameter "%s" in function "%s".' % (dim, self.image.name, self.name)) - else: - offset = 0 - - for param in self.parameterIterateGlxSend(): - if param.img_null_flag: - offset += 4 - - if param.name != self.img_reset: - param.offset = offset - if not param.is_variable_length() and not param.is_client_only: - offset += param.size() - - if self.pad_after( param ): - offset += 4 - - - self.offsets_calculated = 1 - return - - - def offset_of(self, param_name): - self.calculate_offsets() - return self.parameters_by_name[ param_name ].offset - - - def parameterIterateGlxSend(self, include_variable_parameters = 1): - """Create an iterator for parameters in GLX request order.""" - - # The parameter lists are usually quite short, so it's easier - # (i.e., less code) to just generate a new list with the - # required elements than it is to create a new iterator class. - - temp = [ [], [], [] ] - for param in self.parameters: - if param.is_output: continue - - if param.is_variable_length(): - temp[2].append( param ) - elif not self.glx_doubles_in_order and param.is_64_bit(): - temp[0].append( param ) - else: - temp[1].append( param ) - - parameters = temp[0] - parameters.extend( temp[1] ) - if include_variable_parameters: - parameters.extend( temp[2] ) - return parameters.__iter__() - - - def parameterIterateCounters(self): - temp = [] - for name in self.counter_list: - temp.append( self.parameters_by_name[ name ] ) - - return temp.__iter__() - - - def parameterIterateOutputs(self): - temp = [] - for p in self.parameters: - if p.is_output: - temp.append( p ) - - return temp - - - def command_fixed_length(self): - """Return the length, in bytes as an integer, of the - fixed-size portion of the command.""" - - if len(self.parameters) == 0: - return 0 - - self.calculate_offsets() - - size = 0 - for param in self.parameterIterateGlxSend(0): - if param.name != self.img_reset and not param.is_client_only: - if size == 0: - size = param.offset + param.size() - else: - size += param.size() - - if self.pad_after( param ): - size += 4 - - for param in self.images: - if param.img_null_flag or param.is_output: - size += 4 - - return size - - - def command_variable_length(self): - """Return the length, as a string, of the variable-sized - portion of the command.""" - - size_string = "" - for p in self.parameterIterateGlxSend(): - if (not p.is_output) and (p.is_variable_length() or p.is_image()): - # FIXME Replace the 1 in the size_string call - # FIXME w/0 to eliminate some un-needed parnes - # FIXME This would already be done, but it - # FIXME adds some extra diffs to the generated - # FIXME code. - - size_string = size_string + " + __GLX_PAD(%s)" % (p.size_string(1)) - - return size_string - - - def command_length(self): - size = self.command_fixed_length() - - if self.glx_rop != 0: - size += 4 - - size = ((size + 3) & ~3) - return "%u%s" % (size, self.command_variable_length()) - - - def opcode_real_value(self): - """Get the true numeric value of the GLX opcode - - Behaves similarly to opcode_value, except for - X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. - In these cases the value for the GLX opcode field (i.e., - 16 for X_GLXVendorPrivate or 17 for - X_GLXVendorPrivateWithReply) is returned. For other 'single' - commands, the opcode for the command (e.g., 101 for - X_GLsop_NewList) is returned.""" - - if self.glx_vendorpriv != 0: - if self.needs_reply(): - return 17 - else: - return 16 - else: - return self.opcode_value() - - - def opcode_value(self): - """Get the unique protocol opcode for the glXFunction""" - - if (self.glx_rop == 0) and self.vectorequiv: - equiv = self.context.functions_by_name[ self.vectorequiv ] - self.glx_rop = equiv.glx_rop - - - if self.glx_rop != 0: - return self.glx_rop - elif self.glx_sop != 0: - return self.glx_sop - elif self.glx_vendorpriv != 0: - return self.glx_vendorpriv - else: - return -1 - - - def opcode_rop_basename(self): - """Return either the name to be used for GLX protocol enum. - - Returns either the name of the function or the name of the - name of the equivalent vector (e.g., glVertex3fv for - glVertex3f) function.""" - - if self.vectorequiv == None: - return self.name - else: - return self.vectorequiv - - - def opcode_name(self): - """Get the unique protocol enum name for the glXFunction""" - - if (self.glx_rop == 0) and self.vectorequiv: - equiv = self.context.functions_by_name[ self.vectorequiv ] - self.glx_rop = equiv.glx_rop - self.glx_doubles_in_order = equiv.glx_doubles_in_order - - - if self.glx_rop != 0: - return "X_GLrop_%s" % (self.opcode_rop_basename()) - elif self.glx_sop != 0: - return "X_GLsop_%s" % (self.name) - elif self.glx_vendorpriv != 0: - return "X_GLvop_%s" % (self.name) - else: - raise RuntimeError('Function "%s" has no opcode.' % (self.name)) - - - def opcode_vendor_name(self, name): - if name in self.glx_vendorpriv_names: - return "X_GLvop_%s" % (name) - else: - raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name)) - - - def opcode_real_name(self): - """Get the true protocol enum name for the GLX opcode - - Behaves similarly to opcode_name, except for - X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. - In these cases the string 'X_GLXVendorPrivate' or - 'X_GLXVendorPrivateWithReply' is returned. For other - single or render commands 'X_GLsop' or 'X_GLrop' plus the - name of the function returned.""" - - if self.glx_vendorpriv != 0: - if self.needs_reply(): - return "X_GLXVendorPrivateWithReply" - else: - return "X_GLXVendorPrivate" - else: - return self.opcode_name() - - - def needs_reply(self): - try: - x = self._needs_reply - except Exception, e: - x = 0 - if self.return_type != 'void': - x = 1 - - for param in self.parameters: - if param.is_output: - x = 1 - break - - self._needs_reply = x - - return x - - - def pad_after(self, p): - """Returns the name of the field inserted after the - specified field to pad out the command header.""" - - for image in self.images: - if image.img_pad_dimensions: - if not image.height: - if p.name == image.width: - return "height" - elif p.name == image.img_xoff: - return "yoffset" - elif not image.extent: - if p.name == image.depth: - # Should this be "size4d"? - return "extent" - elif p.name == image.img_zoff: - return "woffset" - - return None - - - def has_different_protocol(self, name): - """Returns true if the named version of the function uses different protocol from the other versions. - - Some functions, such as glDeleteTextures and - glDeleteTexturesEXT are functionally identical, but have - different protocol. This function returns true if the - named function is an alias name and that named version uses - different protocol from the function that is aliased. - """ - - return (name in self.glx_vendorpriv_names) and self.glx_sop - - - def static_glx_name(self, name): - if self.has_different_protocol(name): - for n in self.glx_vendorpriv_names: - if n in self.static_entry_points: - return n - - return self.static_name(name) - - - def client_supported_for_indirect(self): - """Returns true if the function is supported on the client - side for indirect rendering.""" - - return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode) - - -class glx_function_iterator: - """Class to iterate over a list of glXFunctions""" - - def __init__(self, context): - self.iterator = context.functionIterateByOffset() - return - - - def __iter__(self): - return self - - - def next(self): - f = self.iterator.next() - - if f.client_supported_for_indirect(): - return f - else: - return self.next() - - -class glx_api(gl_XML.gl_api): - def functionIterateGlx(self): - return glx_function_iterator(self) - diff --git a/mesalib/src/mesa/glapi/glX_doc.py b/mesalib/src/mesa/glapi/glX_doc.py deleted file mode 100644 index e9fbbe6f1..000000000 --- a/mesalib/src/mesa/glapi/glX_doc.py +++ /dev/null @@ -1,280 +0,0 @@ -#!/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 - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt - - -class glx_doc_item_factory(glX_proto_common.glx_proto_item_factory): - """Factory to create GLX protocol documentation oriented objects derived from glItem.""" - - def create_item(self, name, element, context): - if name == "parameter": - return glx_doc_parameter(element, context) - else: - return glX_proto_common.glx_proto_item_factory.create_item(self, name, element, context) - - -class glx_doc_parameter(gl_XML.gl_parameter): - def packet_type(self, type_dict): - """Get the type string for the packet header - - GLX protocol documentation uses type names like CARD32, - FLOAT64, LISTofCARD8, and ENUM. This function converts the - type of the parameter to one of these names.""" - - list_of = "" - if self.is_array(): - list_of = "LISTof" - - t_name = self.get_base_type_string() - if not type_dict.has_key( t_name ): - type_name = "CARD8" - else: - type_name = type_dict[ t_name ] - - return "%s%s" % (list_of, type_name) - - - def packet_size(self): - p = None - s = self.size() - if s == 0: - a_prod = "n" - b_prod = self.p_type.size - - if not self.count_parameter_list and self.counter: - a_prod = self.counter - elif self.count_parameter_list and not self.counter or self.is_output: - pass - elif self.count_parameter_list and self.counter: - b_prod = self.counter - else: - raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name)) - - ss = "%s*%s" % (a_prod, b_prod) - - return [ss, p] - else: - if s % 4 != 0: - p = "p" - - return [str(s), p] - -class PrintGlxProtoText(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - self.license = "" - - - def printHeader(self): - return - - - def body_size(self, f): - # At some point, refactor this function and - # glXFunction::command_payload_length. - - size = 0; - size_str = "" - pad_str = "" - plus = "" - for p in f.parameterIterateGlxSend(): - [s, pad] = p.packet_size() - try: - size += int(s) - except Exception,e: - size_str += "%s%s" % (plus, s) - plus = "+" - - if pad != None: - pad_str = pad - - return [size, size_str, pad_str] - - - def print_render_header(self, f): - [size, size_str, pad_str] = self.body_size(f) - size += 4; - - if size_str == "": - s = "%u" % ((size + 3) & ~3) - elif pad_str != "": - s = "%u+%s+%s" % (size, size_str, pad_str) - else: - s = "%u+%s" % (size, size_str) - - print ' 2 %-15s rendering command length' % (s) - print ' 2 %-4u rendering command opcode' % (f.glx_rop) - return - - - def print_single_header(self, f): - [size, size_str, pad_str] = self.body_size(f) - size = ((size + 3) / 4) + 2; - - if f.glx_vendorpriv != 0: - size += 1 - - print ' 1 CARD8 opcode (X assigned)' - print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name()) - - if size_str == "": - s = "%u" % (size) - elif pad_str != "": - s = "%u+((%s+%s)/4)" % (size, size_str, pad_str) - else: - s = "%u+((%s)/4)" % (size, size_str) - - print ' 2 %-15s request length' % (s) - - if f.glx_vendorpriv != 0: - print ' 4 %-4u vendor specific opcode' % (f.opcode_value()) - - print ' 4 GLX_CONTEXT_TAG context tag' - - return - - - def print_reply(self, f): - print ' =>' - print ' 1 1 reply' - print ' 1 unused' - print ' 2 CARD16 sequence number' - - if f.output == None: - print ' 4 0 reply length' - elif f.reply_always_array: - print ' 4 m reply length' - else: - print ' 4 m reply length, m = (n == 1 ? 0 : n)' - - - output = None - for x in f.parameterIterateOutputs(): - output = x - break - - - unused = 24 - if f.return_type != 'void': - print ' 4 %-15s return value' % (f.return_type) - unused -= 4 - elif output != None: - print ' 4 unused' - unused -= 4 - - if output != None: - print ' 4 CARD32 n' - unused -= 4 - - if output != None: - if not f.reply_always_array: - print '' - print ' if (n = 1) this follows:' - print '' - print ' 4 CARD32 %s' % (output.name) - print ' %-2u unused' % (unused - 4) - print '' - print ' otherwise this follows:' - print '' - - print ' %-2u unused' % (unused) - - [s, pad] = output.packet_size() - print ' %-8s %-15s %s' % (s, output.packet_type( self.type_map ), output.name) - if pad != None: - try: - bytes = int(s) - bytes = 4 - (bytes & 3) - print ' %-8u %-15s unused' % (bytes, "") - except Exception,e: - print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) - else: - print ' %-2u unused' % (unused) - - - def print_body(self, f): - for p in f.parameterIterateGlxSend(): - [s, pad] = p.packet_size() - print ' %-8s %-15s %s' % (s, p.packet_type( self.type_map ), p.name) - if pad != None: - try: - bytes = int(s) - bytes = 4 - (bytes & 3) - print ' %-8u %-15s unused' % (bytes, "") - except Exception,e: - print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) - - def printBody(self, api): - self.type_map = {} - for t in api.typeIterate(): - self.type_map[ "GL" + t.name ] = t.glx_name - - - # At some point this should be expanded to support pixel - # functions, but I'm not going to lose any sleep over it now. - - for f in api.functionIterateByOffset(): - if f.client_handcode or f.server_handcode or f.vectorequiv or len(f.get_images()): - continue - - - if f.glx_rop: - print ' %s' % (f.name) - self.print_render_header(f) - elif f.glx_sop or f.glx_vendorpriv: - print ' %s' % (f.name) - self.print_single_header(f) - else: - continue - - self.print_body(f) - - if f.needs_reply(): - self.print_reply(f) - - print '' - return - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name, glx_doc_item_factory() ) - - printer = PrintGlxProtoText() - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/glX_proto_common.py b/mesalib/src/mesa/glapi/glX_proto_common.py deleted file mode 100644 index 6f094e22b..000000000 --- a/mesalib/src/mesa/glapi/glX_proto_common.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/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 - -import gl_XML, glX_XML -import string - - -class glx_proto_item_factory(glX_XML.glx_item_factory): - """Factory to create GLX protocol oriented objects derived from gl_item.""" - - def create_item(self, name, element, context): - if name == "type": - return glx_proto_type(element, context) - else: - return glX_XML.glx_item_factory.create_item(self, name, element, context) - - -class glx_proto_type(gl_XML.gl_type): - def __init__(self, element, context): - gl_XML.gl_type.__init__(self, element, context) - - self.glx_name = element.nsProp( "glx_name", None ) - return - - -class glx_print_proto(gl_XML.gl_print_base): - def size_call(self, func, outputs_also = 0): - """Create C code to calculate 'compsize'. - - Creates code to calculate 'compsize'. If the function does - not need 'compsize' to be calculated, None will be - returned.""" - - compsize = None - - for param in func.parameterIterator(): - if outputs_also or not param.is_output: - if param.is_image(): - [dim, w, h, d, junk] = param.get_dimensions() - - compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, param.img_format, param.img_type, param.img_target) - if not param.img_send_null: - compsize = '(%s != NULL) ? %s : 0' % (param.name, compsize) - - return compsize - - elif len(param.count_parameter_list): - parameters = string.join( param.count_parameter_list, "," ) - compsize = "__gl%s_size(%s)" % (func.name, parameters) - - return compsize - - return None - - - def emit_packet_size_calculation(self, f, bias): - # compsize is only used in the command size calculation if - # the function has a non-output parameter that has a non-empty - # counter_parameter_list. - - compsize = self.size_call(f) - if compsize: - print ' const GLuint compsize = %s;' % (compsize) - - if bias: - print ' const GLuint cmdlen = %s - %u;' % (f.command_length(), bias) - else: - print ' const GLuint cmdlen = %s;' % (f.command_length()) - - #print '' - return compsize diff --git a/mesalib/src/mesa/glapi/glX_proto_recv.py b/mesalib/src/mesa/glapi/glX_proto_recv.py deleted file mode 100644 index f423c6db0..000000000 --- a/mesalib/src/mesa/glapi/glX_proto_recv.py +++ /dev/null @@ -1,554 +0,0 @@ -#!/usr/bin/env python - -# (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 -# 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 - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt, string - - -class PrintGlxDispatch_h(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_recv.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") - - self.header_tag = "_INDIRECT_DISPATCH_H_" - return - - - def printRealHeader(self): - self.printVisibility( "HIDDEN", "hidden" ) - print 'struct __GLXclientStateRec;' - print '' - return - - - def printBody(self, api): - for func in api.functionIterateAll(): - if not func.ignore and not func.vectorequiv: - if func.glx_rop: - print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name) - print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name) - elif func.glx_sop or func.glx_vendorpriv: - print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) - print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) - - if func.glx_sop and func.glx_vendorpriv: - n = func.glx_vendorpriv_names[0] - print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) - print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) - - return - - -class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): - def __init__(self, do_swap): - gl_XML.gl_print_base.__init__(self) - self.name = "glX_proto_recv.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") - - self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ] - self.do_swap = do_swap - return - - - def printRealHeader(self): - print '#include ' - print '#include ' - print '#include ' - - print '#include ' - print '#include "indirect_size.h"' - print '#include "indirect_size_get.h"' - print '#include "indirect_dispatch.h"' - print '#include "glxserver.h"' - print '#include "glxbyteorder.h"' - print '#include "indirect_util.h"' - print '#include "singlesize.h"' - print '#include "glapi.h"' - print '#include "glapitable.h"' - print '#include "glthread.h"' - print '#include "dispatch.h"' - print '' - print '#define __GLX_PAD(x) (((x) + 3) & ~3)' - print '' - print 'typedef struct {' - print ' __GLX_PIXEL_3D_HDR;' - print '} __GLXpixel3DHeader;' - print '' - print 'extern GLboolean __glXErrorOccured( void );' - print 'extern void __glXClearErrorOccured( void );' - print '' - print 'static const unsigned dummy_answer[2] = {0, 0};' - print '' - return - - - def printBody(self, api): - if self.do_swap: - self.emit_swap_wrappers(api) - - - for func in api.functionIterateByOffset(): - if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv): - self.printFunction(func, func.name) - if func.glx_sop and func.glx_vendorpriv: - self.printFunction(func, func.glx_vendorpriv_names[0]) - - - return - - - def printFunction(self, f, name): - if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0): - return - - if not self.do_swap: - base = '__glXDisp' - else: - base = '__glXDispSwap' - - if f.glx_rop: - print 'void %s_%s(GLbyte * pc)' % (base, name) - else: - print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name) - - print '{' - - if f.glx_rop or f.vectorequiv: - self.printRenderFunction(f) - elif f.glx_sop or f.glx_vendorpriv: - if len(f.get_images()) == 0: - self.printSingleFunction(f, name) - else: - print "/* Missing GLX protocol for %s. */" % (name) - - print '}' - print '' - return - - - def swap_name(self, bytes): - return 'bswap_%u_array' % (8 * bytes) - - - def emit_swap_wrappers(self, api): - self.type_map = {} - already_done = [ ] - - for t in api.typeIterate(): - te = t.get_type_expression() - t_size = te.get_element_size() - - if t_size > 1 and t.glx_name: - - t_name = "GL" + t.name - self.type_map[ t_name ] = t.glx_name - - if t.glx_name not in already_done: - real_name = self.real_types[t_size] - - print 'static %s' % (t_name) - print 'bswap_%s( const void * src )' % (t.glx_name) - print '{' - print ' union { %s dst; %s ret; } x;' % (real_name, t_name) - print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name) - print ' return x.ret;' - print '}' - print '' - already_done.append( t.glx_name ) - - for bits in [16, 32, 64]: - print 'static void *' - print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits) - print '{' - print ' unsigned i;' - print '' - print ' for ( i = 0 ; i < count ; i++ ) {' - print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits) - print ' src[i] = temp;' - print ' }' - print '' - print ' return src;' - print '}' - print '' - - - def fetch_param(self, param): - t = param.type_string() - o = param.offset - element_size = param.size() / param.get_element_count() - - if self.do_swap and (element_size != 1): - if param.is_array(): - real_name = self.real_types[ element_size ] - - swap_func = self.swap_name( element_size ) - return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, real_name, o, param.count) - else: - t_name = param.get_base_type_string() - return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, self.type_map[ t_name ], o) - else: - if param.is_array(): - return ' (%-8s)(pc + %2u)' % (t, o) - else: - return '*(%-8s *)(pc + %2u)' % (t, o) - - return None - - - def emit_function_call(self, f, retval_assign, indent): - list = [] - - for param in f.parameterIterator(): - if param.is_padding: - continue - - if param.is_counter or param.is_image() or param.is_output or param.name in f.count_parameter_list or len(param.count_parameter_list): - location = param.name - else: - location = self.fetch_param(param) - - list.append( '%s %s' % (indent, location) ) - - - if len( list ): - print '%s %sCALL_%s( GET_DISPATCH(), (' % (indent, retval_assign, f.name) - print string.join( list, ",\n" ) - print '%s ) );' % (indent) - else: - print '%s %sCALL_%s( GET_DISPATCH(), () );' % (indent, retval_assign, f.name) - return - - - def common_func_print_just_start(self, f, indent): - align64 = 0 - need_blank = 0 - - - f.calculate_offsets() - for param in f.parameterIterateGlxSend(): - # If any parameter has a 64-bit base type, then we - # have to do alignment magic for the while thing. - - if param.is_64_bit(): - align64 = 1 - - - # FIXME img_null_flag is over-loaded. In addition to - # FIXME being used for images, it is used to signify - # FIXME NULL data pointers for vertex buffer object - # FIXME related functions. Re-name it to null_data - # FIXME or something similar. - - if param.img_null_flag: - print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, param.offset - 4) - cond = '(ptr_is_null != 0) ? NULL : ' - else: - cond = "" - - - type_string = param.type_string() - - if param.is_image(): - offset = f.offset_of( param.name ) - - print '%s %s const %s = (%s) (%s(pc + %s));' % (indent, type_string, param.name, type_string, cond, offset) - - if param.depth: - print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent) - else: - print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent) - - need_blank = 1 - elif param.is_counter or param.name in f.count_parameter_list: - location = self.fetch_param(param) - print '%s const %s %s = %s;' % (indent, type_string, param.name, location) - need_blank = 1 - elif len(param.count_parameter_list): - if param.size() == 1 and not self.do_swap: - location = self.fetch_param(param) - print '%s %s %s = %s%s;' % (indent, type_string, param.name, cond, location) - else: - print '%s %s %s;' % (indent, type_string, param.name) - need_blank = 1 - - - - if need_blank: - print '' - - if align64: - print '#ifdef __GLX_ALIGN64' - - if f.has_variable_size_request(): - self.emit_packet_size_calculation(f, 4) - s = "cmdlen" - else: - s = str((f.command_fixed_length() + 3) & ~3) - - print ' if ((unsigned long)(pc) & 7) {' - print ' (void) memmove(pc-4, pc, %s);' % (s) - print ' pc -= 4;' - print ' }' - print '#endif' - print '' - - - need_blank = 0 - if self.do_swap: - for param in f.parameterIterateGlxSend(): - if param.count_parameter_list: - o = param.offset - count = param.get_element_count() - type_size = param.size() / count - - if param.counter: - count_name = param.counter - else: - count_name = str(count) - - # This is basically an ugly special- - # case for glCallLists. - - if type_size == 1: - x = [] - x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] ) - x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] ) - x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] ) - - print ' switch(%s) {' % (param.count_parameter_list[0]) - for sub in x: - for t_name in sub[1]: - print ' case GL_%s:' % (t_name) - - if sub[0] == 1: - print ' %s = (%s) (pc + %s); break;' % (param.name, param.type_string(), o) - else: - swap_func = self.swap_name(sub[0]) - print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (param.name, param.type_string(), swap_func, self.real_types[sub[0]], o, count_name) - print ' default:' - print ' return;' - print ' }' - else: - swap_func = self.swap_name(type_size) - compsize = self.size_call(f, 1) - print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (param.name, param.type_string(), swap_func, self.real_types[type_size], o, compsize) - - need_blank = 1 - - else: - for param in f.parameterIterateGlxSend(): - if param.count_parameter_list: - print '%s %s = (%s) (pc + %s);' % (indent, param.name, param.type_string(), param.offset) - need_blank = 1 - - - if need_blank: - print '' - - - return - - - def printSingleFunction(self, f, name): - if name not in f.glx_vendorpriv_names: - print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;' - else: - print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;' - - print ' int error;' - - if self.do_swap: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' - else: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' - - print '' - if name not in f.glx_vendorpriv_names: - print ' pc += __GLX_SINGLE_HDR_SIZE;' - else: - print ' pc += __GLX_VENDPRIV_HDR_SIZE;' - - print ' if ( cx != NULL ) {' - self.common_func_print_just_start(f, " ") - - - if f.return_type != 'void': - print ' %s retval;' % (f.return_type) - retval_string = "retval" - retval_assign = "retval = " - else: - retval_string = "0" - retval_assign = "" - - - type_size = 0 - answer_string = "dummy_answer" - answer_count = "0" - is_array_string = "GL_FALSE" - - for param in f.parameterIterateOutputs(): - answer_type = param.get_base_type_string() - if answer_type == "GLvoid": - answer_type = "GLubyte" - - - c = param.get_element_count() - type_size = (param.size() / c) - if type_size == 1: - size_scale = "" - else: - size_scale = " * %u" % (type_size) - - - if param.count_parameter_list: - print ' const GLuint compsize = %s;' % (self.size_call(f, 1)) - print ' %s answerBuffer[200];' % (answer_type) - print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, size_scale, type_size ) - answer_string = param.name - answer_count = "compsize" - - print '' - print ' if (%s == NULL) return BadAlloc;' % (param.name) - print ' __glXClearErrorOccured();' - print '' - elif param.counter: - print ' %s answerBuffer[200];' % (answer_type) - print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size) - answer_string = param.name - answer_count = param.counter - elif c >= 1: - print ' %s %s[%u];' % (answer_type, param.name, c) - answer_string = param.name - answer_count = "%u" % (c) - - if f.reply_always_array: - is_array_string = "GL_TRUE" - - - self.emit_function_call(f, retval_assign, " ") - - - if f.needs_reply(): - if self.do_swap: - for param in f.parameterIterateOutputs(): - c = param.get_element_count() - type_size = (param.size() / c) - - if type_size > 1: - swap_name = self.swap_name( type_size ) - print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, param.name, answer_count) - - - reply_func = '__glXSendReplySwap' - else: - reply_func = '__glXSendReply' - - print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string) - #elif f.note_unflushed: - # print ' cx->hasUnflushedCommands = GL_TRUE;' - - print ' error = Success;' - print ' }' - print '' - print ' return error;' - return - - - def printRenderFunction(self, f): - # There are 4 distinct phases in a rendering dispatch function. - # In the first phase we compute the sizes and offsets of each - # element in the command. In the second phase we (optionally) - # re-align 64-bit data elements. In the third phase we - # (optionally) byte-swap array data. Finally, in the fourth - # phase we actually dispatch the function. - - self.common_func_print_just_start(f, "") - - images = f.get_images() - if len(images): - if self.do_swap: - pre = "bswap_CARD32( & " - post = " )" - else: - pre = "" - post = "" - - img = images[0] - - # swapBytes and lsbFirst are single byte fields, so - # the must NEVER be byte-swapped. - - if not (img.img_type == "GL_BITMAP" and img.img_format == "GL_COLOR_INDEX"): - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );' - - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );' - - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s) );' % (pre, post) - if img.depth: - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s) );' % (pre, post) - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s) );' % (pre, post) - if img.depth: - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s) );' % (pre, post) - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s) );' % (pre, post) - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s) );' % (pre, post) - print '' - - - self.emit_function_call(f, "", "") - return - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") - except Exception,e: - show_usage() - - mode = "dispatch_c" - do_swap = 0 - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "-s": - do_swap = 1 - - if mode == "dispatch_c": - printer = PrintGlxDispatchFunctions(do_swap) - elif mode == "dispatch_h": - printer = PrintGlxDispatch_h() - else: - show_usage() - - api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() ) - - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/glX_proto_send.py b/mesalib/src/mesa/glapi/glX_proto_send.py deleted file mode 100644 index daca1b767..000000000 --- a/mesalib/src/mesa/glapi/glX_proto_send.py +++ /dev/null @@ -1,1042 +0,0 @@ -#!/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 -# Jeremy Kolb - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt, copy, string - -def convertStringForXCB(str): - tmp = "" - special = [ "ARB" ] - i = 0 - while i < len(str): - if str[i:i+3] in special: - tmp = '%s_%s' % (tmp, string.lower(str[i:i+3])) - i = i + 2; - elif str[i].isupper(): - tmp = '%s_%s' % (tmp, string.lower(str[i])) - else: - tmp = '%s%s' % (tmp, str[i]) - i += 1 - return tmp - -def hash_pixel_function(func): - """Generate a 'unique' key for a pixel function. The key is based on - the parameters written in the command packet. This includes any - padding that might be added for the original function and the 'NULL - image' flag.""" - - - h = "" - hash_pre = "" - hash_suf = "" - for param in func.parameterIterateGlxSend(): - if param.is_image(): - [dim, junk, junk, junk, junk] = param.get_dimensions() - - d = (dim + 1) & ~1 - hash_pre = "%uD%uD_" % (d - 1, d) - - if param.img_null_flag: - hash_suf = "_NF" - - h += "%u" % (param.size()) - - if func.pad_after(param): - h += "4" - - - n = func.name.replace("%uD" % (dim), "") - n = "__glx_%s_%uD%uD" % (n, d - 1, d) - - h = hash_pre + h + hash_suf - return [h, n] - - -class glx_pixel_function_stub(glX_XML.glx_function): - """Dummy class used to generate pixel "utility" functions that are - shared by multiple dimension image functions. For example, these - objects are used to generate shared functions used to send GLX - protocol for TexImage1D and TexImage2D, TexSubImage1D and - TexSubImage2D, etc.""" - - def __init__(self, func, name): - # The parameters to the utility function are the same as the - # parameters to the real function except for the added "pad" - # parameters. - - self.name = name - self.images = [] - self.parameters = [] - self.parameters_by_name = {} - for _p in func.parameterIterator(): - p = copy.copy(_p) - self.parameters.append(p) - self.parameters_by_name[ p.name ] = p - - - if p.is_image(): - self.images.append(p) - p.height = "height" - - if p.img_yoff == None: - p.img_yoff = "yoffset" - - if p.depth: - if p.extent == None: - p.extent = "extent" - - if p.img_woff == None: - p.img_woff = "woffset" - - - pad_name = func.pad_after(p) - if pad_name: - pad = copy.copy(p) - pad.name = pad_name - self.parameters.append(pad) - self.parameters_by_name[ pad.name ] = pad - - - self.return_type = func.return_type - - self.glx_rop = ~0 - self.glx_sop = 0 - self.glx_vendorpriv = 0 - - self.glx_doubles_in_order = func.glx_doubles_in_order - - self.vectorequiv = None - self.output = None - self.can_be_large = func.can_be_large - self.reply_always_array = func.reply_always_array - self.dimensions_in_reply = func.dimensions_in_reply - self.img_reset = None - - self.server_handcode = 0 - self.client_handcode = 0 - self.ignore = 0 - - self.count_parameter_list = func.count_parameter_list - self.counter_list = func.counter_list - self.offsets_calculated = 0 - return - - -class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): - def __init__(self): - glX_proto_common.glx_print_proto.__init__(self) - self.name = "glX_proto_send.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004, 2005", "IBM") - - - self.last_category = "" - self.generic_sizes = [3, 4, 6, 8, 12, 16, 24, 32] - self.pixel_stubs = {} - self.debug = 0 - return - - def printRealHeader(self): - print '' - print '#include ' - print '#include "indirect.h"' - print '#include "glxclient.h"' - print '#include "indirect_size.h"' - print '#include "dispatch.h"' - print '#include "glapi.h"' - print '#include "glthread.h"' - print '#include ' - print '#ifdef USE_XCB' - print '#include ' - print '#include ' - print '#include ' - print '#endif /* USE_XCB */' - - print '' - print '#define __GLX_PAD(n) (((n) + 3) & ~3)' - print '' - self.printFastcall() - self.printNoinline() - print '' - print '#if !defined __GNUC__ || __GNUC__ < 3' - print '# define __builtin_expect(x, y) x' - print '#endif' - print '' - print '/* If the size and opcode values are known at compile-time, this will, on' - print ' * x86 at least, emit them with a single instruction.' - print ' */' - print '#define emit_header(dest, op, size) \\' - print ' do { union { short s[2]; int i; } temp; \\' - print ' temp.s[0] = (size); temp.s[1] = (op); \\' - print ' *((int *)(dest)) = temp.i; } while(0)' - print '' - print """NOINLINE CARD32 -__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) -{ - xGLXSingleReply reply; - - (void) _XReply(dpy, (xReply *) & reply, 0, False); - if (size != 0) { - if ((reply.length > 0) || reply_is_always_array) { - const GLint bytes = (reply_is_always_array) - ? (4 * reply.length) : (reply.size * size); - const GLint extra = 4 - (bytes & 3); - - _XRead(dpy, dest, bytes); - if ( extra < 4 ) { - _XEatData(dpy, extra); - } - } - else { - (void) memcpy( dest, &(reply.pad3), size); - } - } - - return reply.retval; -} - -NOINLINE void -__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, - GLint width, GLint height, GLint depth, GLenum format, GLenum type, - void * dest, GLboolean dimensions_in_reply ) -{ - xGLXSingleReply reply; - GLint size; - - (void) _XReply(dpy, (xReply *) & reply, 0, False); - - if ( dimensions_in_reply ) { - width = reply.pad3; - height = reply.pad4; - depth = reply.pad5; - - if ((height == 0) || (max_dim < 2)) { height = 1; } - if ((depth == 0) || (max_dim < 3)) { depth = 1; } - } - - size = reply.length * 4; - if (size != 0) { - void * buf = Xmalloc( size ); - - if ( buf == NULL ) { - _XEatData(dpy, size); - __glXSetError(gc, GL_OUT_OF_MEMORY); - } - else { - const GLint extra = 4 - (size & 3); - - _XRead(dpy, buf, size); - if ( extra < 4 ) { - _XEatData(dpy, extra); - } - - __glEmptyImage(gc, 3, width, height, depth, format, type, - buf, dest); - Xfree(buf); - } - } -} - -#define X_GLXSingle 0 - -NOINLINE FASTCALL GLubyte * -__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) -{ - xGLXSingleReq * req; - Display * const dpy = gc->currentDpy; - - (void) __glXFlushRenderBuffer(gc, gc->pc); - LockDisplay(dpy); - GetReqExtra(GLXSingle, cmdlen, req); - req->reqType = gc->majorOpcode; - req->contextTag = gc->currentContextTag; - req->glxCode = sop; - return (GLubyte *)(req) + sz_xGLXSingleReq; -} - -NOINLINE FASTCALL GLubyte * -__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) -{ - xGLXVendorPrivateReq * req; - Display * const dpy = gc->currentDpy; - - (void) __glXFlushRenderBuffer(gc, gc->pc); - LockDisplay(dpy); - GetReqExtra(GLXVendorPrivate, cmdlen, req); - req->reqType = gc->majorOpcode; - req->glxCode = code; - req->vendorCode = vop; - req->contextTag = gc->currentContextTag; - return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; -} - -const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; - -#define zero (__glXDefaultPixelStore+0) -#define one (__glXDefaultPixelStore+8) -#define default_pixel_store_1D (__glXDefaultPixelStore+4) -#define default_pixel_store_1D_size 20 -#define default_pixel_store_2D (__glXDefaultPixelStore+4) -#define default_pixel_store_2D_size 20 -#define default_pixel_store_3D (__glXDefaultPixelStore+0) -#define default_pixel_store_3D_size 36 -#define default_pixel_store_4D (__glXDefaultPixelStore+0) -#define default_pixel_store_4D_size 36 -""" - - for size in self.generic_sizes: - self.print_generic_function(size) - return - - - def printBody(self, api): - - self.pixel_stubs = {} - generated_stubs = [] - - for func in api.functionIterateGlx(): - if func.client_handcode: continue - - # If the function is a pixel function with a certain - # GLX protocol signature, create a fake stub function - # for it. For example, create a single stub function - # that is used to implement both glTexImage1D and - # glTexImage2D. - - if func.glx_rop != 0: - do_it = 0 - for image in func.get_images(): - if image.img_pad_dimensions: - do_it = 1 - break - - - if do_it: - [h, n] = hash_pixel_function(func) - - - self.pixel_stubs[ func.name ] = n - if h not in generated_stubs: - generated_stubs.append(h) - - fake_func = glx_pixel_function_stub( func, n ) - self.printFunction(fake_func, fake_func.name) - - - self.printFunction(func, func.name) - if func.glx_sop and func.glx_vendorpriv: - self.printFunction(func, func.glx_vendorpriv_names[0]) - - return - - - def printFunction(self, func, name): - footer = '}\n' - if func.glx_rop == ~0: - print 'static %s' % (func.return_type) - print '%s( unsigned opcode, unsigned dim, %s )' % (func.name, func.get_parameter_string()) - print '{' - else: - if func.has_different_protocol(name): - if func.return_type == "void": - ret_string = '' - else: - ret_string = "return " - - func_name = func.static_glx_name(name) - print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv) - print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()) - print '{' - print ' __GLXcontext * const gc = __glXGetCurrentContext();' - print '' - print '#ifdef GLX_DIRECT_RENDERING' - print ' if (gc->driContext) {' - print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) - print ' } else' - print '#endif' - print ' {' - - footer = '}\n}\n' - else: - print '#define %s %d' % (func.opcode_name(), func.opcode_value()) - - print '%s __indirect_gl%s(%s)' % (func.return_type, name, func.get_parameter_string()) - print '{' - - - if func.glx_rop != 0 or func.vectorequiv != None: - if len(func.images): - self.printPixelFunction(func) - else: - self.printRenderFunction(func) - elif func.glx_sop != 0 or func.glx_vendorpriv != 0: - self.printSingleFunction(func, name) - pass - else: - print "/* Missing GLX protocol for %s. */" % (name) - - print footer - return - - - def print_generic_function(self, n): - size = (n + 3) & ~3 - print """static FASTCALL NOINLINE void -generic_%u_byte( GLint rop, const void * ptr ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint cmdlen = %u; - - emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, %u); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } -} -""" % (n, size + 4, size) - return - - - def common_emit_one_arg(self, p, pc, adjust, extra_offset): - if p.is_array(): - src_ptr = p.name - else: - src_ptr = "&" + p.name - - if p.is_padding: - print '(void) memset((void *)(%s + %u), 0, %s);' \ - % (pc, p.offset + adjust, p.size_string() ) - elif not extra_offset: - print '(void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \ - % (pc, p.offset + adjust, src_ptr, p.size_string() ) - else: - print '(void) memcpy((void *)(%s + %u + %s), (void *)(%s), %s);' \ - % (pc, p.offset + adjust, extra_offset, src_ptr, p.size_string() ) - - def common_emit_args(self, f, pc, adjust, skip_vla): - extra_offset = None - - for p in f.parameterIterateGlxSend( not skip_vla ): - if p.name != f.img_reset: - self.common_emit_one_arg(p, pc, adjust, extra_offset) - - if p.is_variable_length(): - temp = p.size_string() - if extra_offset: - extra_offset += " + %s" % (temp) - else: - extra_offset = temp - - return - - - def pixel_emit_args(self, f, pc, large): - """Emit the arguments for a pixel function. This differs from - common_emit_args in that pixel functions may require padding - be inserted (i.e., for the missing width field for - TexImage1D), and they may also require a 'NULL image' flag - be inserted before the image data.""" - - if large: - adjust = 8 - else: - adjust = 4 - - for param in f.parameterIterateGlxSend(): - if not param.is_image(): - self.common_emit_one_arg(param, pc, adjust, None) - - if f.pad_after(param): - print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset + param.size()) + adjust) - - else: - [dim, width, height, depth, extent] = param.get_dimensions() - if f.glx_rop == ~0: - dim_str = "dim" - else: - dim_str = str(dim) - - if param.is_padding: - print '(void) memset((void *)(%s + %u), 0, %s);' \ - % (pc, (param.offset - 4) + adjust, param.size_string() ) - - if param.img_null_flag: - if large: - print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset - 4) + adjust) - else: - print '(void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (pc, (param.offset - 4) + adjust, param.name) - - - pixHeaderPtr = "%s + %u" % (pc, adjust) - pcPtr = "%s + %u" % (pc, param.offset + adjust) - - if not large: - if param.img_send_null: - condition = '(compsize > 0) && (%s != NULL)' % (param.name) - else: - condition = 'compsize > 0' - - print 'if (%s) {' % (condition) - print ' (*gc->fillImage)(gc, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) - print '} else {' - print ' (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (pixHeaderPtr, dim, dim) - print '}' - else: - print '__glXSendLargeImage(gc, compsize, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) - - return - - - def large_emit_begin(self, f, op_name = None): - if not op_name: - op_name = f.opcode_real_name() - - print 'const GLint op = %s;' % (op_name) - print 'const GLuint cmdlenLarge = cmdlen + 4;' - print 'GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);' - print '(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);' - print '(void) memcpy((void *)(pc + 4), (void *)(&op), 4);' - return - - - def common_func_print_just_start(self, f, name): - print ' __GLXcontext * const gc = __glXGetCurrentContext();' - - # The only reason that single and vendor private commands need - # a variable called 'dpy' is becuase they use the SyncHandle - # macro. For whatever brain-dead reason, that macro is hard- - # coded to use a variable called 'dpy' instead of taking a - # parameter. - - # FIXME Simplify the logic related to skip_condition and - # FIXME condition_list in this function. Basically, remove - # FIXME skip_condition, and just append the "dpy != NULL" type - # FIXME condition to condition_list from the start. The only - # FIXME reason it's done in this confusing way now is to - # FIXME minimize the diffs in the generated code. - - if not f.glx_rop: - for p in f.parameterIterateOutputs(): - if p.is_image() and (p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP"): - print ' const __GLXattribute * const state = gc->client_state_private;' - break - - print ' Display * const dpy = gc->currentDpy;' - skip_condition = "dpy != NULL" - elif f.can_be_large: - skip_condition = "gc->currentDpy != NULL" - else: - skip_condition = None - - - if f.return_type != 'void': - print ' %s retval = (%s) 0;' % (f.return_type, f.return_type) - - - if name != None and name not in f.glx_vendorpriv_names: - print '#ifndef USE_XCB' - self.emit_packet_size_calculation(f, 0) - if name != None and name not in f.glx_vendorpriv_names: - print '#endif' - - condition_list = [] - for p in f.parameterIterateCounters(): - condition_list.append( "%s >= 0" % (p.name) ) - # 'counter' parameters cannot be negative - print " if (%s < 0) {" % p.name - print " __glXSetError(gc, GL_INVALID_VALUE);" - if f.return_type != 'void': - print " return 0;" - else: - print " return;" - print " }" - - if skip_condition: - condition_list.append( skip_condition ) - - if len( condition_list ) > 0: - if len( condition_list ) > 1: - skip_condition = "(%s)" % (string.join( condition_list, ") && (" )) - else: - skip_condition = "%s" % (condition_list.pop(0)) - - print ' if (__builtin_expect(%s, 1)) {' % (skip_condition) - return 1 - else: - return 0 - - - def printSingleFunction(self, f, name): - self.common_func_print_just_start(f, name) - - if self.debug: - print ' printf( "Enter %%s...\\n", "gl%s" );' % (f.name) - - if name not in f.glx_vendorpriv_names: - - # XCB specific: - print '#ifdef USE_XCB' - if self.debug: - print ' printf("\\tUsing XCB.\\n");' - print ' xcb_connection_t *c = XGetXCBConnection(dpy);' - print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' - xcb_name = 'xcb_glx%s' % convertStringForXCB(name) - - iparams=[] - extra_iparams = [] - output = None - for p in f.parameterIterator(): - if p.is_output: - output = p - - if p.is_image(): - if p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP": - extra_iparams.append("state->storePack.swapEndian") - else: - extra_iparams.append("0") - - # Hardcode this in. lsb_first param (apparently always GL_FALSE) - # also present in GetPolygonStipple, but taken care of above. - if xcb_name == "xcb_glx_read_pixels": - extra_iparams.append("0") - else: - iparams.append(p.name) - - - xcb_request = '%s(%s)' % (xcb_name, ", ".join(["c", "gc->currentContextTag"] + iparams + extra_iparams)) - - if f.needs_reply(): - print ' %s_reply_t *reply = %s_reply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request) - if output and f.reply_always_array: - print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) - - elif output and not f.reply_always_array: - if not output.is_image(): - print ' if (%s_data_length(reply) == 0)' % (xcb_name) - print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name) - print ' else' - print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) - - - if f.return_type != 'void': - print ' retval = reply->ret_val;' - print ' free(reply);' - else: - print ' ' + xcb_request + ';' - print '#else' - # End of XCB specific. - - - if f.parameters != []: - pc_decl = "GLubyte const * pc =" - else: - pc_decl = "(void)" - - if name in f.glx_vendorpriv_names: - print ' %s __glXSetupVendorRequest(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_vendor_name(name)) - else: - print ' %s __glXSetupSingleRequest(gc, %s, cmdlen);' % (pc_decl, f.opcode_name()) - - self.common_emit_args(f, "pc", 0, 0) - - images = f.get_images() - - for img in images: - if img.is_output: - o = f.command_fixed_length() - 4 - print ' *(int32_t *)(pc + %u) = 0;' % (o) - if img.img_format != "GL_COLOR_INDEX" or img.img_type != "GL_BITMAP": - print ' * (int8_t *)(pc + %u) = state->storePack.swapEndian;' % (o) - - if f.img_reset: - print ' * (int8_t *)(pc + %u) = %s;' % (o + 1, f.img_reset) - - - return_name = '' - if f.needs_reply(): - if f.return_type != 'void': - return_name = " retval" - return_str = " retval = (%s)" % (f.return_type) - else: - return_str = " (void)" - - got_reply = 0 - - for p in f.parameterIterateOutputs(): - if p.is_image(): - [dim, w, h, d, junk] = p.get_dimensions() - if f.dimensions_in_reply: - print " __glXReadPixelReply(dpy, gc, %u, 0, 0, 0, %s, %s, %s, GL_TRUE);" % (dim, p.img_format, p.img_type, p.name) - else: - print " __glXReadPixelReply(dpy, gc, %u, %s, %s, %s, %s, %s, %s, GL_FALSE);" % (dim, w, h, d, p.img_format, p.img_type, p.name) - - got_reply = 1 - else: - if f.reply_always_array: - aa = "GL_TRUE" - else: - aa = "GL_FALSE" - - # gl_parameter.size() returns the size - # of the entire data item. If the - # item is a fixed-size array, this is - # the size of the whole array. This - # is not what __glXReadReply wants. It - # wants the size of a single data - # element in the reply packet. - # Dividing by the array size (1 for - # non-arrays) gives us this. - - s = p.size() / p.get_element_count() - print " %s __glXReadReply(dpy, %s, %s, %s);" % (return_str, s, p.name, aa) - got_reply = 1 - - - # If a reply wasn't read to fill an output parameter, - # read a NULL reply to get the return value. - - if not got_reply: - print " %s __glXReadReply(dpy, 0, NULL, GL_FALSE);" % (return_str) - - - elif self.debug: - # Only emit the extra glFinish call for functions - # that don't already require a reply from the server. - print ' __indirect_glFinish();' - - if self.debug: - print ' printf( "Exit %%s.\\n", "gl%s" );' % (name) - - - print ' UnlockDisplay(dpy); SyncHandle();' - - if name not in f.glx_vendorpriv_names: - print '#endif /* USE_XCB */' - - print ' }' - print ' return%s;' % (return_name) - return - - - def printPixelFunction(self, f): - if self.pixel_stubs.has_key( f.name ): - # Normally gl_function::get_parameter_string could be - # used. However, this call needs to have the missing - # dimensions (e.g., a fake height value for - # glTexImage1D) added in. - - p_string = "" - for param in f.parameterIterateGlxSend(): - if param.is_padding: - continue - - p_string += ", " + param.name - - if param.is_image(): - [dim, junk, junk, junk, junk] = param.get_dimensions() - - if f.pad_after(param): - p_string += ", 1" - - print ' %s(%s, %u%s );' % (self.pixel_stubs[f.name] , f.opcode_name(), dim, p_string) - return - - - if self.common_func_print_just_start(f, None): - trailer = " }" - else: - trailer = None - - - if f.can_be_large: - print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' - print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' - print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' - print ' }' - - if f.glx_rop == ~0: - opcode = "opcode" - else: - opcode = f.opcode_real_name() - - print 'emit_header(gc->pc, %s, cmdlen);' % (opcode) - - self.pixel_emit_args( f, "gc->pc", 0 ) - print 'gc->pc += cmdlen;' - print 'if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' - - if f.can_be_large: - print '}' - print 'else {' - - self.large_emit_begin(f, opcode) - self.pixel_emit_args(f, "pc", 1) - - print '}' - - if trailer: print trailer - return - - - def printRenderFunction(self, f): - # There is a class of GL functions that take a single pointer - # as a parameter. This pointer points to a fixed-size chunk - # of data, and the protocol for this functions is very - # regular. Since they are so regular and there are so many - # of them, special case them with generic functions. On - # x86, this saves about 26KB in the libGL.so binary. - - if f.variable_length_parameter() == None and len(f.parameters) == 1: - p = f.parameters[0] - if p.is_pointer(): - cmdlen = f.command_fixed_length() - if cmdlen in self.generic_sizes: - print ' generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name) - return - - if self.common_func_print_just_start(f, None): - trailer = " }" - else: - trailer = None - - if self.debug: - print 'printf( "Enter %%s...\\n", "gl%s" );' % (f.name) - - if f.can_be_large: - print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' - print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' - print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' - print ' }' - - print 'emit_header(gc->pc, %s, cmdlen);' % (f.opcode_real_name()) - - self.common_emit_args(f, "gc->pc", 4, 0) - print 'gc->pc += cmdlen;' - print 'if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' - - if f.can_be_large: - print '}' - print 'else {' - - self.large_emit_begin(f) - self.common_emit_args(f, "pc", 8, 1) - - p = f.variable_length_parameter() - print ' __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (p.offset + 8, p.name, p.size_string()) - print '}' - - if self.debug: - print '__indirect_glFinish();' - print 'printf( "Exit %%s.\\n", "gl%s" );' % (f.name) - - if trailer: print trailer - return - - -class PrintGlxProtoInit_c(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_send.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") - return - - - def printRealHeader(self): - print """/** - * \\file indirect_init.c - * Initialize indirect rendering dispatch table. - * - * \\author Kevin E. Martin - * \\author Brian Paul - * \\author Ian Romanick - */ - -#include "indirect_init.h" -#include "indirect.h" -#include "glapi.h" - - -/** - * No-op function used to initialize functions that have no GLX protocol - * support. - */ -static int NoOp(void) -{ - return 0; -} - -/** - * Create and initialize a new GL dispatch table. The table is initialized - * with GLX indirect rendering protocol functions. - */ -__GLapi * __glXNewIndirectAPI( void ) -{ - __GLapi *glAPI; - GLuint entries; - - entries = _glapi_get_dispatch_table_size(); - glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); - - /* first, set all entries to point to no-op functions */ - { - int i; - void **dispatch = (void **) glAPI; - for (i = 0; i < entries; i++) { - dispatch[i] = (void *) NoOp; - } - } - - /* now, initialize the entries we understand */""" - - def printRealFooter(self): - print """ - return glAPI; -} -""" - return - - - def printBody(self, api): - for [name, number] in api.categoryIterate(): - if number != None: - preamble = '\n /* %3u. %s */\n\n' % (int(number), name) - else: - preamble = '\n /* %s */\n\n' % (name) - - for func in api.functionIterateByCategory(name): - if func.client_supported_for_indirect(): - print '%s glAPI->%s = __indirect_gl%s;' % (preamble, func.name, func.name) - preamble = '' - - return - - -class PrintGlxProtoInit_h(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_send.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") - self.header_tag = "_INDIRECT_H_" - - self.last_category = "" - return - - - def printRealHeader(self): - print """/** - * \\file - * Prototypes for indirect rendering functions. - * - * \\author Kevin E. Martin - * \\author Ian Romanick - */ -""" - self.printVisibility( "HIDDEN", "hidden" ) - self.printFastcall() - self.printNoinline() - - print """ -#include "glxclient.h" - -extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, - void * dest, GLboolean reply_is_always_array ); - -extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, - __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, - GLint depth, GLenum format, GLenum type, void * dest, - GLboolean dimensions_in_reply ); - -extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( - __GLXcontext * gc, GLint sop, GLint cmdlen ); - -extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( - __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); -""" - - - def printBody(self, api): - for func in api.functionIterateGlx(): - params = func.get_parameter_string() - - print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params) - - for n in func.entry_points: - if func.has_different_protocol(n): - asdf = func.static_glx_name(n) - if asdf not in func.static_entry_points: - print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params) - else: - print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params) - - break - - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode] [-d]" % sys.argv[0] - print " -m output_mode Output mode can be one of 'proto', 'init_c' or 'init_h'." - print " -d Enable extra debug information in the generated code." - sys.exit(1) - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:d") - except Exception,e: - show_usage() - - debug = 0 - mode = "proto" - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "-d": - debug = 1 - - if mode == "proto": - printer = PrintGlxProtoStubs() - elif mode == "init_c": - printer = PrintGlxProtoInit_c() - elif mode == "init_h": - printer = PrintGlxProtoInit_h() - else: - show_usage() - - - printer.debug = debug - api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) - - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/glX_proto_size.py b/mesalib/src/mesa/glapi/glX_proto_size.py deleted file mode 100644 index 95cb5110c..000000000 --- a/mesalib/src/mesa/glapi/glX_proto_size.py +++ /dev/null @@ -1,704 +0,0 @@ -#!/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 - -import gl_XML, glX_XML -import license -import sys, getopt, copy, string - - -class glx_enum_function: - def __init__(self, func_name, enum_dict): - self.name = func_name - self.mode = 1 - self.sig = None - - # "enums" is a set of lists. The element in the set is the - # value of the enum. The list is the list of names for that - # value. For example, [0x8126] = {"POINT_SIZE_MIN", - # "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT", - # "POINT_SIZE_MIN_SGIS"}. - - self.enums = {} - - # "count" is indexed by count values. Each element of count - # is a list of index to "enums" that have that number of - # associated data elements. For example, [4] = - # {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, - # GL_AMBIENT_AND_DIFFUSE} (the enum names are used here, - # but the actual hexadecimal values would be in the array). - - self.count = {} - - - # Fill self.count and self.enums using the dictionary of enums - # that was passed in. The generic Get functions (e.g., - # GetBooleanv and friends) are handled specially here. In - # the data the generic Get functions are refered to as "Get". - - if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]: - match_name = "Get" - else: - match_name = func_name - - mode_set = 0 - for enum_name in enum_dict: - e = enum_dict[ enum_name ] - - if e.functions.has_key( match_name ): - [count, mode] = e.functions[ match_name ] - - if mode_set and mode != self.mode: - raise RuntimeError("Not all enums for %s have the same mode." % (func_name)) - - self.mode = mode - - if self.enums.has_key( e.value ): - if e.name not in self.enums[ e.value ]: - self.enums[ e.value ].append( e ) - else: - if not self.count.has_key( count ): - self.count[ count ] = [] - - self.enums[ e.value ] = [ e ] - self.count[ count ].append( e.value ) - - - return - - - def signature( self ): - if self.sig == None: - self.sig = "" - for i in self.count: - if i == None: - raise RuntimeError("i is None. WTF?") - - self.count[i].sort() - for e in self.count[i]: - self.sig += "%04x,%d," % (e, i) - - return self.sig - - - def is_set( self ): - return self.mode - - - def PrintUsingTable(self): - """Emit the body of the __gl*_size function using a pair - of look-up tables and a mask. The mask is calculated such - that (e & mask) is unique for all the valid values of e for - this function. The result of (e & mask) is used as an index - into the first look-up table. If it matches e, then the - same entry of the second table is returned. Otherwise zero - is returned. - - It seems like this should cause better code to be generated. - However, on x86 at least, the resulting .o file is about 20% - larger then the switch-statment version. I am leaving this - code in because the results may be different on other - platforms (e.g., PowerPC or x86-64).""" - - return 0 - count = 0 - for a in self.enums: - count += 1 - - if self.count.has_key(-1): - return 0 - - # Determine if there is some mask M, such that M = (2^N) - 1, - # that will generate unique values for all of the enums. - - mask = 0 - for i in [1, 2, 3, 4, 5, 6, 7, 8]: - mask = (1 << i) - 1 - - fail = 0; - for a in self.enums: - for b in self.enums: - if a != b: - if (a & mask) == (b & mask): - fail = 1; - - if not fail: - break; - else: - mask = 0 - - if (mask != 0) and (mask < (2 * count)): - masked_enums = {} - masked_count = {} - - for i in range(0, mask + 1): - masked_enums[i] = "0"; - masked_count[i] = 0; - - for c in self.count: - for e in self.count[c]: - i = e & mask - enum_obj = self.enums[e][0] - masked_enums[i] = '0x%04x /* %s */' % (e, enum_obj.name ) - masked_count[i] = c - - - print ' static const GLushort a[%u] = {' % (mask + 1) - for e in masked_enums: - print ' %s, ' % (masked_enums[e]) - print ' };' - - print ' static const GLubyte b[%u] = {' % (mask + 1) - for c in masked_count: - print ' %u, ' % (masked_count[c]) - print ' };' - - print ' const unsigned idx = (e & 0x%02xU);' % (mask) - print '' - print ' return (e == a[idx]) ? (GLint) b[idx] : 0;' - return 1; - else: - return 0; - - - def PrintUsingSwitch(self, name): - """Emit the body of the __gl*_size function using a - switch-statement.""" - - print ' switch( e ) {' - - for c in self.count: - for e in self.count[c]: - first = 1 - - # There may be multiple enums with the same - # value. This happens has extensions are - # promoted from vendor-specific or EXT to - # ARB and to the core. Emit the first one as - # a case label, and emit the others as - # commented-out case labels. - - list = {} - for enum_obj in self.enums[e]: - list[ enum_obj.priority() ] = enum_obj.name - - keys = list.keys() - keys.sort() - for k in keys: - j = list[k] - if first: - print ' case GL_%s:' % (j) - first = 0 - else: - print '/* case GL_%s:*/' % (j) - - if c == -1: - print ' return __gl%s_variable_size( e );' % (name) - else: - print ' return %u;' % (c) - - print ' default: return 0;' - print ' }' - - - def Print(self, name): - print 'INTERNAL PURE FASTCALL GLint' - print '__gl%s_size( GLenum e )' % (name) - print '{' - - if not self.PrintUsingTable(): - self.PrintUsingSwitch(name) - - print '}' - print '' - - -class glx_server_enum_function(glx_enum_function): - def __init__(self, func, enum_dict): - glx_enum_function.__init__(self, func.name, enum_dict) - - self.function = func - return - - - def signature( self ): - if self.sig == None: - sig = glx_enum_function.signature(self) - - p = self.function.variable_length_parameter() - if p: - sig += "%u" % (p.size()) - - self.sig = sig - - return self.sig; - - - def Print(self, name, printer): - f = self.function - printer.common_func_print_just_header( f ) - - fixup = [] - - foo = {} - for param_name in f.count_parameter_list: - o = f.offset_of( param_name ) - foo[o] = param_name - - for param_name in f.counter_list: - o = f.offset_of( param_name ) - foo[o] = param_name - - keys = foo.keys() - keys.sort() - for o in keys: - p = f.parameters_by_name[ foo[o] ] - - printer.common_emit_one_arg(p, "pc", 0) - fixup.append( p.name ) - - - print ' GLsizei compsize;' - print '' - - printer.common_emit_fixups(fixup) - - print '' - print ' compsize = __gl%s_size(%s);' % (f.name, string.join(f.count_parameter_list, ",")) - p = f.variable_length_parameter() - print ' return __GLX_PAD(%s);' % (p.size_string()) - - print '}' - print '' - - -class PrintGlxSizeStubs_common(gl_XML.gl_print_base): - do_get = (1 << 0) - do_set = (1 << 1) - - def __init__(self, which_functions): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_size.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM") - - self.emit_set = ((which_functions & PrintGlxSizeStubs_common.do_set) != 0) - self.emit_get = ((which_functions & PrintGlxSizeStubs_common.do_get) != 0) - return - - -class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): - def printRealHeader(self): - print '' - print '#include ' - if self.emit_get: - print '#include "indirect_size_get.h"' - print '#include "glxserver.h"' - print '#include "indirect_util.h"' - - print '#include "indirect_size.h"' - - print '' - self.printPure() - print '' - self.printFastcall() - print '' - self.printVisibility( "INTERNAL", "internal" ) - print '' - print '' - print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)' - print '# undef HAVE_ALIAS' - print '#endif' - print '#ifdef HAVE_ALIAS' - print '# define ALIAS2(from,to) \\' - print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' - print ' __attribute__ ((alias( # to )));' - print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )' - print '#else' - print '# define ALIAS(from,to) \\' - print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' - print ' { return __gl ## to ## _size( e ); }' - print '#endif' - print '' - print '' - - - def printBody(self, api): - enum_sigs = {} - aliases = [] - - for func in api.functionIterateGlx(): - ef = glx_enum_function( func.name, api.enums_by_name ) - if len(ef.enums) == 0: - continue - - if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): - sig = ef.signature() - if enum_sigs.has_key( sig ): - aliases.append( [func.name, enum_sigs[ sig ]] ) - else: - enum_sigs[ sig ] = func.name - ef.Print( func.name ) - - - for [alias_name, real_name] in aliases: - print 'ALIAS( %s, %s )' % (alias_name, real_name) - - - -class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): - def printRealHeader(self): - print """/** - * \\file - * Prototypes for functions used to determine the number of data elements in - * various GLX protocol messages. - * - * \\author Ian Romanick - */ -""" - self.printPure(); - print '' - self.printFastcall(); - print '' - self.printVisibility( "INTERNAL", "internal" ); - print '' - - - def printBody(self, api): - for func in api.functionIterateGlx(): - ef = glx_enum_function( func.name, api.enums_by_name ) - if len(ef.enums) == 0: - continue - - if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): - print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name) - - -class PrintGlxReqSize_common(gl_XML.gl_print_base): - """Common base class for PrintGlxSizeReq_h and PrintGlxSizeReq_h. - - The main purpose of this common base class is to provide the infrastructure - for the derrived classes to iterate over the same set of functions. - """ - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_size.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") - - -class PrintGlxReqSize_h(PrintGlxReqSize_common): - def __init__(self): - PrintGlxReqSize_common.__init__(self) - self.header_tag = "_INDIRECT_REQSIZE_H_" - - - def printRealHeader(self): - self.printVisibility("HIDDEN", "hidden") - print '' - self.printPure() - print '' - - - def printBody(self, api): - for func in api.functionIterateGlx(): - if not func.ignore and func.has_variable_size_request(): - print 'extern PURE HIDDEN int __glX%sReqSize(const GLbyte *pc, Bool swap);' % (func.name) - - -class PrintGlxReqSize_c(PrintGlxReqSize_common): - """Create the server-side 'request size' functions. - - Create the server-side functions that are used to determine what the - size of a varible length command should be. The server then uses - this value to determine if the incoming command packed it malformed. - """ - - def __init__(self): - PrintGlxReqSize_common.__init__(self) - self.counter_sigs = {} - - - def printRealHeader(self): - print '' - print '#include ' - print '#include "glxserver.h"' - print '#include "glxbyteorder.h"' - print '#include "indirect_size.h"' - print '#include "indirect_reqsize.h"' - print '' - print '#define __GLX_PAD(x) (((x) + 3) & ~3)' - print '' - print '#if defined(__CYGWIN__) || defined(__MINGW32__)' - print '# undef HAVE_ALIAS' - print '#endif' - print '#ifdef HAVE_ALIAS' - print '# define ALIAS2(from,to) \\' - print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' - print ' __attribute__ ((alias( # to )));' - print '# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )' - print '#else' - print '# define ALIAS(from,to) \\' - print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' - print ' { return __glX ## to ## ReqSize( pc, swap ); }' - print '#endif' - print '' - print '' - - - def printBody(self, api): - aliases = [] - enum_functions = {} - enum_sigs = {} - - for func in api.functionIterateGlx(): - if not func.has_variable_size_request(): continue - - ef = glx_server_enum_function( func, api.enums_by_name ) - if len(ef.enums) == 0: continue - - sig = ef.signature() - - if not enum_functions.has_key(func.name): - enum_functions[ func.name ] = sig - - if not enum_sigs.has_key( sig ): - enum_sigs[ sig ] = ef - - - - for func in api.functionIterateGlx(): - # Even though server-handcode fuctions are on "the - # list", and prototypes are generated for them, there - # isn't enough information to generate a size - # function. If there was enough information, they - # probably wouldn't need to be handcoded in the first - # place! - - if func.server_handcode: continue - if not func.has_variable_size_request(): continue - - if enum_functions.has_key(func.name): - sig = enum_functions[func.name] - ef = enum_sigs[ sig ] - - if ef.name != func.name: - aliases.append( [func.name, ef.name] ) - else: - ef.Print( func.name, self ) - - elif func.images: - self.printPixelFunction(func) - elif func.has_variable_size_request(): - a = self.printCountedFunction(func) - if a: aliases.append(a) - - - for [alias_name, real_name] in aliases: - print 'ALIAS( %s, %s )' % (alias_name, real_name) - - return - - - def common_emit_fixups(self, fixup): - """Utility function to emit conditional byte-swaps.""" - - if fixup: - print ' if (swap) {' - for name in fixup: - print ' %s = bswap_32(%s);' % (name, name) - print ' }' - - return - - - def common_emit_one_arg(self, p, pc, adjust): - offset = p.offset - dst = p.string() - src = '(%s *)' % (p.type_string()) - print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust); - return - - - def common_func_print_just_header(self, f): - print 'int' - print '__glX%sReqSize( const GLbyte * pc, Bool swap )' % (f.name) - print '{' - - - def printPixelFunction(self, f): - self.common_func_print_just_header(f) - - f.offset_of( f.parameters[0].name ) - [dim, w, h, d, junk] = f.get_images()[0].get_dimensions() - - print ' GLint row_length = * (GLint *)(pc + 4);' - - if dim < 3: - fixup = ['row_length', 'skip_rows', 'alignment'] - print ' GLint image_height = 0;' - print ' GLint skip_images = 0;' - print ' GLint skip_rows = * (GLint *)(pc + 8);' - print ' GLint alignment = * (GLint *)(pc + 16);' - else: - fixup = ['row_length', 'image_height', 'skip_rows', 'skip_images', 'alignment'] - print ' GLint image_height = * (GLint *)(pc + 8);' - print ' GLint skip_rows = * (GLint *)(pc + 16);' - print ' GLint skip_images = * (GLint *)(pc + 20);' - print ' GLint alignment = * (GLint *)(pc + 32);' - - img = f.images[0] - for p in f.parameterIterateGlxSend(): - if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]: - self.common_emit_one_arg(p, "pc", 0) - fixup.append( p.name ) - - print '' - - self.common_emit_fixups(fixup) - - if img.img_null_flag: - print '' - print ' if (*(CARD32 *) (pc + %s))' % (img.offset - 4) - print ' return 0;' - - print '' - print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d ) - print ' image_height, row_length, skip_images,' - print ' skip_rows, alignment);' - print '}' - print '' - return - - - def printCountedFunction(self, f): - - sig = "" - offset = 0 - fixup = [] - params = [] - plus = '' - size = '' - param_offsets = {} - - # Calculate the offset of each counter parameter and the - # size string for the variable length parameter(s). While - # that is being done, calculate a unique signature for this - # function. - - for p in f.parameterIterateGlxSend(): - if p.is_counter: - fixup.append( p.name ) - params.append( p ) - elif p.counter: - s = p.size() - if s == 0: s = 1 - - sig += "(%u,%u)" % (f.offset_of(p.counter), s) - size += '%s%s' % (plus, p.size_string()) - plus = ' + ' - - - # If the calculated signature matches a function that has - # already be emitted, don't emit this function. Instead, add - # it to the list of function aliases. - - if self.counter_sigs.has_key(sig): - n = self.counter_sigs[sig]; - alias = [f.name, n] - else: - alias = None - self.counter_sigs[sig] = f.name - - self.common_func_print_just_header(f) - - for p in params: - self.common_emit_one_arg(p, "pc", 0) - - - print '' - self.common_emit_fixups(fixup) - print '' - - print ' return __GLX_PAD(%s);' % (size) - print '}' - print '' - - return alias - - -def show_usage(): - print "Usage: %s [-f input_file_name] -m output_mode [--only-get | --only-set] [--get-alias-set]" % sys.argv[0] - print " -m output_mode Output mode can be one of 'size_c' or 'size_h'." - print " --only-get Only emit 'get'-type functions." - print " --only-set Only emit 'set'-type functions." - print "" - print "By default, both 'get' and 'set'-type functions are emitted." - sys.exit(1) - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "header-tag"]) - except Exception,e: - show_usage() - - mode = None - header_tag = None - which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set - - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "--only-get": - which_functions = PrintGlxSizeStubs_common.do_get - elif arg == "--only-set": - which_functions = PrintGlxSizeStubs_common.do_set - elif (arg == '-h') or (arg == "--header-tag"): - header_tag = val - - if mode == "size_c": - printer = PrintGlxSizeStubs_c( which_functions ) - elif mode == "size_h": - printer = PrintGlxSizeStubs_h( which_functions ) - if header_tag: - printer.header_tag = header_tag - elif mode == "reqsize_c": - printer = PrintGlxReqSize_c() - elif mode == "reqsize_h": - printer = PrintGlxReqSize_h() - else: - show_usage() - - api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) - - - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/glX_server_table.py b/mesalib/src/mesa/glapi/glX_server_table.py deleted file mode 100644 index f3962f875..000000000 --- a/mesalib/src/mesa/glapi/glX_server_table.py +++ /dev/null @@ -1,411 +0,0 @@ -#!/bin/env python - -# (C) Copyright IBM Corporation 2005, 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 -# 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 - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt - - -def log2(value): - for i in range(0, 30): - p = 1 << i - if p >= value: - return i - - return -1 - - -def round_down_to_power_of_two(n): - """Returns the nearest power-of-two less than or equal to n.""" - - for i in range(30, 0, -1): - p = 1 << i - if p <= n: - return p - - return -1 - - -class function_table: - def __init__(self, name, do_size_check): - self.name_base = name - self.do_size_check = do_size_check - - - self.max_bits = 1 - self.next_opcode_threshold = (1 << self.max_bits) - self.max_opcode = 0 - - self.functions = {} - self.lookup_table = [] - - # Minimum number of opcodes in a leaf node. - self.min_op_bits = 3 - self.min_op_count = (1 << self.min_op_bits) - return - - - def append(self, opcode, func): - self.functions[opcode] = func - - if opcode > self.max_opcode: - self.max_opcode = opcode - - if opcode > self.next_opcode_threshold: - bits = log2(opcode) - if (1 << bits) <= opcode: - bits += 1 - - self.max_bits = bits - self.next_opcode_threshold = 1 << bits - return - - - def divide_group(self, min_opcode, total): - """Divide the group starting min_opcode into subgroups. - Returns a tuple containing the number of bits consumed by - the node, the list of the children's tuple, and the number - of entries in the final array used by this node and its - children, and the depth of the subtree rooted at the node.""" - - remaining_bits = self.max_bits - total - next_opcode = min_opcode + (1 << remaining_bits) - empty_children = 0 - - for M in range(0, remaining_bits): - op_count = 1 << (remaining_bits - M); - child_count = 1 << M; - - empty_children = 0 - full_children = 0 - for i in range(min_opcode, next_opcode, op_count): - used = 0 - empty = 0 - - for j in range(i, i + op_count): - if self.functions.has_key(j): - used += 1; - else: - empty += 1; - - - if empty == op_count: - empty_children += 1 - - if used == op_count: - full_children += 1 - - if (empty_children > 0) or (full_children == child_count) or (op_count <= self.min_op_count): - break - - - # If all the remaining bits are used by this node, as is the - # case when M is 0 or remaining_bits, the node is a leaf. - - if (M == 0) or (M == remaining_bits): - return [remaining_bits, [], 0, 0] - else: - children = [] - count = 1 - depth = 1 - all_children_are_nonempty_leaf_nodes = 1 - for i in range(min_opcode, next_opcode, op_count): - n = self.divide_group(i, total + M) - - if not (n[1] == [] and not self.is_empty_leaf(i, n[0])): - all_children_are_nonempty_leaf_nodes = 0 - - children.append(n) - count += n[2] + 1 - - if n[3] >= depth: - depth = n[3] + 1 - - # If all of the child nodes are non-empty leaf nodes, pull - # them up and make this node a leaf. - - if all_children_are_nonempty_leaf_nodes: - return [remaining_bits, [], 0, 0] - else: - return [M, children, count, depth] - - - def is_empty_leaf(self, base_opcode, M): - for op in range(base_opcode, base_opcode + (1 << M)): - if self.functions.has_key(op): - return 0 - break - - return 1 - - - def dump_tree(self, node, base_opcode, remaining_bits, base_entry, depth): - M = node[0] - children = node[1] - child_M = remaining_bits - M - - - # This actually an error condition. - if children == []: - return - - print ' /* [%u] -> opcode range [%u, %u], node depth %u */' % (base_entry, base_opcode, base_opcode + (1 << remaining_bits), depth) - print ' %u,' % (M) - - base_entry += (1 << M) + 1 - - child_index = base_entry - child_base_opcode = base_opcode - for child in children: - if child[1] == []: - if self.is_empty_leaf(child_base_opcode, child_M): - print ' EMPTY_LEAF,' - else: - # Emit the index of the next dispatch - # function. Then add all the - # dispatch functions for this leaf - # node to the dispatch function - # lookup table. - - print ' LEAF(%u),' % (len(self.lookup_table)) - - for op in range(child_base_opcode, child_base_opcode + (1 << child_M)): - if self.functions.has_key(op): - func = self.functions[op] - size = func.command_fixed_length() - - if func.glx_rop != 0: - size += 4 - - size = ((size + 3) & ~3) - - if func.has_variable_size_request(): - size_name = "__glX%sReqSize" % (func.name) - else: - size_name = "" - - if func.glx_vendorpriv == op: - func_name = func.glx_vendorpriv_names[0] - else: - func_name = func.name - - temp = [op, "__glXDisp_%s" % (func_name), "__glXDispSwap_%s" % (func_name), size, size_name] - else: - temp = [op, "NULL", "NULL", 0, ""] - - self.lookup_table.append(temp) - else: - print ' %u,' % (child_index) - child_index += child[2] - - child_base_opcode += 1 << child_M - - print '' - - child_index = base_entry - for child in children: - if child[1] != []: - self.dump_tree(child, base_opcode, remaining_bits - M, child_index, depth + 1) - child_index += child[2] - - base_opcode += 1 << (remaining_bits - M) - - - def Print(self): - # Each dispatch table consists of two data structures. - # - # The first structure is an N-way tree where the opcode for - # the function is the key. Each node switches on a range of - # bits from the opcode. M bits are extracted from the opcde - # and are used as an index to select one of the N, where - # N = 2^M, children. - # - # The tree is stored as a flat array. The first value is the - # number of bits, M, used by the node. For inner nodes, the - # following 2^M values are indexes into the array for the - # child nodes. For leaf nodes, the followign 2^M values are - # indexes into the second data structure. - # - # If an inner node's child index is 0, the child is an empty - # leaf node. That is, none of the opcodes selectable from - # that child exist. Since most of the possible opcode space - # is unused, this allows compact data storage. - # - # The second data structure is an array of pairs of function - # pointers. Each function contains a pointer to a protocol - # decode function and a pointer to a byte-swapped protocol - # decode function. Elements in this array are selected by the - # leaf nodes of the first data structure. - # - # As the tree is traversed, an accumulator is kept. This - # accumulator counts the bits of the opcode consumed by the - # traversal. When accumulator + M = B, where B is the - # maximum number of bits in an opcode, the traversal has - # reached a leaf node. The traversal starts with the most - # significant bits and works down to the least significant - # bits. - # - # Creation of the tree is the most complicated part. At - # each node the elements are divided into groups of 2^M - # elements. The value of M selected is the smallest possible - # value where all of the groups are either empty or full, or - # the groups are a preset minimum size. If all the children - # of a node are non-empty leaf nodes, the children are merged - # to create a single leaf node that replaces the parent. - - tree = self.divide_group(0, 0) - - print '/*****************************************************************/' - print '/* tree depth = %u */' % (tree[3]) - print 'static const int_fast16_t %s_dispatch_tree[%u] = {' % (self.name_base, tree[2]) - self.dump_tree(tree, 0, self.max_bits, 0, 1) - print '};\n' - - # After dumping the tree, dump the function lookup table. - - print 'static const void *%s_function_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) - index = 0 - for func in self.lookup_table: - opcode = func[0] - name = func[1] - name_swap = func[2] - - print ' /* [% 3u] = %5u */ {%s, %s},' % (index, opcode, name, name_swap) - - index += 1 - - print '};\n' - - if self.do_size_check: - var_table = [] - - print 'static const int_fast16_t %s_size_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) - index = 0 - var_table = [] - for func in self.lookup_table: - opcode = func[0] - fixed = func[3] - var = func[4] - - if var != "": - var_offset = "%2u" % (len(var_table)) - var_table.append(var) - else: - var_offset = "~0" - - print ' /* [%3u] = %5u */ {%3u, %s},' % (index, opcode, fixed, var_offset) - index += 1 - - - print '};\n' - - - print 'static const gl_proto_size_func %s_size_func_table[%u] = {' % (self.name_base, len(var_table)) - for func in var_table: - print ' %s,' % (func) - - print '};\n' - - - print 'const struct __glXDispatchInfo %s_dispatch_info = {' % (self.name_base) - print ' %u,' % (self.max_bits) - print ' %s_dispatch_tree,' % (self.name_base) - print ' %s_function_table,' % (self.name_base) - if self.do_size_check: - print ' %s_size_table,' % (self.name_base) - print ' %s_size_func_table' % (self.name_base) - else: - print ' NULL,' - print ' NULL' - print '};\n' - return - - -class PrintGlxDispatchTables(glX_proto_common.glx_print_proto): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - self.name = "glX_server_table.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005, 2006", "IBM") - - self.rop_functions = function_table("Render", 1) - self.sop_functions = function_table("Single", 0) - self.vop_functions = function_table("VendorPriv", 0) - return - - - def printRealHeader(self): - print '#include ' - print '#include "glxserver.h"' - print '#include "glxext.h"' - print '#include "indirect_dispatch.h"' - print '#include "indirect_reqsize.h"' - print '#include "g_disptab.h"' - print '#include "indirect_table.h"' - print '' - return - - - def printBody(self, api): - for f in api.functionIterateAll(): - if not f.ignore and f.vectorequiv == None: - if f.glx_rop != 0: - self.rop_functions.append(f.glx_rop, f) - if f.glx_sop != 0: - self.sop_functions.append(f.glx_sop, f) - if f.glx_vendorpriv != 0: - self.vop_functions.append(f.glx_vendorpriv, f) - - self.sop_functions.Print() - self.rop_functions.Print() - self.vop_functions.Print() - return - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m") - except Exception,e: - show_usage() - - mode = "table_c" - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - - if mode == "table_c": - printer = PrintGlxDispatchTables() - else: - show_usage() - - - api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) - - - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/gl_API.dtd b/mesalib/src/mesa/glapi/gl_API.dtd deleted file mode 100644 index 30c646c92..000000000 --- a/mesalib/src/mesa/glapi/gl_API.dtd +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/gl_API.xml b/mesalib/src/mesa/glapi/gl_API.xml deleted file mode 100644 index 1dfd92be0..000000000 --- a/mesalib/src/mesa/glapi/gl_API.xml +++ /dev/null @@ -1,12514 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/glapi/gl_SPARC_asm.py b/mesalib/src/mesa/glapi/gl_SPARC_asm.py deleted file mode 100644 index 33e752df3..000000000 --- a/mesalib/src/mesa/glapi/gl_SPARC_asm.py +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/bin/env python - -# (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 -# 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 - -import license -import gl_XML, glX_XML -import sys, getopt - -class PrintGenericStubs(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - self.name = "gl_SPARC_asm.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - - - def printRealHeader(self): - print '#include "glapi/glapioffsets.h"' - print '' - print '#ifdef __arch64__' - print '#define GL_OFF(N)\t((N) * 8)' - print '#define GL_LL\t\tldx' - print '#define GL_TIE_LD(SYM)\t%tie_ldx(SYM)' - print '#define GL_STACK_SIZE\t128' - print '#else' - print '#define GL_OFF(N)\t((N) * 4)' - print '#define GL_LL\t\tld' - print '#define GL_TIE_LD(SYM)\t%tie_ld(SYM)' - print '#define GL_STACK_SIZE\t64' - print '#endif' - print '' - print '#define GLOBL_FN(x) .globl x ; .type x, @function' - print '#define HIDDEN(x) .hidden x' - print '' - print '\t.register %g2, #scratch' - print '\t.register %g3, #scratch' - print '' - print '\t.text' - print '' - print '\tGLOBL_FN(__glapi_sparc_icache_flush)' - print '\tHIDDEN(__glapi_sparc_icache_flush)' - print '\t.type\t__glapi_sparc_icache_flush, @function' - print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */' - print '\tflush\t%o0' - print '\tretl' - print '\t nop' - print '' - print '\t.align\t32' - print '' - print '\t.type\t__glapi_sparc_get_pc, @function' - print '__glapi_sparc_get_pc:' - print '\tretl' - print '\t add\t%o7, %g2, %g2' - print '\t.size\t__glapi_sparc_get_pc, .-__glapi_sparc_get_pc' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '\tGLOBL_FN(__glapi_sparc_get_dispatch)' - print '\tHIDDEN(__glapi_sparc_get_dispatch)' - print '__glapi_sparc_get_dispatch:' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1' - print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1' - print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)' - print '\tretl' - print '\t mov\t%g2, %o0' - print '' - print '\t.data' - print '\t.align\t32' - print '' - print '\t/* --> sethi %hi(_glapi_tls_Dispatch), %g1 */' - print '\t/* --> or %g1, %lo(_glapi_tls_Dispatch), %g1 */' - print '\tGLOBL_FN(__glapi_sparc_tls_stub)' - print '\tHIDDEN(__glapi_sparc_tls_stub)' - print '__glapi_sparc_tls_stub: /* Call offset in %g3 */' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsrl\t%g3, 10, %g3' - print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1' - print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1' - print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)' - print '\tGL_LL\t[%g7+%g2], %g1' - print '\tGL_LL\t[%g1 + %g3], %g1' - print '\tjmp\t%g1' - print '\t nop' - print '\t.size\t__glapi_sparc_tls_stub, .-__glapi_sparc_tls_stub' - print '' - print '#define GL_STUB(fn, off)\t\t\t\t\\' - print '\tGLOBL_FN(fn);\t\t\t\t\t\\' - print 'fn:\tba\t__glapi_sparc_tls_stub;\t\t\t\\' - print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\' - print '\t.size\tfn,.-fn;' - print '' - print '#elif defined(PTHREADS)' - print '' - print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */' - print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */' - print '\t/* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */' - print '\t/* 64-bit 0x0c --> sllx %g1, 32, %g1 */' - print '\t/* 64-bit 0x10 --> add %g1, %g2, %g1 */' - print '\t/* 64-bit 0x14 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */' - print '' - print '\t/* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */' - print '\t/* 32-bit 0x04 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */' - print '' - print '\t.data' - print '\t.align\t32' - print '' - print '\tGLOBL_FN(__glapi_sparc_pthread_stub)' - print '\tHIDDEN(__glapi_sparc_pthread_stub)' - print '__glapi_sparc_pthread_stub: /* Call offset in %g3 */' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsethi\t%hi(_glapi_Dispatch), %g1' - print '\tor\t%g1, %lo(_glapi_Dispatch), %g1' - print '\tsrl\t%g3, 10, %g3' - print '\tGL_LL\t[%g2+%g1], %g2' - print '\tGL_LL\t[%g2], %g1' - print '\tcmp\t%g1, 0' - print '\tbe\t2f' - print '\t nop' - print '1:\tGL_LL\t[%g1 + %g3], %g1' - print '\tjmp\t%g1' - print '\t nop' - print '2:\tsave\t%sp, GL_STACK_SIZE, %sp' - print '\tmov\t%g3, %l0' - print '\tcall\t_glapi_get_dispatch' - print '\t nop' - print '\tmov\t%o0, %g1' - print '\tmov\t%l0, %g3' - print '\tba\t1b' - print '\t restore %g0, %g0, %g0' - print '\t.size\t__glapi_sparc_pthread_stub, .-__glapi_sparc_pthread_stub' - print '' - print '#define GL_STUB(fn, off)\t\t\t\\' - print '\tGLOBL_FN(fn);\t\t\t\t\\' - print 'fn:\tba\t__glapi_sparc_pthread_stub;\t\\' - print '\t sethi\tGL_OFF(off), %g3;\t\t\\' - print '\t.size\tfn,.-fn;' - print '' - print '#else /* Non-threaded version. */' - print '' - print '\t.type __glapi_sparc_nothread_stub, @function' - print '__glapi_sparc_nothread_stub: /* Call offset in %g3 */' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsrl\t%g3, 10, %g3' - print '\tsethi\t%hi(_glapi_Dispatch), %g1' - print '\tor\t%g1, %lo(_glapi_Dispatch), %g1' - print '\tGL_LL\t[%g2+%g1], %g2' - print '\tGL_LL\t[%g2], %g1' - print '\tGL_LL\t[%g1 + %g3], %g1' - print '\tjmp\t%g1' - print '\t nop' - print '\t.size\t__glapi_sparc_nothread_stub, .-__glapi_sparc_nothread_stub' - print '' - print '#define GL_STUB(fn, off)\t\t\t\\' - print '\tGLOBL_FN(fn);\t\t\t\t\\' - print 'fn:\tba\t__glapi_sparc_nothread_stub;\t\\' - print '\t sethi\tGL_OFF(off), %g3;\t\t\\' - print '\t.size\tfn,.-fn;' - print '' - print '#endif' - print '' - print '#define GL_STUB_ALIAS(fn, alias) \\' - print ' .globl fn; \\' - print ' .set fn, alias' - print '' - print '\t.text' - print '\t.align\t32' - print '' - print '\t.globl\tgl_dispatch_functions_start' - print '\tHIDDEN(gl_dispatch_functions_start)' - print 'gl_dispatch_functions_start:' - print '' - return - - def printRealFooter(self): - print '' - print '\t.globl\tgl_dispatch_functions_end' - print '\tHIDDEN(gl_dispatch_functions_end)' - print 'gl_dispatch_functions_end:' - return - - def printBody(self, api): - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - - print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, f.name) - - if not f.is_static_entry_point(f.name): - print '\tHIDDEN(gl%s)' % (name) - - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - - if f.is_static_entry_point(f.name): - for n in f.entry_points: - if n != f.name: - text = '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - mode = "generic" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == '-m': - mode = val - elif arg == "-f": - file_name = val - - if mode == "generic": - printer = PrintGenericStubs() - else: - print "ERROR: Invalid mode \"%s\" specified." % mode - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer.Print(api) diff --git a/mesalib/src/mesa/glapi/gl_XML.py b/mesalib/src/mesa/glapi/gl_XML.py deleted file mode 100644 index b98919134..000000000 --- a/mesalib/src/mesa/glapi/gl_XML.py +++ /dev/null @@ -1,964 +0,0 @@ -#!/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 - -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 __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# 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 (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && 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__) -# 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_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 ["", 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/mesa/glapi/gl_and_glX_API.xml b/mesalib/src/mesa/glapi/gl_and_glX_API.xml deleted file mode 100644 index 34c977e9c..000000000 --- a/mesalib/src/mesa/glapi/gl_and_glX_API.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/mesalib/src/mesa/glapi/gl_apitemp.py b/mesalib/src/mesa/glapi/gl_apitemp.py deleted file mode 100644 index a37c08d6c..000000000 --- a/mesalib/src/mesa/glapi/gl_apitemp.py +++ /dev/null @@ -1,253 +0,0 @@ -#!/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 - -import gl_XML, glX_XML -import license -import sys, getopt - -class PrintGlOffsets(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_apitemp.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - - self.undef_list.append( "KEYWORD1" ) - self.undef_list.append( "KEYWORD1_ALT" ) - self.undef_list.append( "KEYWORD2" ) - self.undef_list.append( "NAME" ) - self.undef_list.append( "DISPATCH" ) - self.undef_list.append( "RETURN_DISPATCH" ) - self.undef_list.append( "DISPATCH_TABLE_NAME" ) - self.undef_list.append( "UNUSED_TABLE_NAME" ) - self.undef_list.append( "TABLE_ENTRY" ) - - - def printFunction(self, f, name): - p_string = "" - o_string = "" - t_string = "" - comma = "" - - if f.is_static_entry_point(name): - keyword = "KEYWORD1" - else: - keyword = "KEYWORD1_ALT" - - n = f.static_name(name) - - for p in f.parameterIterator(): - if p.is_padding: - continue - - if p.is_pointer(): - cast = "(const void *) " - else: - cast = "" - - t_string = t_string + comma + p.format_string() - p_string = p_string + comma + p.name - o_string = o_string + comma + cast + p.name - comma = ", " - - - if f.return_type != 'void': - dispatch = "RETURN_DISPATCH" - else: - dispatch = "DISPATCH" - - if f.has_different_protocol(name): - print '#ifndef GLX_INDIRECT_RENDERING' - - if not f.is_static_entry_point(name): - print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name)) - print '' - - print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name)) - print '{' - if p_string == "": - print ' %s(%s, (), (F, "gl%s();\\n"));' \ - % (dispatch, f.name, name) - else: - print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \ - % (dispatch, f.name, p_string, name, t_string, o_string) - print '}' - if f.has_different_protocol(name): - print '#endif /* GLX_INDIRECT_RENDERING */' - print '' - return - - def printRealHeader(self): - print '' - self.printVisibility( "HIDDEN", "hidden" ) - print """ -/* - * 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 - -""" - return - - - - def printInitDispatch(self, api): - print """ -#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 - -static _glapi_proc DISPATCH_TABLE_NAME[] = {""" - for f in api.functionIterateByOffset(): - print ' TABLE_ENTRY(%s),' % (f.dispatch_name()) - - print ' /* A whole bunch of no-op functions. These might be called' - print ' * when someone tries to call a dynamically-registered' - print ' * extension function without a current rendering context.' - print ' */' - for i in range(1, 100): - print ' TABLE_ENTRY(Unused),' - - print '};' - print '#endif /* DISPATCH_TABLE_NAME */' - print '' - return - - - def printAliasedTable(self, api): - print """ -/* - * This is just used to silence compiler warnings. - * We list the functions which are not otherwise used. - */ -#ifdef UNUSED_TABLE_NAME -static _glapi_proc UNUSED_TABLE_NAME[] = {""" - - for f in api.functionIterateByOffset(): - for n in f.entry_points: - if n != f.name: - if f.is_static_entry_point(n): - text = ' TABLE_ENTRY(%s),' % (n) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - print '};' - print '#endif /*UNUSED_TABLE_NAME*/' - print '' - return - - - def printBody(self, api): - for func in api.functionIterateByOffset(): - got_stub = 0 - for n in func.entry_points: - if func.is_static_entry_point(n): - self.printFunction(func, n) - elif not got_stub: - self.printFunction(func, n) - got_stub = 1 - - self.printInitDispatch(api) - self.printAliasedTable(api) - return - - -def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - - printer = PrintGlOffsets() - printer.Print(api) diff --git a/mesalib/src/mesa/glapi/gl_enums.py b/mesalib/src/mesa/glapi/gl_enums.py deleted file mode 100644 index 27ab11953..000000000 --- a/mesalib/src/mesa/glapi/gl_enums.py +++ /dev/null @@ -1,243 +0,0 @@ -#!/usr/bin/python2 -# -*- Mode: Python; py-indent-offset: 8 -*- - -# (C) Copyright Zack Rusin 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: -# Zack Rusin - -import license -import gl_XML -import sys, getopt - -class PrintGlEnums(gl_XML.gl_print_base): - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_enums.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL") - self.enum_table = {} - - - def printRealHeader(self): - print '#include "glheader.h"' - print '#include "mfeatures.h"' - print '#include "enums.h"' - print '#include "imports.h"' - print '' - print 'typedef struct {' - print ' size_t offset;' - print ' int n;' - print '} enum_elt;' - print '' - return - - def print_code(self): - print """ -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 _mesa_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_sprintf(token_tmp, "0x%x", nr); - return token_tmp; - } -} - -/* 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( int nr ) -{ - switch (nr) { - case GL_POINTS: return "GL_POINTS"; - case GL_LINES: return "GL_LINES"; - case GL_LINE_STRIP: return "GL_LINE_STRIP"; - case GL_LINE_LOOP: return "GL_LINE_LOOP"; - case GL_TRIANGLES: return "GL_TRIANGLES"; - case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP"; - case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN"; - case GL_QUADS: return "GL_QUADS"; - case GL_QUAD_STRIP: return "GL_QUAD_STRIP"; - case GL_POLYGON: return "GL_POLYGON"; - case GL_POLYGON+1: return "OUTSIDE_BEGIN_END"; - default: return ""; - } -} - - - -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; -} - -""" - return - - - def printBody(self, api): - self.process_enums( api ) - - keys = self.enum_table.keys() - keys.sort() - - name_table = [] - enum_table = {} - - for enum in keys: - low_pri = 9 - for [name, pri] in self.enum_table[ enum ]: - name_table.append( [name, enum] ) - - if pri < low_pri: - low_pri = pri - enum_table[enum] = name - - - name_table.sort() - - string_offsets = {} - i = 0; - print 'LONGSTRING static const char enum_string_table[] = ' - for [name, enum] in name_table: - print ' "%s\\0"' % (name) - string_offsets[ name ] = i - i += len(name) + 1 - - print ' ;' - print '' - - - print 'static const enum_elt all_enums[%u] =' % (len(name_table)) - print '{' - for [name, enum] in name_table: - print ' { %5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name) - print '};' - print '' - - print 'static const unsigned reduced_enums[%u] =' % (len(keys)) - print '{' - for enum in keys: - name = enum_table[ enum ] - if [name, enum] not in name_table: - print ' /* Error! %s, 0x%04x */ 0,' % (name, enum) - else: - i = name_table.index( [name, enum] ) - - print ' %4u, /* %s */' % (i, name) - print '};' - - - self.print_code() - return - - - def process_enums(self, api): - self.enum_table = {} - - for obj in api.enumIterateByName(): - if obj.value not in self.enum_table: - self.enum_table[ obj.value ] = [] - - - name = "GL_" + obj.name - priority = obj.priority() - self.enum_table[ obj.value ].append( [name, priority] ) - - -def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name ) - - printer = PrintGlEnums() - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/gl_offsets.py b/mesalib/src/mesa/glapi/gl_offsets.py deleted file mode 100644 index 59f8d372b..000000000 --- a/mesalib/src/mesa/glapi/gl_offsets.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/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 - -import gl_XML -import license -import sys, getopt - -class PrintGlOffsets(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_offsets.py (from Mesa)" - self.header_tag = '_GLAPI_OFFSETS_H_' - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - return - - def printBody(self, api): - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - - functions = [] - abi_functions = [] - count = 0 - for f in api.functionIterateByOffset(): - [category, num] = api.get_category_for_name( f.name ) - if category not in abi: - functions.append( [f, count] ) - count += 1 - else: - abi_functions.append( f ) - - - for f in abi_functions: - print '#define _gloffset_%s %d' % (f.name, f.offset) - last_static = f.offset - - print '' - print '#if !defined(IN_DRI_DRIVER)' - print '' - - for [f, index] in functions: - print '#define _gloffset_%s %d' % (f.name, f.offset) - - print '#define _gloffset_FIRST_DYNAMIC %d' % (api.next_offset) - - print '' - print '#else' - print '' - - for [f, index] in functions: - print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) - - print '' - print '#endif /* !defined(IN_DRI_DRIVER) */' - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name ) - - printer = PrintGlOffsets() - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/gl_procs.py b/mesalib/src/mesa/glapi/gl_procs.py deleted file mode 100644 index cd1a68cee..000000000 --- a/mesalib/src/mesa/glapi/gl_procs.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/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 - -import license -import gl_XML, glX_XML -import sys, getopt - -class PrintGlProcs(gl_XML.gl_print_base): - def __init__(self, long_strings): - gl_XML.gl_print_base.__init__(self) - - self.long_strings = long_strings - self.name = "gl_procs.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM") - - - def printRealHeader(self): - print """ -/* 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 - -""" - return - - def printRealFooter(self): - print '' - print '#undef NAME_FUNC_OFFSET' - return - - def printFunctionString(self, name): - if self.long_strings: - print ' "gl%s\\0"' % (name) - else: - print " 'g','l',", - for c in name: - print "'%s'," % (c), - - print "'\\0'," - - - def printBody(self, api): - print '' - if self.long_strings: - print 'static const char gl_string_table[] =' - else: - print 'static const char gl_string_table[] = {' - - base_offset = 0 - table = [] - for func in api.functionIterateByOffset(): - name = func.dispatch_name() - self.printFunctionString(func.name) - table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) - - # The length of the function's name, plus 2 for "gl", - # plus 1 for the NUL. - - base_offset += len(func.name) + 3 - - - for func in api.functionIterateByOffset(): - for n in func.entry_points: - if n != func.name: - name = func.dispatch_name() - self.printFunctionString( n ) - - if func.has_different_protocol(n): - alt_name = "gl" + func.static_glx_name(n) - table.append((base_offset, "gl" + name, alt_name, alt_name, func.name)) - else: - table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) - - base_offset += len(n) + 3 - - - if self.long_strings: - print ' ;' - else: - print '};' - - print '' - print '' - print "#ifdef USE_MGL_NAMESPACE" - for func in api.functionIterateByOffset(): - for n in func.entry_points: - if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): - print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset) - break - print "#endif /* USE_MGL_NAMESPACE */" - print '' - print '' - print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)' - for func in api.functionIterateByOffset(): - for n in func.entry_points: - if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): - print '%s GLAPIENTRY gl_dispatch_stub_%u(%s);' % (func.return_type, func.offset, func.get_parameter_string()) - break - - print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */' - - print '' - print 'static const glprocs_table_t static_functions[] = {' - - for info in table: - print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info - - print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)' - print '};' - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] - print "mode can be one of:" - print " long - Create code for compilers that can handle very" - print " long string constants. (default)" - print " short - Create code for compilers that can only handle" - print " ANSI C89 string constants." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") - except Exception,e: - show_usage() - - long_string = 1 - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - if val == "short": - long_string = 0 - elif val == "long": - long_string = 1 - else: - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer = PrintGlProcs(long_string) - printer.Print(api) diff --git a/mesalib/src/mesa/glapi/gl_table.py b/mesalib/src/mesa/glapi/gl_table.py deleted file mode 100644 index 55a33748a..000000000 --- a/mesalib/src/mesa/glapi/gl_table.py +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/python2 - -# (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 -# 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 - -import gl_XML -import license -import sys, getopt - -class PrintGlTable(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.header_tag = '_GLAPI_TABLE_H_' - self.name = "gl_table.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - return - - - def printBody(self, api): - for f in api.functionIterateByOffset(): - arg_string = f.get_parameter_string() - print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset) - - - def printRealHeader(self): - print '#ifndef GLAPIENTRYP' - print '# ifndef GLAPIENTRY' - print '# define GLAPIENTRY' - print '# endif' - print '' - print '# define GLAPIENTRYP GLAPIENTRY *' - print '#endif' - print '' - print '' - print 'struct _glapi_table' - print '{' - return - - - def printRealFooter(self): - print '};' - return - - -class PrintRemapTable(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.header_tag = '_DISPATCH_H_' - self.name = "gl_table.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def printRealHeader(self): - print """ -#include "glapitable.h" -/** - * \\file dispatch.h - * Macros for handling GL dispatch tables. - * - * For each known GL function, there are 3 macros in this file. The first - * macro is named CALL_FuncName and is used to call that GL function using - * the specified dispatch table. The other 2 macros, called GET_FuncName - * can SET_FuncName, are used to get and set the dispatch pointer for the - * named function in the specified dispatch table. - */ -""" - - return - - def printBody(self, api): - print '#define CALL_by_offset(disp, cast, offset, parameters) \\' - print ' (*(cast (GET_by_offset(disp, offset)))) parameters' - print '#define GET_by_offset(disp, offset) \\' - print ' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL' - print '#define SET_by_offset(disp, offset, fn) \\' - print ' do { \\' - print ' if ( (offset) < 0 ) { \\' - print ' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\' - print ' /* __func__, __LINE__, disp, offset, # fn); */ \\' - print ' /* abort(); */ \\' - print ' } \\' - print ' else { \\' - print ' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\' - print ' } \\' - print ' } while(0)' - print '' - - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - - functions = [] - abi_functions = [] - count = 0 - for f in api.functionIterateByOffset(): - [category, num] = api.get_category_for_name( f.name ) - if category not in abi: - functions.append( [f, count] ) - count += 1 - else: - abi_functions.append( f ) - - - for f in abi_functions: - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - - - print '' - print '#if !defined(IN_DRI_DRIVER)' - print '' - - for [f, index] in functions: - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - - print '' - print '#else' - print '' - print '#define driDispatchRemapTable_size %u' % (count) - print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];' - print '' - - for [f, index] in functions: - print '#define %s_remap_index %u' % (f.name, index) - - print '' - - for [f, index] in functions: - arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) - cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) - - print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name) - print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name) - print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name) - - - print '' - print '#endif /* !defined(IN_DRI_DRIVER) */' - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] - print " -m mode Mode can be 'table' or 'remap_table'." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") - except Exception,e: - show_usage() - - mode = "table" - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - - if mode == "table": - printer = PrintGlTable() - elif mode == "remap_table": - printer = PrintRemapTable() - else: - show_usage() - - api = gl_XML.parse_GL_API( file_name ) - - printer.Print( api ) diff --git a/mesalib/src/mesa/glapi/gl_x86-64_asm.py b/mesalib/src/mesa/glapi/gl_x86-64_asm.py deleted file mode 100644 index f36ad3a5d..000000000 --- a/mesalib/src/mesa/glapi/gl_x86-64_asm.py +++ /dev/null @@ -1,334 +0,0 @@ -#!/usr/bin/env python - -# (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 -# 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 - -import license -import gl_XML, glX_XML -import sys, getopt, copy - -def should_use_push(registers): - for [reg, offset] in registers: - if reg[1:4] == "xmm": - return 0 - - N = len(registers) - return (N & 1) != 0 - - -def local_size(registers): - # The x86-64 ABI says "the value (%rsp - 8) is always a multiple of - # 16 when control is transfered to the function entry point." This - # means that the local stack usage must be (16*N)+8 for some value - # of N. (16*N)+8 = (8*(2N))+8 = 8*(2N+1). As long as N is odd, we - # meet this requirement. - - N = (len(registers) | 1) - return 8*N - - -def save_all_regs(registers): - adjust_stack = 0 - if not should_use_push(registers): - adjust_stack = local_size(registers) - print '\tsubq\t$%u, %%rsp' % (adjust_stack) - - for [reg, stack_offset] in registers: - save_reg( reg, stack_offset, adjust_stack ) - return - - -def restore_all_regs(registers): - adjust_stack = 0 - if not should_use_push(registers): - adjust_stack = local_size(registers) - - temp = copy.deepcopy(registers) - while len(temp): - [reg, stack_offset] = temp.pop() - restore_reg(reg, stack_offset, adjust_stack) - - if adjust_stack: - print '\taddq\t$%u, %%rsp' % (adjust_stack) - return - - -def save_reg(reg, offset, use_move): - if use_move: - if offset == 0: - print '\tmovq\t%s, (%%rsp)' % (reg) - else: - print '\tmovq\t%s, %u(%%rsp)' % (reg, offset) - else: - print '\tpushq\t%s' % (reg) - - return - - -def restore_reg(reg, offset, use_move): - if use_move: - if offset == 0: - print '\tmovq\t(%%rsp), %s' % (reg) - else: - print '\tmovq\t%u(%%rsp), %s' % (offset, reg) - else: - print '\tpopq\t%s' % (reg) - - return - - -class PrintGenericStubs(gl_XML.gl_print_base): - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_x86-64_asm.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def get_stack_size(self, f): - size = 0 - for p in f.parameterIterator(): - size += p.get_stack_size() - - return size - - - def printRealHeader(self): - print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change" - print " * the symbol visibility mode to 'default'." - print ' */' - print '' - print '#include "../x86/assyntax.h"' - print '' - print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303' - print '# pragma GCC visibility push(default)' - print '# define HIDDEN(x) .hidden x' - print '#else' - print '# define HIDDEN(x)' - print '#endif' - print '' - print '# if defined(USE_MGL_NAMESPACE)' - print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))' - print '# define _glapi_Dispatch _mglapi_Dispatch' - print '# else' - print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' - print '# endif' - print '' - print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' - print '# define THREADS' - print '#endif' - print '' - print '\t.text' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '\t.globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)' - print '_x86_64_get_get_dispatch:' - print '\tlea\t_x86_64_get_dispatch(%rip), %rax' - print '\tret' - print '' - print '\t.p2align\t4,,15' - print '_x86_64_get_dispatch:' - print '\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax' - print '\tmovq\t%fs:(%rax), %rax' - print '\tret' - print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch' - print '' - print '#elif defined(PTHREADS)' - print '' - print '\t.extern\t_glapi_Dispatch' - print '\t.extern\t_gl_DispatchTSD' - print '\t.extern\tpthread_getspecific' - print '' - print '\t.p2align\t4,,15' - print '_x86_64_get_dispatch:' - print '\tmovq\t_gl_DispatchTSD(%rip), %rdi' - print '\tjmp\tpthread_getspecific@PLT' - print '' - print '#elif defined(THREADS)' - print '' - print '\t.extern\t_glapi_get_dispatch' - print '' - print '#endif' - print '' - return - - - def printRealFooter(self): - print '' - print '#if defined(GLX_USE_TLS) && defined(__linux__)' - print ' .section ".note.ABI-tag", "a"' - print ' .p2align 2' - print ' .long 1f - 0f /* name length */' - print ' .long 3f - 2f /* data length */' - print ' .long 1 /* note length */' - print '0: .asciz "GNU" /* vendor name */' - print '1: .p2align 2' - print '2: .long 0 /* note data: the ABI tag */' - print ' .long 2,4,20 /* Minimum kernel version w/TLS */' - print '3: .p2align 2 /* pad out section */' - print '#endif /* GLX_USE_TLS */' - print '' - print '#if defined (__ELF__) && defined (__linux__)' - print ' .section .note.GNU-stack,"",%progbits' - print '#endif' - return - - - def printFunction(self, f): - - # The x86-64 ABI divides function parameters into a couple - # classes. For the OpenGL interface, the only ones that are - # relevent are INTEGER and SSE. Basically, the first 8 - # GLfloat or GLdouble parameters are placed in %xmm0 - %xmm7, - # the first 6 non-GLfloat / non-GLdouble parameters are placed - # in registers listed in int_parameters. - # - # If more parameters than that are required, they are passed - # on the stack. Therefore, we just have to make sure that - # %esp hasn't changed when we jump to the actual function. - # Since we're jumping to the function (and not calling it), we - # have to make sure of that anyway! - - int_parameters = ["%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"] - - int_class = 0 - sse_class = 0 - stack_offset = 0 - registers = [] - for p in f.parameterIterator(): - type_name = p.get_base_type_string() - - if p.is_pointer() or (type_name != "GLfloat" and type_name != "GLdouble"): - if int_class < 6: - registers.append( [int_parameters[int_class], stack_offset] ) - int_class += 1 - stack_offset += 8 - else: - if sse_class < 8: - registers.append( ["%%xmm%u" % (sse_class), stack_offset] ) - sse_class += 1 - stack_offset += 8 - - if ((int_class & 1) == 0) and (sse_class == 0): - registers.append( ["%rbp", 0] ) - - - name = f.dispatch_name() - - print '\t.p2align\t4,,15' - print '\t.globl\tGL_PREFIX(%s)' % (name) - print '\t.type\tGL_PREFIX(%s), @function' % (name) - if not f.is_static_entry_point(f.name): - print '\tHIDDEN(GL_PREFIX(%s))' % (name) - print 'GL_PREFIX(%s):' % (name) - print '#if defined(GLX_USE_TLS)' - print '\tcall\t_x86_64_get_dispatch@PLT' - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - print '\tjmp\t*%r11' - print '#elif defined(PTHREADS)' - - save_all_regs(registers) - print '\tcall\t_x86_64_get_dispatch@PLT' - restore_all_regs(registers) - - if f.offset == 0: - print '\tmovq\t(%rax), %r11' - else: - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - - print '\tjmp\t*%r11' - - print '#else' - print '\tmovq\t_glapi_Dispatch(%rip), %rax' - print '\ttestq\t%rax, %rax' - print '\tje\t1f' - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - print '\tjmp\t*%r11' - print '1:' - - save_all_regs(registers) - print '\tcall\t_glapi_get_dispatch' - restore_all_regs(registers) - - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - print '\tjmp\t*%r11' - print '#endif /* defined(GLX_USE_TLS) */' - - print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name) - print '' - return - - - def printBody(self, api): - for f in api.functionIterateByOffset(): - self.printFunction(f) - - - for f in api.functionIterateByOffset(): - dispatch = f.dispatch_name() - for n in f.entry_points: - if n != f.name: - if f.is_static_entry_point(n): - text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - - return - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - mode = "generic" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == '-m': - mode = val - elif arg == "-f": - file_name = val - - if mode == "generic": - printer = PrintGenericStubs() - else: - print "ERROR: Invalid mode \"%s\" specified." % mode - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer.Print(api) diff --git a/mesalib/src/mesa/glapi/gl_x86_asm.py b/mesalib/src/mesa/glapi/gl_x86_asm.py deleted file mode 100644 index 36f0e31fe..000000000 --- a/mesalib/src/mesa/glapi/gl_x86_asm.py +++ /dev/null @@ -1,270 +0,0 @@ -#!/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 - -import license -import gl_XML, glX_XML -import sys, getopt - -class PrintGenericStubs(gl_XML.gl_print_base): - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_x86_asm.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM") - return - - - def get_stack_size(self, f): - size = 0 - for p in f.parameterIterator(): - if p.is_padding: - continue - - size += p.get_stack_size() - - return size - - - def printRealHeader(self): - print '#include "assyntax.h"' - print '#include "glapi/glapioffsets.h"' - print '' - print '#if defined(STDCALL_API)' - print '# if defined(USE_MGL_NAMESPACE)' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))' - print '# else' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))' - print '# endif' - print '#else' - print '# if defined(USE_MGL_NAMESPACE)' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))' - print '# define _glapi_Dispatch _mglapi_Dispatch' - print '# else' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))' - print '# endif' - print '#endif' - print '' - print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))' - print '' - print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)' - print '#define GLOBL_FN(x) GLOBL x ; .type x, function' - print '#else' - print '#define GLOBL_FN(x) GLOBL x' - print '#endif' - print '' - print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' - print '# define THREADS' - print '#endif' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '#ifdef GLX_X86_READONLY_TEXT' - print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)' - print '#else' - print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */' - print '#endif' - print '' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tCALL(_x86_get_dispatch) ;\t\t\t\\' - print '\tCTX_INSNS ; \\' - print '\tJMP(GL_OFFSET(off))' - print '' - print '#elif defined(PTHREADS)' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' - print '\tJE(1f) ;\t\t\t\t\t\\' - print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' - print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\' - print '\tJMP(GL_OFFSET(off))' - print '#elif defined(THREADS)' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' - print '\tJE(1f) ;\t\t\t\t\t\\' - print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' - print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\' - print '\tJMP(GL_OFFSET(off))' - print '#else /* Non-threaded version. */' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tJMP(GL_OFFSET(off))' - print '#endif' - print '' - print '#ifdef HAVE_ALIAS' - print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' - print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\' - print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)' - print '#else' - print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' - print ' GL_STUB(fn, off, fn_alt)' - print '#endif' - print '' - print 'SEG_TEXT' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '\tGLOBL\tGLNAME(_x86_get_dispatch)' - print '\tHIDDEN(GLNAME(_x86_get_dispatch))' - print 'ALIGNTEXT16' - print 'GLNAME(_x86_get_dispatch):' - print '\tcall 1f' - print '1:\tpopl %eax' - print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax' - print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' - print '\tret' - print '' - print '#elif defined(PTHREADS)' - print 'EXTERN GLNAME(_glapi_Dispatch)' - print 'EXTERN GLNAME(_gl_DispatchTSD)' - print 'EXTERN GLNAME(pthread_getspecific)' - print '' - print 'ALIGNTEXT16' - print 'GLNAME(_x86_get_dispatch):' - print '\tSUB_L(CONST(24), ESP)' - print '\tPUSH_L(GLNAME(_gl_DispatchTSD))' - print '\tCALL(GLNAME(pthread_getspecific))' - print '\tADD_L(CONST(28), ESP)' - print '\tRET' - print '#elif defined(THREADS)' - print 'EXTERN GLNAME(_glapi_get_dispatch)' - print '#endif' - print '' - - print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )' - print '\t\t.section\twtext, "awx", @progbits' - print '#endif /* defined( GLX_USE_TLS ) */' - - print '' - print '\t\tALIGNTEXT16' - print '\t\tGLOBL GLNAME(gl_dispatch_functions_start)' - print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_start))' - print 'GLNAME(gl_dispatch_functions_start):' - print '' - return - - - def printRealFooter(self): - print '' - print '\t\tGLOBL\tGLNAME(gl_dispatch_functions_end)' - print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_end))' - print '\t\tALIGNTEXT16' - print 'GLNAME(gl_dispatch_functions_end):' - print '' - print '#if defined(GLX_USE_TLS) && defined(__linux__)' - print ' .section ".note.ABI-tag", "a"' - print ' .p2align 2' - print ' .long 1f - 0f /* name length */' - print ' .long 3f - 2f /* data length */' - print ' .long 1 /* note length */' - print '0: .asciz "GNU" /* vendor name */' - print '1: .p2align 2' - print '2: .long 0 /* note data: the ABI tag */' - print ' .long 2,4,20 /* Minimum kernel version w/TLS */' - print '3: .p2align 2 /* pad out section */' - print '#endif /* GLX_USE_TLS */' - print '' - print '#if defined (__ELF__) && defined (__linux__)' - print ' .section .note.GNU-stack,"",%progbits' - print '#endif' - return - - - def printBody(self, api): - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - stack = self.get_stack_size(f) - alt = "%s@%u" % (name, stack) - - print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt) - - if not f.is_static_entry_point(f.name): - print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt) - - - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - stack = self.get_stack_size(f) - alt = "%s@%u" % (name, stack) - - if f.is_static_entry_point(f.name): - for n in f.entry_points: - if n != f.name: - alt2 = "%s@%u" % (n, stack) - text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - - return - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - mode = "generic" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == '-m': - mode = val - elif arg == "-f": - file_name = val - - if mode == "generic": - printer = PrintGenericStubs() - else: - print "ERROR: Invalid mode \"%s\" specified." % mode - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer.Print(api) diff --git a/mesalib/src/mesa/glapi/glapidispatch.h b/mesalib/src/mesa/glapi/glapidispatch.h new file mode 100644 index 000000000..d6ba92824 --- /dev/null +++ b/mesalib/src/mesa/glapi/glapidispatch.h @@ -0,0 +1,4007 @@ +/* DO NOT EDIT - This file generated automatically by gl_table.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 !defined( _GLAPI_DISPATCH_H_ ) +# define _GLAPI_DISPATCH_H_ + + +/* this file should not be included directly in mesa */ + +/** + * \file glapidispatch.h + * Macros for handling GL dispatch tables. + * + * For each known GL function, there are 3 macros in this file. The first + * macro is named CALL_FuncName and is used to call that GL function using + * the specified dispatch table. The other 2 macros, called GET_FuncName + * can SET_FuncName, are used to get and set the dispatch pointer for the + * named function in the specified dispatch table. + */ + +#define CALL_by_offset(disp, cast, offset, parameters) \ + (*(cast (GET_by_offset(disp, offset)))) parameters +#define GET_by_offset(disp, offset) \ + (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL +#define SET_by_offset(disp, offset, fn) \ + do { \ + if ( (offset) < 0 ) { \ + /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\n", */ \ + /* __func__, __LINE__, disp, offset, # fn); */ \ + /* abort(); */ \ + } \ + else { \ + ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \ + } \ + } while(0) + +#define CALL_NewList(disp, parameters) (*((disp)->NewList)) parameters +#define GET_NewList(disp) ((disp)->NewList) +#define SET_NewList(disp, fn) ((disp)->NewList = fn) +#define CALL_EndList(disp, parameters) (*((disp)->EndList)) parameters +#define GET_EndList(disp) ((disp)->EndList) +#define SET_EndList(disp, fn) ((disp)->EndList = fn) +#define CALL_CallList(disp, parameters) (*((disp)->CallList)) parameters +#define GET_CallList(disp) ((disp)->CallList) +#define SET_CallList(disp, fn) ((disp)->CallList = fn) +#define CALL_CallLists(disp, parameters) (*((disp)->CallLists)) parameters +#define GET_CallLists(disp) ((disp)->CallLists) +#define SET_CallLists(disp, fn) ((disp)->CallLists = fn) +#define CALL_DeleteLists(disp, parameters) (*((disp)->DeleteLists)) parameters +#define GET_DeleteLists(disp) ((disp)->DeleteLists) +#define SET_DeleteLists(disp, fn) ((disp)->DeleteLists = fn) +#define CALL_GenLists(disp, parameters) (*((disp)->GenLists)) parameters +#define GET_GenLists(disp) ((disp)->GenLists) +#define SET_GenLists(disp, fn) ((disp)->GenLists = fn) +#define CALL_ListBase(disp, parameters) (*((disp)->ListBase)) parameters +#define GET_ListBase(disp) ((disp)->ListBase) +#define SET_ListBase(disp, fn) ((disp)->ListBase = fn) +#define CALL_Begin(disp, parameters) (*((disp)->Begin)) parameters +#define GET_Begin(disp) ((disp)->Begin) +#define SET_Begin(disp, fn) ((disp)->Begin = fn) +#define CALL_Bitmap(disp, parameters) (*((disp)->Bitmap)) parameters +#define GET_Bitmap(disp) ((disp)->Bitmap) +#define SET_Bitmap(disp, fn) ((disp)->Bitmap = fn) +#define CALL_Color3b(disp, parameters) (*((disp)->Color3b)) parameters +#define GET_Color3b(disp) ((disp)->Color3b) +#define SET_Color3b(disp, fn) ((disp)->Color3b = fn) +#define CALL_Color3bv(disp, parameters) (*((disp)->Color3bv)) parameters +#define GET_Color3bv(disp) ((disp)->Color3bv) +#define SET_Color3bv(disp, fn) ((disp)->Color3bv = fn) +#define CALL_Color3d(disp, parameters) (*((disp)->Color3d)) parameters +#define GET_Color3d(disp) ((disp)->Color3d) +#define SET_Color3d(disp, fn) ((disp)->Color3d = fn) +#define CALL_Color3dv(disp, parameters) (*((disp)->Color3dv)) parameters +#define GET_Color3dv(disp) ((disp)->Color3dv) +#define SET_Color3dv(disp, fn) ((disp)->Color3dv = fn) +#define CALL_Color3f(disp, parameters) (*((disp)->Color3f)) parameters +#define GET_Color3f(disp) ((disp)->Color3f) +#define SET_Color3f(disp, fn) ((disp)->Color3f = fn) +#define CALL_Color3fv(disp, parameters) (*((disp)->Color3fv)) parameters +#define GET_Color3fv(disp) ((disp)->Color3fv) +#define SET_Color3fv(disp, fn) ((disp)->Color3fv = fn) +#define CALL_Color3i(disp, parameters) (*((disp)->Color3i)) parameters +#define GET_Color3i(disp) ((disp)->Color3i) +#define SET_Color3i(disp, fn) ((disp)->Color3i = fn) +#define CALL_Color3iv(disp, parameters) (*((disp)->Color3iv)) parameters +#define GET_Color3iv(disp) ((disp)->Color3iv) +#define SET_Color3iv(disp, fn) ((disp)->Color3iv = fn) +#define CALL_Color3s(disp, parameters) (*((disp)->Color3s)) parameters +#define GET_Color3s(disp) ((disp)->Color3s) +#define SET_Color3s(disp, fn) ((disp)->Color3s = fn) +#define CALL_Color3sv(disp, parameters) (*((disp)->Color3sv)) parameters +#define GET_Color3sv(disp) ((disp)->Color3sv) +#define SET_Color3sv(disp, fn) ((disp)->Color3sv = fn) +#define CALL_Color3ub(disp, parameters) (*((disp)->Color3ub)) parameters +#define GET_Color3ub(disp) ((disp)->Color3ub) +#define SET_Color3ub(disp, fn) ((disp)->Color3ub = fn) +#define CALL_Color3ubv(disp, parameters) (*((disp)->Color3ubv)) parameters +#define GET_Color3ubv(disp) ((disp)->Color3ubv) +#define SET_Color3ubv(disp, fn) ((disp)->Color3ubv = fn) +#define CALL_Color3ui(disp, parameters) (*((disp)->Color3ui)) parameters +#define GET_Color3ui(disp) ((disp)->Color3ui) +#define SET_Color3ui(disp, fn) ((disp)->Color3ui = fn) +#define CALL_Color3uiv(disp, parameters) (*((disp)->Color3uiv)) parameters +#define GET_Color3uiv(disp) ((disp)->Color3uiv) +#define SET_Color3uiv(disp, fn) ((disp)->Color3uiv = fn) +#define CALL_Color3us(disp, parameters) (*((disp)->Color3us)) parameters +#define GET_Color3us(disp) ((disp)->Color3us) +#define SET_Color3us(disp, fn) ((disp)->Color3us = fn) +#define CALL_Color3usv(disp, parameters) (*((disp)->Color3usv)) parameters +#define GET_Color3usv(disp) ((disp)->Color3usv) +#define SET_Color3usv(disp, fn) ((disp)->Color3usv = fn) +#define CALL_Color4b(disp, parameters) (*((disp)->Color4b)) parameters +#define GET_Color4b(disp) ((disp)->Color4b) +#define SET_Color4b(disp, fn) ((disp)->Color4b = fn) +#define CALL_Color4bv(disp, parameters) (*((disp)->Color4bv)) parameters +#define GET_Color4bv(disp) ((disp)->Color4bv) +#define SET_Color4bv(disp, fn) ((disp)->Color4bv = fn) +#define CALL_Color4d(disp, parameters) (*((disp)->Color4d)) parameters +#define GET_Color4d(disp) ((disp)->Color4d) +#define SET_Color4d(disp, fn) ((disp)->Color4d = fn) +#define CALL_Color4dv(disp, parameters) (*((disp)->Color4dv)) parameters +#define GET_Color4dv(disp) ((disp)->Color4dv) +#define SET_Color4dv(disp, fn) ((disp)->Color4dv = fn) +#define CALL_Color4f(disp, parameters) (*((disp)->Color4f)) parameters +#define GET_Color4f(disp) ((disp)->Color4f) +#define SET_Color4f(disp, fn) ((disp)->Color4f = fn) +#define CALL_Color4fv(disp, parameters) (*((disp)->Color4fv)) parameters +#define GET_Color4fv(disp) ((disp)->Color4fv) +#define SET_Color4fv(disp, fn) ((disp)->Color4fv = fn) +#define CALL_Color4i(disp, parameters) (*((disp)->Color4i)) parameters +#define GET_Color4i(disp) ((disp)->Color4i) +#define SET_Color4i(disp, fn) ((disp)->Color4i = fn) +#define CALL_Color4iv(disp, parameters) (*((disp)->Color4iv)) parameters +#define GET_Color4iv(disp) ((disp)->Color4iv) +#define SET_Color4iv(disp, fn) ((disp)->Color4iv = fn) +#define CALL_Color4s(disp, parameters) (*((disp)->Color4s)) parameters +#define GET_Color4s(disp) ((disp)->Color4s) +#define SET_Color4s(disp, fn) ((disp)->Color4s = fn) +#define CALL_Color4sv(disp, parameters) (*((disp)->Color4sv)) parameters +#define GET_Color4sv(disp) ((disp)->Color4sv) +#define SET_Color4sv(disp, fn) ((disp)->Color4sv = fn) +#define CALL_Color4ub(disp, parameters) (*((disp)->Color4ub)) parameters +#define GET_Color4ub(disp) ((disp)->Color4ub) +#define SET_Color4ub(disp, fn) ((disp)->Color4ub = fn) +#define CALL_Color4ubv(disp, parameters) (*((disp)->Color4ubv)) parameters +#define GET_Color4ubv(disp) ((disp)->Color4ubv) +#define SET_Color4ubv(disp, fn) ((disp)->Color4ubv = fn) +#define CALL_Color4ui(disp, parameters) (*((disp)->Color4ui)) parameters +#define GET_Color4ui(disp) ((disp)->Color4ui) +#define SET_Color4ui(disp, fn) ((disp)->Color4ui = fn) +#define CALL_Color4uiv(disp, parameters) (*((disp)->Color4uiv)) parameters +#define GET_Color4uiv(disp) ((disp)->Color4uiv) +#define SET_Color4uiv(disp, fn) ((disp)->Color4uiv = fn) +#define CALL_Color4us(disp, parameters) (*((disp)->Color4us)) parameters +#define GET_Color4us(disp) ((disp)->Color4us) +#define SET_Color4us(disp, fn) ((disp)->Color4us = fn) +#define CALL_Color4usv(disp, parameters) (*((disp)->Color4usv)) parameters +#define GET_Color4usv(disp) ((disp)->Color4usv) +#define SET_Color4usv(disp, fn) ((disp)->Color4usv = fn) +#define CALL_EdgeFlag(disp, parameters) (*((disp)->EdgeFlag)) parameters +#define GET_EdgeFlag(disp) ((disp)->EdgeFlag) +#define SET_EdgeFlag(disp, fn) ((disp)->EdgeFlag = fn) +#define CALL_EdgeFlagv(disp, parameters) (*((disp)->EdgeFlagv)) parameters +#define GET_EdgeFlagv(disp) ((disp)->EdgeFlagv) +#define SET_EdgeFlagv(disp, fn) ((disp)->EdgeFlagv = fn) +#define CALL_End(disp, parameters) (*((disp)->End)) parameters +#define GET_End(disp) ((disp)->End) +#define SET_End(disp, fn) ((disp)->End = fn) +#define CALL_Indexd(disp, parameters) (*((disp)->Indexd)) parameters +#define GET_Indexd(disp) ((disp)->Indexd) +#define SET_Indexd(disp, fn) ((disp)->Indexd = fn) +#define CALL_Indexdv(disp, parameters) (*((disp)->Indexdv)) parameters +#define GET_Indexdv(disp) ((disp)->Indexdv) +#define SET_Indexdv(disp, fn) ((disp)->Indexdv = fn) +#define CALL_Indexf(disp, parameters) (*((disp)->Indexf)) parameters +#define GET_Indexf(disp) ((disp)->Indexf) +#define SET_Indexf(disp, fn) ((disp)->Indexf = fn) +#define CALL_Indexfv(disp, parameters) (*((disp)->Indexfv)) parameters +#define GET_Indexfv(disp) ((disp)->Indexfv) +#define SET_Indexfv(disp, fn) ((disp)->Indexfv = fn) +#define CALL_Indexi(disp, parameters) (*((disp)->Indexi)) parameters +#define GET_Indexi(disp) ((disp)->Indexi) +#define SET_Indexi(disp, fn) ((disp)->Indexi = fn) +#define CALL_Indexiv(disp, parameters) (*((disp)->Indexiv)) parameters +#define GET_Indexiv(disp) ((disp)->Indexiv) +#define SET_Indexiv(disp, fn) ((disp)->Indexiv = fn) +#define CALL_Indexs(disp, parameters) (*((disp)->Indexs)) parameters +#define GET_Indexs(disp) ((disp)->Indexs) +#define SET_Indexs(disp, fn) ((disp)->Indexs = fn) +#define CALL_Indexsv(disp, parameters) (*((disp)->Indexsv)) parameters +#define GET_Indexsv(disp) ((disp)->Indexsv) +#define SET_Indexsv(disp, fn) ((disp)->Indexsv = fn) +#define CALL_Normal3b(disp, parameters) (*((disp)->Normal3b)) parameters +#define GET_Normal3b(disp) ((disp)->Normal3b) +#define SET_Normal3b(disp, fn) ((disp)->Normal3b = fn) +#define CALL_Normal3bv(disp, parameters) (*((disp)->Normal3bv)) parameters +#define GET_Normal3bv(disp) ((disp)->Normal3bv) +#define SET_Normal3bv(disp, fn) ((disp)->Normal3bv = fn) +#define CALL_Normal3d(disp, parameters) (*((disp)->Normal3d)) parameters +#define GET_Normal3d(disp) ((disp)->Normal3d) +#define SET_Normal3d(disp, fn) ((disp)->Normal3d = fn) +#define CALL_Normal3dv(disp, parameters) (*((disp)->Normal3dv)) parameters +#define GET_Normal3dv(disp) ((disp)->Normal3dv) +#define SET_Normal3dv(disp, fn) ((disp)->Normal3dv = fn) +#define CALL_Normal3f(disp, parameters) (*((disp)->Normal3f)) parameters +#define GET_Normal3f(disp) ((disp)->Normal3f) +#define SET_Normal3f(disp, fn) ((disp)->Normal3f = fn) +#define CALL_Normal3fv(disp, parameters) (*((disp)->Normal3fv)) parameters +#define GET_Normal3fv(disp) ((disp)->Normal3fv) +#define SET_Normal3fv(disp, fn) ((disp)->Normal3fv = fn) +#define CALL_Normal3i(disp, parameters) (*((disp)->Normal3i)) parameters +#define GET_Normal3i(disp) ((disp)->Normal3i) +#define SET_Normal3i(disp, fn) ((disp)->Normal3i = fn) +#define CALL_Normal3iv(disp, parameters) (*((disp)->Normal3iv)) parameters +#define GET_Normal3iv(disp) ((disp)->Normal3iv) +#define SET_Normal3iv(disp, fn) ((disp)->Normal3iv = fn) +#define CALL_Normal3s(disp, parameters) (*((disp)->Normal3s)) parameters +#define GET_Normal3s(disp) ((disp)->Normal3s) +#define SET_Normal3s(disp, fn) ((disp)->Normal3s = fn) +#define CALL_Normal3sv(disp, parameters) (*((disp)->Normal3sv)) parameters +#define GET_Normal3sv(disp) ((disp)->Normal3sv) +#define SET_Normal3sv(disp, fn) ((disp)->Normal3sv = fn) +#define CALL_RasterPos2d(disp, parameters) (*((disp)->RasterPos2d)) parameters +#define GET_RasterPos2d(disp) ((disp)->RasterPos2d) +#define SET_RasterPos2d(disp, fn) ((disp)->RasterPos2d = fn) +#define CALL_RasterPos2dv(disp, parameters) (*((disp)->RasterPos2dv)) parameters +#define GET_RasterPos2dv(disp) ((disp)->RasterPos2dv) +#define SET_RasterPos2dv(disp, fn) ((disp)->RasterPos2dv = fn) +#define CALL_RasterPos2f(disp, parameters) (*((disp)->RasterPos2f)) parameters +#define GET_RasterPos2f(disp) ((disp)->RasterPos2f) +#define SET_RasterPos2f(disp, fn) ((disp)->RasterPos2f = fn) +#define CALL_RasterPos2fv(disp, parameters) (*((disp)->RasterPos2fv)) parameters +#define GET_RasterPos2fv(disp) ((disp)->RasterPos2fv) +#define SET_RasterPos2fv(disp, fn) ((disp)->RasterPos2fv = fn) +#define CALL_RasterPos2i(disp, parameters) (*((disp)->RasterPos2i)) parameters +#define GET_RasterPos2i(disp) ((disp)->RasterPos2i) +#define SET_RasterPos2i(disp, fn) ((disp)->RasterPos2i = fn) +#define CALL_RasterPos2iv(disp, parameters) (*((disp)->RasterPos2iv)) parameters +#define GET_RasterPos2iv(disp) ((disp)->RasterPos2iv) +#define SET_RasterPos2iv(disp, fn) ((disp)->RasterPos2iv = fn) +#define CALL_RasterPos2s(disp, parameters) (*((disp)->RasterPos2s)) parameters +#define GET_RasterPos2s(disp) ((disp)->RasterPos2s) +#define SET_RasterPos2s(disp, fn) ((disp)->RasterPos2s = fn) +#define CALL_RasterPos2sv(disp, parameters) (*((disp)->RasterPos2sv)) parameters +#define GET_RasterPos2sv(disp) ((disp)->RasterPos2sv) +#define SET_RasterPos2sv(disp, fn) ((disp)->RasterPos2sv = fn) +#define CALL_RasterPos3d(disp, parameters) (*((disp)->RasterPos3d)) parameters +#define GET_RasterPos3d(disp) ((disp)->RasterPos3d) +#define SET_RasterPos3d(disp, fn) ((disp)->RasterPos3d = fn) +#define CALL_RasterPos3dv(disp, parameters) (*((disp)->RasterPos3dv)) parameters +#define GET_RasterPos3dv(disp) ((disp)->RasterPos3dv) +#define SET_RasterPos3dv(disp, fn) ((disp)->RasterPos3dv = fn) +#define CALL_RasterPos3f(disp, parameters) (*((disp)->RasterPos3f)) parameters +#define GET_RasterPos3f(disp) ((disp)->RasterPos3f) +#define SET_RasterPos3f(disp, fn) ((disp)->RasterPos3f = fn) +#define CALL_RasterPos3fv(disp, parameters) (*((disp)->RasterPos3fv)) parameters +#define GET_RasterPos3fv(disp) ((disp)->RasterPos3fv) +#define SET_RasterPos3fv(disp, fn) ((disp)->RasterPos3fv = fn) +#define CALL_RasterPos3i(disp, parameters) (*((disp)->RasterPos3i)) parameters +#define GET_RasterPos3i(disp) ((disp)->RasterPos3i) +#define SET_RasterPos3i(disp, fn) ((disp)->RasterPos3i = fn) +#define CALL_RasterPos3iv(disp, parameters) (*((disp)->RasterPos3iv)) parameters +#define GET_RasterPos3iv(disp) ((disp)->RasterPos3iv) +#define SET_RasterPos3iv(disp, fn) ((disp)->RasterPos3iv = fn) +#define CALL_RasterPos3s(disp, parameters) (*((disp)->RasterPos3s)) parameters +#define GET_RasterPos3s(disp) ((disp)->RasterPos3s) +#define SET_RasterPos3s(disp, fn) ((disp)->RasterPos3s = fn) +#define CALL_RasterPos3sv(disp, parameters) (*((disp)->RasterPos3sv)) parameters +#define GET_RasterPos3sv(disp) ((disp)->RasterPos3sv) +#define SET_RasterPos3sv(disp, fn) ((disp)->RasterPos3sv = fn) +#define CALL_RasterPos4d(disp, parameters) (*((disp)->RasterPos4d)) parameters +#define GET_RasterPos4d(disp) ((disp)->RasterPos4d) +#define SET_RasterPos4d(disp, fn) ((disp)->RasterPos4d = fn) +#define CALL_RasterPos4dv(disp, parameters) (*((disp)->RasterPos4dv)) parameters +#define GET_RasterPos4dv(disp) ((disp)->RasterPos4dv) +#define SET_RasterPos4dv(disp, fn) ((disp)->RasterPos4dv = fn) +#define CALL_RasterPos4f(disp, parameters) (*((disp)->RasterPos4f)) parameters +#define GET_RasterPos4f(disp) ((disp)->RasterPos4f) +#define SET_RasterPos4f(disp, fn) ((disp)->RasterPos4f = fn) +#define CALL_RasterPos4fv(disp, parameters) (*((disp)->RasterPos4fv)) parameters +#define GET_RasterPos4fv(disp) ((disp)->RasterPos4fv) +#define SET_RasterPos4fv(disp, fn) ((disp)->RasterPos4fv = fn) +#define CALL_RasterPos4i(disp, parameters) (*((disp)->RasterPos4i)) parameters +#define GET_RasterPos4i(disp) ((disp)->RasterPos4i) +#define SET_RasterPos4i(disp, fn) ((disp)->RasterPos4i = fn) +#define CALL_RasterPos4iv(disp, parameters) (*((disp)->RasterPos4iv)) parameters +#define GET_RasterPos4iv(disp) ((disp)->RasterPos4iv) +#define SET_RasterPos4iv(disp, fn) ((disp)->RasterPos4iv = fn) +#define CALL_RasterPos4s(disp, parameters) (*((disp)->RasterPos4s)) parameters +#define GET_RasterPos4s(disp) ((disp)->RasterPos4s) +#define SET_RasterPos4s(disp, fn) ((disp)->RasterPos4s = fn) +#define CALL_RasterPos4sv(disp, parameters) (*((disp)->RasterPos4sv)) parameters +#define GET_RasterPos4sv(disp) ((disp)->RasterPos4sv) +#define SET_RasterPos4sv(disp, fn) ((disp)->RasterPos4sv = fn) +#define CALL_Rectd(disp, parameters) (*((disp)->Rectd)) parameters +#define GET_Rectd(disp) ((disp)->Rectd) +#define SET_Rectd(disp, fn) ((disp)->Rectd = fn) +#define CALL_Rectdv(disp, parameters) (*((disp)->Rectdv)) parameters +#define GET_Rectdv(disp) ((disp)->Rectdv) +#define SET_Rectdv(disp, fn) ((disp)->Rectdv = fn) +#define CALL_Rectf(disp, parameters) (*((disp)->Rectf)) parameters +#define GET_Rectf(disp) ((disp)->Rectf) +#define SET_Rectf(disp, fn) ((disp)->Rectf = fn) +#define CALL_Rectfv(disp, parameters) (*((disp)->Rectfv)) parameters +#define GET_Rectfv(disp) ((disp)->Rectfv) +#define SET_Rectfv(disp, fn) ((disp)->Rectfv = fn) +#define CALL_Recti(disp, parameters) (*((disp)->Recti)) parameters +#define GET_Recti(disp) ((disp)->Recti) +#define SET_Recti(disp, fn) ((disp)->Recti = fn) +#define CALL_Rectiv(disp, parameters) (*((disp)->Rectiv)) parameters +#define GET_Rectiv(disp) ((disp)->Rectiv) +#define SET_Rectiv(disp, fn) ((disp)->Rectiv = fn) +#define CALL_Rects(disp, parameters) (*((disp)->Rects)) parameters +#define GET_Rects(disp) ((disp)->Rects) +#define SET_Rects(disp, fn) ((disp)->Rects = fn) +#define CALL_Rectsv(disp, parameters) (*((disp)->Rectsv)) parameters +#define GET_Rectsv(disp) ((disp)->Rectsv) +#define SET_Rectsv(disp, fn) ((disp)->Rectsv = fn) +#define CALL_TexCoord1d(disp, parameters) (*((disp)->TexCoord1d)) parameters +#define GET_TexCoord1d(disp) ((disp)->TexCoord1d) +#define SET_TexCoord1d(disp, fn) ((disp)->TexCoord1d = fn) +#define CALL_TexCoord1dv(disp, parameters) (*((disp)->TexCoord1dv)) parameters +#define GET_TexCoord1dv(disp) ((disp)->TexCoord1dv) +#define SET_TexCoord1dv(disp, fn) ((disp)->TexCoord1dv = fn) +#define CALL_TexCoord1f(disp, parameters) (*((disp)->TexCoord1f)) parameters +#define GET_TexCoord1f(disp) ((disp)->TexCoord1f) +#define SET_TexCoord1f(disp, fn) ((disp)->TexCoord1f = fn) +#define CALL_TexCoord1fv(disp, parameters) (*((disp)->TexCoord1fv)) parameters +#define GET_TexCoord1fv(disp) ((disp)->TexCoord1fv) +#define SET_TexCoord1fv(disp, fn) ((disp)->TexCoord1fv = fn) +#define CALL_TexCoord1i(disp, parameters) (*((disp)->TexCoord1i)) parameters +#define GET_TexCoord1i(disp) ((disp)->TexCoord1i) +#define SET_TexCoord1i(disp, fn) ((disp)->TexCoord1i = fn) +#define CALL_TexCoord1iv(disp, parameters) (*((disp)->TexCoord1iv)) parameters +#define GET_TexCoord1iv(disp) ((disp)->TexCoord1iv) +#define SET_TexCoord1iv(disp, fn) ((disp)->TexCoord1iv = fn) +#define CALL_TexCoord1s(disp, parameters) (*((disp)->TexCoord1s)) parameters +#define GET_TexCoord1s(disp) ((disp)->TexCoord1s) +#define SET_TexCoord1s(disp, fn) ((disp)->TexCoord1s = fn) +#define CALL_TexCoord1sv(disp, parameters) (*((disp)->TexCoord1sv)) parameters +#define GET_TexCoord1sv(disp) ((disp)->TexCoord1sv) +#define SET_TexCoord1sv(disp, fn) ((disp)->TexCoord1sv = fn) +#define CALL_TexCoord2d(disp, parameters) (*((disp)->TexCoord2d)) parameters +#define GET_TexCoord2d(disp) ((disp)->TexCoord2d) +#define SET_TexCoord2d(disp, fn) ((disp)->TexCoord2d = fn) +#define CALL_TexCoord2dv(disp, parameters) (*((disp)->TexCoord2dv)) parameters +#define GET_TexCoord2dv(disp) ((disp)->TexCoord2dv) +#define SET_TexCoord2dv(disp, fn) ((disp)->TexCoord2dv = fn) +#define CALL_TexCoord2f(disp, parameters) (*((disp)->TexCoord2f)) parameters +#define GET_TexCoord2f(disp) ((disp)->TexCoord2f) +#define SET_TexCoord2f(disp, fn) ((disp)->TexCoord2f = fn) +#define CALL_TexCoord2fv(disp, parameters) (*((disp)->TexCoord2fv)) parameters +#define GET_TexCoord2fv(disp) ((disp)->TexCoord2fv) +#define SET_TexCoord2fv(disp, fn) ((disp)->TexCoord2fv = fn) +#define CALL_TexCoord2i(disp, parameters) (*((disp)->TexCoord2i)) parameters +#define GET_TexCoord2i(disp) ((disp)->TexCoord2i) +#define SET_TexCoord2i(disp, fn) ((disp)->TexCoord2i = fn) +#define CALL_TexCoord2iv(disp, parameters) (*((disp)->TexCoord2iv)) parameters +#define GET_TexCoord2iv(disp) ((disp)->TexCoord2iv) +#define SET_TexCoord2iv(disp, fn) ((disp)->TexCoord2iv = fn) +#define CALL_TexCoord2s(disp, parameters) (*((disp)->TexCoord2s)) parameters +#define GET_TexCoord2s(disp) ((disp)->TexCoord2s) +#define SET_TexCoord2s(disp, fn) ((disp)->TexCoord2s = fn) +#define CALL_TexCoord2sv(disp, parameters) (*((disp)->TexCoord2sv)) parameters +#define GET_TexCoord2sv(disp) ((disp)->TexCoord2sv) +#define SET_TexCoord2sv(disp, fn) ((disp)->TexCoord2sv = fn) +#define CALL_TexCoord3d(disp, parameters) (*((disp)->TexCoord3d)) parameters +#define GET_TexCoord3d(disp) ((disp)->TexCoord3d) +#define SET_TexCoord3d(disp, fn) ((disp)->TexCoord3d = fn) +#define CALL_TexCoord3dv(disp, parameters) (*((disp)->TexCoord3dv)) parameters +#define GET_TexCoord3dv(disp) ((disp)->TexCoord3dv) +#define SET_TexCoord3dv(disp, fn) ((disp)->TexCoord3dv = fn) +#define CALL_TexCoord3f(disp, parameters) (*((disp)->TexCoord3f)) parameters +#define GET_TexCoord3f(disp) ((disp)->TexCoord3f) +#define SET_TexCoord3f(disp, fn) ((disp)->TexCoord3f = fn) +#define CALL_TexCoord3fv(disp, parameters) (*((disp)->TexCoord3fv)) parameters +#define GET_TexCoord3fv(disp) ((disp)->TexCoord3fv) +#define SET_TexCoord3fv(disp, fn) ((disp)->TexCoord3fv = fn) +#define CALL_TexCoord3i(disp, parameters) (*((disp)->TexCoord3i)) parameters +#define GET_TexCoord3i(disp) ((disp)->TexCoord3i) +#define SET_TexCoord3i(disp, fn) ((disp)->TexCoord3i = fn) +#define CALL_TexCoord3iv(disp, parameters) (*((disp)->TexCoord3iv)) parameters +#define GET_TexCoord3iv(disp) ((disp)->TexCoord3iv) +#define SET_TexCoord3iv(disp, fn) ((disp)->TexCoord3iv = fn) +#define CALL_TexCoord3s(disp, parameters) (*((disp)->TexCoord3s)) parameters +#define GET_TexCoord3s(disp) ((disp)->TexCoord3s) +#define SET_TexCoord3s(disp, fn) ((disp)->TexCoord3s = fn) +#define CALL_TexCoord3sv(disp, parameters) (*((disp)->TexCoord3sv)) parameters +#define GET_TexCoord3sv(disp) ((disp)->TexCoord3sv) +#define SET_TexCoord3sv(disp, fn) ((disp)->TexCoord3sv = fn) +#define CALL_TexCoord4d(disp, parameters) (*((disp)->TexCoord4d)) parameters +#define GET_TexCoord4d(disp) ((disp)->TexCoord4d) +#define SET_TexCoord4d(disp, fn) ((disp)->TexCoord4d = fn) +#define CALL_TexCoord4dv(disp, parameters) (*((disp)->TexCoord4dv)) parameters +#define GET_TexCoord4dv(disp) ((disp)->TexCoord4dv) +#define SET_TexCoord4dv(disp, fn) ((disp)->TexCoord4dv = fn) +#define CALL_TexCoord4f(disp, parameters) (*((disp)->TexCoord4f)) parameters +#define GET_TexCoord4f(disp) ((disp)->TexCoord4f) +#define SET_TexCoord4f(disp, fn) ((disp)->TexCoord4f = fn) +#define CALL_TexCoord4fv(disp, parameters) (*((disp)->TexCoord4fv)) parameters +#define GET_TexCoord4fv(disp) ((disp)->TexCoord4fv) +#define SET_TexCoord4fv(disp, fn) ((disp)->TexCoord4fv = fn) +#define CALL_TexCoord4i(disp, parameters) (*((disp)->TexCoord4i)) parameters +#define GET_TexCoord4i(disp) ((disp)->TexCoord4i) +#define SET_TexCoord4i(disp, fn) ((disp)->TexCoord4i = fn) +#define CALL_TexCoord4iv(disp, parameters) (*((disp)->TexCoord4iv)) parameters +#define GET_TexCoord4iv(disp) ((disp)->TexCoord4iv) +#define SET_TexCoord4iv(disp, fn) ((disp)->TexCoord4iv = fn) +#define CALL_TexCoord4s(disp, parameters) (*((disp)->TexCoord4s)) parameters +#define GET_TexCoord4s(disp) ((disp)->TexCoord4s) +#define SET_TexCoord4s(disp, fn) ((disp)->TexCoord4s = fn) +#define CALL_TexCoord4sv(disp, parameters) (*((disp)->TexCoord4sv)) parameters +#define GET_TexCoord4sv(disp) ((disp)->TexCoord4sv) +#define SET_TexCoord4sv(disp, fn) ((disp)->TexCoord4sv = fn) +#define CALL_Vertex2d(disp, parameters) (*((disp)->Vertex2d)) parameters +#define GET_Vertex2d(disp) ((disp)->Vertex2d) +#define SET_Vertex2d(disp, fn) ((disp)->Vertex2d = fn) +#define CALL_Vertex2dv(disp, parameters) (*((disp)->Vertex2dv)) parameters +#define GET_Vertex2dv(disp) ((disp)->Vertex2dv) +#define SET_Vertex2dv(disp, fn) ((disp)->Vertex2dv = fn) +#define CALL_Vertex2f(disp, parameters) (*((disp)->Vertex2f)) parameters +#define GET_Vertex2f(disp) ((disp)->Vertex2f) +#define SET_Vertex2f(disp, fn) ((disp)->Vertex2f = fn) +#define CALL_Vertex2fv(disp, parameters) (*((disp)->Vertex2fv)) parameters +#define GET_Vertex2fv(disp) ((disp)->Vertex2fv) +#define SET_Vertex2fv(disp, fn) ((disp)->Vertex2fv = fn) +#define CALL_Vertex2i(disp, parameters) (*((disp)->Vertex2i)) parameters +#define GET_Vertex2i(disp) ((disp)->Vertex2i) +#define SET_Vertex2i(disp, fn) ((disp)->Vertex2i = fn) +#define CALL_Vertex2iv(disp, parameters) (*((disp)->Vertex2iv)) parameters +#define GET_Vertex2iv(disp) ((disp)->Vertex2iv) +#define SET_Vertex2iv(disp, fn) ((disp)->Vertex2iv = fn) +#define CALL_Vertex2s(disp, parameters) (*((disp)->Vertex2s)) parameters +#define GET_Vertex2s(disp) ((disp)->Vertex2s) +#define SET_Vertex2s(disp, fn) ((disp)->Vertex2s = fn) +#define CALL_Vertex2sv(disp, parameters) (*((disp)->Vertex2sv)) parameters +#define GET_Vertex2sv(disp) ((disp)->Vertex2sv) +#define SET_Vertex2sv(disp, fn) ((disp)->Vertex2sv = fn) +#define CALL_Vertex3d(disp, parameters) (*((disp)->Vertex3d)) parameters +#define GET_Vertex3d(disp) ((disp)->Vertex3d) +#define SET_Vertex3d(disp, fn) ((disp)->Vertex3d = fn) +#define CALL_Vertex3dv(disp, parameters) (*((disp)->Vertex3dv)) parameters +#define GET_Vertex3dv(disp) ((disp)->Vertex3dv) +#define SET_Vertex3dv(disp, fn) ((disp)->Vertex3dv = fn) +#define CALL_Vertex3f(disp, parameters) (*((disp)->Vertex3f)) parameters +#define GET_Vertex3f(disp) ((disp)->Vertex3f) +#define SET_Vertex3f(disp, fn) ((disp)->Vertex3f = fn) +#define CALL_Vertex3fv(disp, parameters) (*((disp)->Vertex3fv)) parameters +#define GET_Vertex3fv(disp) ((disp)->Vertex3fv) +#define SET_Vertex3fv(disp, fn) ((disp)->Vertex3fv = fn) +#define CALL_Vertex3i(disp, parameters) (*((disp)->Vertex3i)) parameters +#define GET_Vertex3i(disp) ((disp)->Vertex3i) +#define SET_Vertex3i(disp, fn) ((disp)->Vertex3i = fn) +#define CALL_Vertex3iv(disp, parameters) (*((disp)->Vertex3iv)) parameters +#define GET_Vertex3iv(disp) ((disp)->Vertex3iv) +#define SET_Vertex3iv(disp, fn) ((disp)->Vertex3iv = fn) +#define CALL_Vertex3s(disp, parameters) (*((disp)->Vertex3s)) parameters +#define GET_Vertex3s(disp) ((disp)->Vertex3s) +#define SET_Vertex3s(disp, fn) ((disp)->Vertex3s = fn) +#define CALL_Vertex3sv(disp, parameters) (*((disp)->Vertex3sv)) parameters +#define GET_Vertex3sv(disp) ((disp)->Vertex3sv) +#define SET_Vertex3sv(disp, fn) ((disp)->Vertex3sv = fn) +#define CALL_Vertex4d(disp, parameters) (*((disp)->Vertex4d)) parameters +#define GET_Vertex4d(disp) ((disp)->Vertex4d) +#define SET_Vertex4d(disp, fn) ((disp)->Vertex4d = fn) +#define CALL_Vertex4dv(disp, parameters) (*((disp)->Vertex4dv)) parameters +#define GET_Vertex4dv(disp) ((disp)->Vertex4dv) +#define SET_Vertex4dv(disp, fn) ((disp)->Vertex4dv = fn) +#define CALL_Vertex4f(disp, parameters) (*((disp)->Vertex4f)) parameters +#define GET_Vertex4f(disp) ((disp)->Vertex4f) +#define SET_Vertex4f(disp, fn) ((disp)->Vertex4f = fn) +#define CALL_Vertex4fv(disp, parameters) (*((disp)->Vertex4fv)) parameters +#define GET_Vertex4fv(disp) ((disp)->Vertex4fv) +#define SET_Vertex4fv(disp, fn) ((disp)->Vertex4fv = fn) +#define CALL_Vertex4i(disp, parameters) (*((disp)->Vertex4i)) parameters +#define GET_Vertex4i(disp) ((disp)->Vertex4i) +#define SET_Vertex4i(disp, fn) ((disp)->Vertex4i = fn) +#define CALL_Vertex4iv(disp, parameters) (*((disp)->Vertex4iv)) parameters +#define GET_Vertex4iv(disp) ((disp)->Vertex4iv) +#define SET_Vertex4iv(disp, fn) ((disp)->Vertex4iv = fn) +#define CALL_Vertex4s(disp, parameters) (*((disp)->Vertex4s)) parameters +#define GET_Vertex4s(disp) ((disp)->Vertex4s) +#define SET_Vertex4s(disp, fn) ((disp)->Vertex4s = fn) +#define CALL_Vertex4sv(disp, parameters) (*((disp)->Vertex4sv)) parameters +#define GET_Vertex4sv(disp) ((disp)->Vertex4sv) +#define SET_Vertex4sv(disp, fn) ((disp)->Vertex4sv = fn) +#define CALL_ClipPlane(disp, parameters) (*((disp)->ClipPlane)) parameters +#define GET_ClipPlane(disp) ((disp)->ClipPlane) +#define SET_ClipPlane(disp, fn) ((disp)->ClipPlane = fn) +#define CALL_ColorMaterial(disp, parameters) (*((disp)->ColorMaterial)) parameters +#define GET_ColorMaterial(disp) ((disp)->ColorMaterial) +#define SET_ColorMaterial(disp, fn) ((disp)->ColorMaterial = fn) +#define CALL_CullFace(disp, parameters) (*((disp)->CullFace)) parameters +#define GET_CullFace(disp) ((disp)->CullFace) +#define SET_CullFace(disp, fn) ((disp)->CullFace = fn) +#define CALL_Fogf(disp, parameters) (*((disp)->Fogf)) parameters +#define GET_Fogf(disp) ((disp)->Fogf) +#define SET_Fogf(disp, fn) ((disp)->Fogf = fn) +#define CALL_Fogfv(disp, parameters) (*((disp)->Fogfv)) parameters +#define GET_Fogfv(disp) ((disp)->Fogfv) +#define SET_Fogfv(disp, fn) ((disp)->Fogfv = fn) +#define CALL_Fogi(disp, parameters) (*((disp)->Fogi)) parameters +#define GET_Fogi(disp) ((disp)->Fogi) +#define SET_Fogi(disp, fn) ((disp)->Fogi = fn) +#define CALL_Fogiv(disp, parameters) (*((disp)->Fogiv)) parameters +#define GET_Fogiv(disp) ((disp)->Fogiv) +#define SET_Fogiv(disp, fn) ((disp)->Fogiv = fn) +#define CALL_FrontFace(disp, parameters) (*((disp)->FrontFace)) parameters +#define GET_FrontFace(disp) ((disp)->FrontFace) +#define SET_FrontFace(disp, fn) ((disp)->FrontFace = fn) +#define CALL_Hint(disp, parameters) (*((disp)->Hint)) parameters +#define GET_Hint(disp) ((disp)->Hint) +#define SET_Hint(disp, fn) ((disp)->Hint = fn) +#define CALL_Lightf(disp, parameters) (*((disp)->Lightf)) parameters +#define GET_Lightf(disp) ((disp)->Lightf) +#define SET_Lightf(disp, fn) ((disp)->Lightf = fn) +#define CALL_Lightfv(disp, parameters) (*((disp)->Lightfv)) parameters +#define GET_Lightfv(disp) ((disp)->Lightfv) +#define SET_Lightfv(disp, fn) ((disp)->Lightfv = fn) +#define CALL_Lighti(disp, parameters) (*((disp)->Lighti)) parameters +#define GET_Lighti(disp) ((disp)->Lighti) +#define SET_Lighti(disp, fn) ((disp)->Lighti = fn) +#define CALL_Lightiv(disp, parameters) (*((disp)->Lightiv)) parameters +#define GET_Lightiv(disp) ((disp)->Lightiv) +#define SET_Lightiv(disp, fn) ((disp)->Lightiv = fn) +#define CALL_LightModelf(disp, parameters) (*((disp)->LightModelf)) parameters +#define GET_LightModelf(disp) ((disp)->LightModelf) +#define SET_LightModelf(disp, fn) ((disp)->LightModelf = fn) +#define CALL_LightModelfv(disp, parameters) (*((disp)->LightModelfv)) parameters +#define GET_LightModelfv(disp) ((disp)->LightModelfv) +#define SET_LightModelfv(disp, fn) ((disp)->LightModelfv = fn) +#define CALL_LightModeli(disp, parameters) (*((disp)->LightModeli)) parameters +#define GET_LightModeli(disp) ((disp)->LightModeli) +#define SET_LightModeli(disp, fn) ((disp)->LightModeli = fn) +#define CALL_LightModeliv(disp, parameters) (*((disp)->LightModeliv)) parameters +#define GET_LightModeliv(disp) ((disp)->LightModeliv) +#define SET_LightModeliv(disp, fn) ((disp)->LightModeliv = fn) +#define CALL_LineStipple(disp, parameters) (*((disp)->LineStipple)) parameters +#define GET_LineStipple(disp) ((disp)->LineStipple) +#define SET_LineStipple(disp, fn) ((disp)->LineStipple = fn) +#define CALL_LineWidth(disp, parameters) (*((disp)->LineWidth)) parameters +#define GET_LineWidth(disp) ((disp)->LineWidth) +#define SET_LineWidth(disp, fn) ((disp)->LineWidth = fn) +#define CALL_Materialf(disp, parameters) (*((disp)->Materialf)) parameters +#define GET_Materialf(disp) ((disp)->Materialf) +#define SET_Materialf(disp, fn) ((disp)->Materialf = fn) +#define CALL_Materialfv(disp, parameters) (*((disp)->Materialfv)) parameters +#define GET_Materialfv(disp) ((disp)->Materialfv) +#define SET_Materialfv(disp, fn) ((disp)->Materialfv = fn) +#define CALL_Materiali(disp, parameters) (*((disp)->Materiali)) parameters +#define GET_Materiali(disp) ((disp)->Materiali) +#define SET_Materiali(disp, fn) ((disp)->Materiali = fn) +#define CALL_Materialiv(disp, parameters) (*((disp)->Materialiv)) parameters +#define GET_Materialiv(disp) ((disp)->Materialiv) +#define SET_Materialiv(disp, fn) ((disp)->Materialiv = fn) +#define CALL_PointSize(disp, parameters) (*((disp)->PointSize)) parameters +#define GET_PointSize(disp) ((disp)->PointSize) +#define SET_PointSize(disp, fn) ((disp)->PointSize = fn) +#define CALL_PolygonMode(disp, parameters) (*((disp)->PolygonMode)) parameters +#define GET_PolygonMode(disp) ((disp)->PolygonMode) +#define SET_PolygonMode(disp, fn) ((disp)->PolygonMode = fn) +#define CALL_PolygonStipple(disp, parameters) (*((disp)->PolygonStipple)) parameters +#define GET_PolygonStipple(disp) ((disp)->PolygonStipple) +#define SET_PolygonStipple(disp, fn) ((disp)->PolygonStipple = fn) +#define CALL_Scissor(disp, parameters) (*((disp)->Scissor)) parameters +#define GET_Scissor(disp) ((disp)->Scissor) +#define SET_Scissor(disp, fn) ((disp)->Scissor = fn) +#define CALL_ShadeModel(disp, parameters) (*((disp)->ShadeModel)) parameters +#define GET_ShadeModel(disp) ((disp)->ShadeModel) +#define SET_ShadeModel(disp, fn) ((disp)->ShadeModel = fn) +#define CALL_TexParameterf(disp, parameters) (*((disp)->TexParameterf)) parameters +#define GET_TexParameterf(disp) ((disp)->TexParameterf) +#define SET_TexParameterf(disp, fn) ((disp)->TexParameterf = fn) +#define CALL_TexParameterfv(disp, parameters) (*((disp)->TexParameterfv)) parameters +#define GET_TexParameterfv(disp) ((disp)->TexParameterfv) +#define SET_TexParameterfv(disp, fn) ((disp)->TexParameterfv = fn) +#define CALL_TexParameteri(disp, parameters) (*((disp)->TexParameteri)) parameters +#define GET_TexParameteri(disp) ((disp)->TexParameteri) +#define SET_TexParameteri(disp, fn) ((disp)->TexParameteri = fn) +#define CALL_TexParameteriv(disp, parameters) (*((disp)->TexParameteriv)) parameters +#define GET_TexParameteriv(disp) ((disp)->TexParameteriv) +#define SET_TexParameteriv(disp, fn) ((disp)->TexParameteriv = fn) +#define CALL_TexImage1D(disp, parameters) (*((disp)->TexImage1D)) parameters +#define GET_TexImage1D(disp) ((disp)->TexImage1D) +#define SET_TexImage1D(disp, fn) ((disp)->TexImage1D = fn) +#define CALL_TexImage2D(disp, parameters) (*((disp)->TexImage2D)) parameters +#define GET_TexImage2D(disp) ((disp)->TexImage2D) +#define SET_TexImage2D(disp, fn) ((disp)->TexImage2D = fn) +#define CALL_TexEnvf(disp, parameters) (*((disp)->TexEnvf)) parameters +#define GET_TexEnvf(disp) ((disp)->TexEnvf) +#define SET_TexEnvf(disp, fn) ((disp)->TexEnvf = fn) +#define CALL_TexEnvfv(disp, parameters) (*((disp)->TexEnvfv)) parameters +#define GET_TexEnvfv(disp) ((disp)->TexEnvfv) +#define SET_TexEnvfv(disp, fn) ((disp)->TexEnvfv = fn) +#define CALL_TexEnvi(disp, parameters) (*((disp)->TexEnvi)) parameters +#define GET_TexEnvi(disp) ((disp)->TexEnvi) +#define SET_TexEnvi(disp, fn) ((disp)->TexEnvi = fn) +#define CALL_TexEnviv(disp, parameters) (*((disp)->TexEnviv)) parameters +#define GET_TexEnviv(disp) ((disp)->TexEnviv) +#define SET_TexEnviv(disp, fn) ((disp)->TexEnviv = fn) +#define CALL_TexGend(disp, parameters) (*((disp)->TexGend)) parameters +#define GET_TexGend(disp) ((disp)->TexGend) +#define SET_TexGend(disp, fn) ((disp)->TexGend = fn) +#define CALL_TexGendv(disp, parameters) (*((disp)->TexGendv)) parameters +#define GET_TexGendv(disp) ((disp)->TexGendv) +#define SET_TexGendv(disp, fn) ((disp)->TexGendv = fn) +#define CALL_TexGenf(disp, parameters) (*((disp)->TexGenf)) parameters +#define GET_TexGenf(disp) ((disp)->TexGenf) +#define SET_TexGenf(disp, fn) ((disp)->TexGenf = fn) +#define CALL_TexGenfv(disp, parameters) (*((disp)->TexGenfv)) parameters +#define GET_TexGenfv(disp) ((disp)->TexGenfv) +#define SET_TexGenfv(disp, fn) ((disp)->TexGenfv = fn) +#define CALL_TexGeni(disp, parameters) (*((disp)->TexGeni)) parameters +#define GET_TexGeni(disp) ((disp)->TexGeni) +#define SET_TexGeni(disp, fn) ((disp)->TexGeni = fn) +#define CALL_TexGeniv(disp, parameters) (*((disp)->TexGeniv)) parameters +#define GET_TexGeniv(disp) ((disp)->TexGeniv) +#define SET_TexGeniv(disp, fn) ((disp)->TexGeniv = fn) +#define CALL_FeedbackBuffer(disp, parameters) (*((disp)->FeedbackBuffer)) parameters +#define GET_FeedbackBuffer(disp) ((disp)->FeedbackBuffer) +#define SET_FeedbackBuffer(disp, fn) ((disp)->FeedbackBuffer = fn) +#define CALL_SelectBuffer(disp, parameters) (*((disp)->SelectBuffer)) parameters +#define GET_SelectBuffer(disp) ((disp)->SelectBuffer) +#define SET_SelectBuffer(disp, fn) ((disp)->SelectBuffer = fn) +#define CALL_RenderMode(disp, parameters) (*((disp)->RenderMode)) parameters +#define GET_RenderMode(disp) ((disp)->RenderMode) +#define SET_RenderMode(disp, fn) ((disp)->RenderMode = fn) +#define CALL_InitNames(disp, parameters) (*((disp)->InitNames)) parameters +#define GET_InitNames(disp) ((disp)->InitNames) +#define SET_InitNames(disp, fn) ((disp)->InitNames = fn) +#define CALL_LoadName(disp, parameters) (*((disp)->LoadName)) parameters +#define GET_LoadName(disp) ((disp)->LoadName) +#define SET_LoadName(disp, fn) ((disp)->LoadName = fn) +#define CALL_PassThrough(disp, parameters) (*((disp)->PassThrough)) parameters +#define GET_PassThrough(disp) ((disp)->PassThrough) +#define SET_PassThrough(disp, fn) ((disp)->PassThrough = fn) +#define CALL_PopName(disp, parameters) (*((disp)->PopName)) parameters +#define GET_PopName(disp) ((disp)->PopName) +#define SET_PopName(disp, fn) ((disp)->PopName = fn) +#define CALL_PushName(disp, parameters) (*((disp)->PushName)) parameters +#define GET_PushName(disp) ((disp)->PushName) +#define SET_PushName(disp, fn) ((disp)->PushName = fn) +#define CALL_DrawBuffer(disp, parameters) (*((disp)->DrawBuffer)) parameters +#define GET_DrawBuffer(disp) ((disp)->DrawBuffer) +#define SET_DrawBuffer(disp, fn) ((disp)->DrawBuffer = fn) +#define CALL_Clear(disp, parameters) (*((disp)->Clear)) parameters +#define GET_Clear(disp) ((disp)->Clear) +#define SET_Clear(disp, fn) ((disp)->Clear = fn) +#define CALL_ClearAccum(disp, parameters) (*((disp)->ClearAccum)) parameters +#define GET_ClearAccum(disp) ((disp)->ClearAccum) +#define SET_ClearAccum(disp, fn) ((disp)->ClearAccum = fn) +#define CALL_ClearIndex(disp, parameters) (*((disp)->ClearIndex)) parameters +#define GET_ClearIndex(disp) ((disp)->ClearIndex) +#define SET_ClearIndex(disp, fn) ((disp)->ClearIndex = fn) +#define CALL_ClearColor(disp, parameters) (*((disp)->ClearColor)) parameters +#define GET_ClearColor(disp) ((disp)->ClearColor) +#define SET_ClearColor(disp, fn) ((disp)->ClearColor = fn) +#define CALL_ClearStencil(disp, parameters) (*((disp)->ClearStencil)) parameters +#define GET_ClearStencil(disp) ((disp)->ClearStencil) +#define SET_ClearStencil(disp, fn) ((disp)->ClearStencil = fn) +#define CALL_ClearDepth(disp, parameters) (*((disp)->ClearDepth)) parameters +#define GET_ClearDepth(disp) ((disp)->ClearDepth) +#define SET_ClearDepth(disp, fn) ((disp)->ClearDepth = fn) +#define CALL_StencilMask(disp, parameters) (*((disp)->StencilMask)) parameters +#define GET_StencilMask(disp) ((disp)->StencilMask) +#define SET_StencilMask(disp, fn) ((disp)->StencilMask = fn) +#define CALL_ColorMask(disp, parameters) (*((disp)->ColorMask)) parameters +#define GET_ColorMask(disp) ((disp)->ColorMask) +#define SET_ColorMask(disp, fn) ((disp)->ColorMask = fn) +#define CALL_DepthMask(disp, parameters) (*((disp)->DepthMask)) parameters +#define GET_DepthMask(disp) ((disp)->DepthMask) +#define SET_DepthMask(disp, fn) ((disp)->DepthMask = fn) +#define CALL_IndexMask(disp, parameters) (*((disp)->IndexMask)) parameters +#define GET_IndexMask(disp) ((disp)->IndexMask) +#define SET_IndexMask(disp, fn) ((disp)->IndexMask = fn) +#define CALL_Accum(disp, parameters) (*((disp)->Accum)) parameters +#define GET_Accum(disp) ((disp)->Accum) +#define SET_Accum(disp, fn) ((disp)->Accum = fn) +#define CALL_Disable(disp, parameters) (*((disp)->Disable)) parameters +#define GET_Disable(disp) ((disp)->Disable) +#define SET_Disable(disp, fn) ((disp)->Disable = fn) +#define CALL_Enable(disp, parameters) (*((disp)->Enable)) parameters +#define GET_Enable(disp) ((disp)->Enable) +#define SET_Enable(disp, fn) ((disp)->Enable = fn) +#define CALL_Finish(disp, parameters) (*((disp)->Finish)) parameters +#define GET_Finish(disp) ((disp)->Finish) +#define SET_Finish(disp, fn) ((disp)->Finish = fn) +#define CALL_Flush(disp, parameters) (*((disp)->Flush)) parameters +#define GET_Flush(disp) ((disp)->Flush) +#define SET_Flush(disp, fn) ((disp)->Flush = fn) +#define CALL_PopAttrib(disp, parameters) (*((disp)->PopAttrib)) parameters +#define GET_PopAttrib(disp) ((disp)->PopAttrib) +#define SET_PopAttrib(disp, fn) ((disp)->PopAttrib = fn) +#define CALL_PushAttrib(disp, parameters) (*((disp)->PushAttrib)) parameters +#define GET_PushAttrib(disp) ((disp)->PushAttrib) +#define SET_PushAttrib(disp, fn) ((disp)->PushAttrib = fn) +#define CALL_Map1d(disp, parameters) (*((disp)->Map1d)) parameters +#define GET_Map1d(disp) ((disp)->Map1d) +#define SET_Map1d(disp, fn) ((disp)->Map1d = fn) +#define CALL_Map1f(disp, parameters) (*((disp)->Map1f)) parameters +#define GET_Map1f(disp) ((disp)->Map1f) +#define SET_Map1f(disp, fn) ((disp)->Map1f = fn) +#define CALL_Map2d(disp, parameters) (*((disp)->Map2d)) parameters +#define GET_Map2d(disp) ((disp)->Map2d) +#define SET_Map2d(disp, fn) ((disp)->Map2d = fn) +#define CALL_Map2f(disp, parameters) (*((disp)->Map2f)) parameters +#define GET_Map2f(disp) ((disp)->Map2f) +#define SET_Map2f(disp, fn) ((disp)->Map2f = fn) +#define CALL_MapGrid1d(disp, parameters) (*((disp)->MapGrid1d)) parameters +#define GET_MapGrid1d(disp) ((disp)->MapGrid1d) +#define SET_MapGrid1d(disp, fn) ((disp)->MapGrid1d = fn) +#define CALL_MapGrid1f(disp, parameters) (*((disp)->MapGrid1f)) parameters +#define GET_MapGrid1f(disp) ((disp)->MapGrid1f) +#define SET_MapGrid1f(disp, fn) ((disp)->MapGrid1f = fn) +#define CALL_MapGrid2d(disp, parameters) (*((disp)->MapGrid2d)) parameters +#define GET_MapGrid2d(disp) ((disp)->MapGrid2d) +#define SET_MapGrid2d(disp, fn) ((disp)->MapGrid2d = fn) +#define CALL_MapGrid2f(disp, parameters) (*((disp)->MapGrid2f)) parameters +#define GET_MapGrid2f(disp) ((disp)->MapGrid2f) +#define SET_MapGrid2f(disp, fn) ((disp)->MapGrid2f = fn) +#define CALL_EvalCoord1d(disp, parameters) (*((disp)->EvalCoord1d)) parameters +#define GET_EvalCoord1d(disp) ((disp)->EvalCoord1d) +#define SET_EvalCoord1d(disp, fn) ((disp)->EvalCoord1d = fn) +#define CALL_EvalCoord1dv(disp, parameters) (*((disp)->EvalCoord1dv)) parameters +#define GET_EvalCoord1dv(disp) ((disp)->EvalCoord1dv) +#define SET_EvalCoord1dv(disp, fn) ((disp)->EvalCoord1dv = fn) +#define CALL_EvalCoord1f(disp, parameters) (*((disp)->EvalCoord1f)) parameters +#define GET_EvalCoord1f(disp) ((disp)->EvalCoord1f) +#define SET_EvalCoord1f(disp, fn) ((disp)->EvalCoord1f = fn) +#define CALL_EvalCoord1fv(disp, parameters) (*((disp)->EvalCoord1fv)) parameters +#define GET_EvalCoord1fv(disp) ((disp)->EvalCoord1fv) +#define SET_EvalCoord1fv(disp, fn) ((disp)->EvalCoord1fv = fn) +#define CALL_EvalCoord2d(disp, parameters) (*((disp)->EvalCoord2d)) parameters +#define GET_EvalCoord2d(disp) ((disp)->EvalCoord2d) +#define SET_EvalCoord2d(disp, fn) ((disp)->EvalCoord2d = fn) +#define CALL_EvalCoord2dv(disp, parameters) (*((disp)->EvalCoord2dv)) parameters +#define GET_EvalCoord2dv(disp) ((disp)->EvalCoord2dv) +#define SET_EvalCoord2dv(disp, fn) ((disp)->EvalCoord2dv = fn) +#define CALL_EvalCoord2f(disp, parameters) (*((disp)->EvalCoord2f)) parameters +#define GET_EvalCoord2f(disp) ((disp)->EvalCoord2f) +#define SET_EvalCoord2f(disp, fn) ((disp)->EvalCoord2f = fn) +#define CALL_EvalCoord2fv(disp, parameters) (*((disp)->EvalCoord2fv)) parameters +#define GET_EvalCoord2fv(disp) ((disp)->EvalCoord2fv) +#define SET_EvalCoord2fv(disp, fn) ((disp)->EvalCoord2fv = fn) +#define CALL_EvalMesh1(disp, parameters) (*((disp)->EvalMesh1)) parameters +#define GET_EvalMesh1(disp) ((disp)->EvalMesh1) +#define SET_EvalMesh1(disp, fn) ((disp)->EvalMesh1 = fn) +#define CALL_EvalPoint1(disp, parameters) (*((disp)->EvalPoint1)) parameters +#define GET_EvalPoint1(disp) ((disp)->EvalPoint1) +#define SET_EvalPoint1(disp, fn) ((disp)->EvalPoint1 = fn) +#define CALL_EvalMesh2(disp, parameters) (*((disp)->EvalMesh2)) parameters +#define GET_EvalMesh2(disp) ((disp)->EvalMesh2) +#define SET_EvalMesh2(disp, fn) ((disp)->EvalMesh2 = fn) +#define CALL_EvalPoint2(disp, parameters) (*((disp)->EvalPoint2)) parameters +#define GET_EvalPoint2(disp) ((disp)->EvalPoint2) +#define SET_EvalPoint2(disp, fn) ((disp)->EvalPoint2 = fn) +#define CALL_AlphaFunc(disp, parameters) (*((disp)->AlphaFunc)) parameters +#define GET_AlphaFunc(disp) ((disp)->AlphaFunc) +#define SET_AlphaFunc(disp, fn) ((disp)->AlphaFunc = fn) +#define CALL_BlendFunc(disp, parameters) (*((disp)->BlendFunc)) parameters +#define GET_BlendFunc(disp) ((disp)->BlendFunc) +#define SET_BlendFunc(disp, fn) ((disp)->BlendFunc = fn) +#define CALL_LogicOp(disp, parameters) (*((disp)->LogicOp)) parameters +#define GET_LogicOp(disp) ((disp)->LogicOp) +#define SET_LogicOp(disp, fn) ((disp)->LogicOp = fn) +#define CALL_StencilFunc(disp, parameters) (*((disp)->StencilFunc)) parameters +#define GET_StencilFunc(disp) ((disp)->StencilFunc) +#define SET_StencilFunc(disp, fn) ((disp)->StencilFunc = fn) +#define CALL_StencilOp(disp, parameters) (*((disp)->StencilOp)) parameters +#define GET_StencilOp(disp) ((disp)->StencilOp) +#define SET_StencilOp(disp, fn) ((disp)->StencilOp = fn) +#define CALL_DepthFunc(disp, parameters) (*((disp)->DepthFunc)) parameters +#define GET_DepthFunc(disp) ((disp)->DepthFunc) +#define SET_DepthFunc(disp, fn) ((disp)->DepthFunc = fn) +#define CALL_PixelZoom(disp, parameters) (*((disp)->PixelZoom)) parameters +#define GET_PixelZoom(disp) ((disp)->PixelZoom) +#define SET_PixelZoom(disp, fn) ((disp)->PixelZoom = fn) +#define CALL_PixelTransferf(disp, parameters) (*((disp)->PixelTransferf)) parameters +#define GET_PixelTransferf(disp) ((disp)->PixelTransferf) +#define SET_PixelTransferf(disp, fn) ((disp)->PixelTransferf = fn) +#define CALL_PixelTransferi(disp, parameters) (*((disp)->PixelTransferi)) parameters +#define GET_PixelTransferi(disp) ((disp)->PixelTransferi) +#define SET_PixelTransferi(disp, fn) ((disp)->PixelTransferi = fn) +#define CALL_PixelStoref(disp, parameters) (*((disp)->PixelStoref)) parameters +#define GET_PixelStoref(disp) ((disp)->PixelStoref) +#define SET_PixelStoref(disp, fn) ((disp)->PixelStoref = fn) +#define CALL_PixelStorei(disp, parameters) (*((disp)->PixelStorei)) parameters +#define GET_PixelStorei(disp) ((disp)->PixelStorei) +#define SET_PixelStorei(disp, fn) ((disp)->PixelStorei = fn) +#define CALL_PixelMapfv(disp, parameters) (*((disp)->PixelMapfv)) parameters +#define GET_PixelMapfv(disp) ((disp)->PixelMapfv) +#define SET_PixelMapfv(disp, fn) ((disp)->PixelMapfv = fn) +#define CALL_PixelMapuiv(disp, parameters) (*((disp)->PixelMapuiv)) parameters +#define GET_PixelMapuiv(disp) ((disp)->PixelMapuiv) +#define SET_PixelMapuiv(disp, fn) ((disp)->PixelMapuiv = fn) +#define CALL_PixelMapusv(disp, parameters) (*((disp)->PixelMapusv)) parameters +#define GET_PixelMapusv(disp) ((disp)->PixelMapusv) +#define SET_PixelMapusv(disp, fn) ((disp)->PixelMapusv = fn) +#define CALL_ReadBuffer(disp, parameters) (*((disp)->ReadBuffer)) parameters +#define GET_ReadBuffer(disp) ((disp)->ReadBuffer) +#define SET_ReadBuffer(disp, fn) ((disp)->ReadBuffer = fn) +#define CALL_CopyPixels(disp, parameters) (*((disp)->CopyPixels)) parameters +#define GET_CopyPixels(disp) ((disp)->CopyPixels) +#define SET_CopyPixels(disp, fn) ((disp)->CopyPixels = fn) +#define CALL_ReadPixels(disp, parameters) (*((disp)->ReadPixels)) parameters +#define GET_ReadPixels(disp) ((disp)->ReadPixels) +#define SET_ReadPixels(disp, fn) ((disp)->ReadPixels = fn) +#define CALL_DrawPixels(disp, parameters) (*((disp)->DrawPixels)) parameters +#define GET_DrawPixels(disp) ((disp)->DrawPixels) +#define SET_DrawPixels(disp, fn) ((disp)->DrawPixels = fn) +#define CALL_GetBooleanv(disp, parameters) (*((disp)->GetBooleanv)) parameters +#define GET_GetBooleanv(disp) ((disp)->GetBooleanv) +#define SET_GetBooleanv(disp, fn) ((disp)->GetBooleanv = fn) +#define CALL_GetClipPlane(disp, parameters) (*((disp)->GetClipPlane)) parameters +#define GET_GetClipPlane(disp) ((disp)->GetClipPlane) +#define SET_GetClipPlane(disp, fn) ((disp)->GetClipPlane = fn) +#define CALL_GetDoublev(disp, parameters) (*((disp)->GetDoublev)) parameters +#define GET_GetDoublev(disp) ((disp)->GetDoublev) +#define SET_GetDoublev(disp, fn) ((disp)->GetDoublev = fn) +#define CALL_GetError(disp, parameters) (*((disp)->GetError)) parameters +#define GET_GetError(disp) ((disp)->GetError) +#define SET_GetError(disp, fn) ((disp)->GetError = fn) +#define CALL_GetFloatv(disp, parameters) (*((disp)->GetFloatv)) parameters +#define GET_GetFloatv(disp) ((disp)->GetFloatv) +#define SET_GetFloatv(disp, fn) ((disp)->GetFloatv = fn) +#define CALL_GetIntegerv(disp, parameters) (*((disp)->GetIntegerv)) parameters +#define GET_GetIntegerv(disp) ((disp)->GetIntegerv) +#define SET_GetIntegerv(disp, fn) ((disp)->GetIntegerv = fn) +#define CALL_GetLightfv(disp, parameters) (*((disp)->GetLightfv)) parameters +#define GET_GetLightfv(disp) ((disp)->GetLightfv) +#define SET_GetLightfv(disp, fn) ((disp)->GetLightfv = fn) +#define CALL_GetLightiv(disp, parameters) (*((disp)->GetLightiv)) parameters +#define GET_GetLightiv(disp) ((disp)->GetLightiv) +#define SET_GetLightiv(disp, fn) ((disp)->GetLightiv = fn) +#define CALL_GetMapdv(disp, parameters) (*((disp)->GetMapdv)) parameters +#define GET_GetMapdv(disp) ((disp)->GetMapdv) +#define SET_GetMapdv(disp, fn) ((disp)->GetMapdv = fn) +#define CALL_GetMapfv(disp, parameters) (*((disp)->GetMapfv)) parameters +#define GET_GetMapfv(disp) ((disp)->GetMapfv) +#define SET_GetMapfv(disp, fn) ((disp)->GetMapfv = fn) +#define CALL_GetMapiv(disp, parameters) (*((disp)->GetMapiv)) parameters +#define GET_GetMapiv(disp) ((disp)->GetMapiv) +#define SET_GetMapiv(disp, fn) ((disp)->GetMapiv = fn) +#define CALL_GetMaterialfv(disp, parameters) (*((disp)->GetMaterialfv)) parameters +#define GET_GetMaterialfv(disp) ((disp)->GetMaterialfv) +#define SET_GetMaterialfv(disp, fn) ((disp)->GetMaterialfv = fn) +#define CALL_GetMaterialiv(disp, parameters) (*((disp)->GetMaterialiv)) parameters +#define GET_GetMaterialiv(disp) ((disp)->GetMaterialiv) +#define SET_GetMaterialiv(disp, fn) ((disp)->GetMaterialiv = fn) +#define CALL_GetPixelMapfv(disp, parameters) (*((disp)->GetPixelMapfv)) parameters +#define GET_GetPixelMapfv(disp) ((disp)->GetPixelMapfv) +#define SET_GetPixelMapfv(disp, fn) ((disp)->GetPixelMapfv = fn) +#define CALL_GetPixelMapuiv(disp, parameters) (*((disp)->GetPixelMapuiv)) parameters +#define GET_GetPixelMapuiv(disp) ((disp)->GetPixelMapuiv) +#define SET_GetPixelMapuiv(disp, fn) ((disp)->GetPixelMapuiv = fn) +#define CALL_GetPixelMapusv(disp, parameters) (*((disp)->GetPixelMapusv)) parameters +#define GET_GetPixelMapusv(disp) ((disp)->GetPixelMapusv) +#define SET_GetPixelMapusv(disp, fn) ((disp)->GetPixelMapusv = fn) +#define CALL_GetPolygonStipple(disp, parameters) (*((disp)->GetPolygonStipple)) parameters +#define GET_GetPolygonStipple(disp) ((disp)->GetPolygonStipple) +#define SET_GetPolygonStipple(disp, fn) ((disp)->GetPolygonStipple = fn) +#define CALL_GetString(disp, parameters) (*((disp)->GetString)) parameters +#define GET_GetString(disp) ((disp)->GetString) +#define SET_GetString(disp, fn) ((disp)->GetString = fn) +#define CALL_GetTexEnvfv(disp, parameters) (*((disp)->GetTexEnvfv)) parameters +#define GET_GetTexEnvfv(disp) ((disp)->GetTexEnvfv) +#define SET_GetTexEnvfv(disp, fn) ((disp)->GetTexEnvfv = fn) +#define CALL_GetTexEnviv(disp, parameters) (*((disp)->GetTexEnviv)) parameters +#define GET_GetTexEnviv(disp) ((disp)->GetTexEnviv) +#define SET_GetTexEnviv(disp, fn) ((disp)->GetTexEnviv = fn) +#define CALL_GetTexGendv(disp, parameters) (*((disp)->GetTexGendv)) parameters +#define GET_GetTexGendv(disp) ((disp)->GetTexGendv) +#define SET_GetTexGendv(disp, fn) ((disp)->GetTexGendv = fn) +#define CALL_GetTexGenfv(disp, parameters) (*((disp)->GetTexGenfv)) parameters +#define GET_GetTexGenfv(disp) ((disp)->GetTexGenfv) +#define SET_GetTexGenfv(disp, fn) ((disp)->GetTexGenfv = fn) +#define CALL_GetTexGeniv(disp, parameters) (*((disp)->GetTexGeniv)) parameters +#define GET_GetTexGeniv(disp) ((disp)->GetTexGeniv) +#define SET_GetTexGeniv(disp, fn) ((disp)->GetTexGeniv = fn) +#define CALL_GetTexImage(disp, parameters) (*((disp)->GetTexImage)) parameters +#define GET_GetTexImage(disp) ((disp)->GetTexImage) +#define SET_GetTexImage(disp, fn) ((disp)->GetTexImage = fn) +#define CALL_GetTexParameterfv(disp, parameters) (*((disp)->GetTexParameterfv)) parameters +#define GET_GetTexParameterfv(disp) ((disp)->GetTexParameterfv) +#define SET_GetTexParameterfv(disp, fn) ((disp)->GetTexParameterfv = fn) +#define CALL_GetTexParameteriv(disp, parameters) (*((disp)->GetTexParameteriv)) parameters +#define GET_GetTexParameteriv(disp) ((disp)->GetTexParameteriv) +#define SET_GetTexParameteriv(disp, fn) ((disp)->GetTexParameteriv = fn) +#define CALL_GetTexLevelParameterfv(disp, parameters) (*((disp)->GetTexLevelParameterfv)) parameters +#define GET_GetTexLevelParameterfv(disp) ((disp)->GetTexLevelParameterfv) +#define SET_GetTexLevelParameterfv(disp, fn) ((disp)->GetTexLevelParameterfv = fn) +#define CALL_GetTexLevelParameteriv(disp, parameters) (*((disp)->GetTexLevelParameteriv)) parameters +#define GET_GetTexLevelParameteriv(disp) ((disp)->GetTexLevelParameteriv) +#define SET_GetTexLevelParameteriv(disp, fn) ((disp)->GetTexLevelParameteriv = fn) +#define CALL_IsEnabled(disp, parameters) (*((disp)->IsEnabled)) parameters +#define GET_IsEnabled(disp) ((disp)->IsEnabled) +#define SET_IsEnabled(disp, fn) ((disp)->IsEnabled = fn) +#define CALL_IsList(disp, parameters) (*((disp)->IsList)) parameters +#define GET_IsList(disp) ((disp)->IsList) +#define SET_IsList(disp, fn) ((disp)->IsList = fn) +#define CALL_DepthRange(disp, parameters) (*((disp)->DepthRange)) parameters +#define GET_DepthRange(disp) ((disp)->DepthRange) +#define SET_DepthRange(disp, fn) ((disp)->DepthRange = fn) +#define CALL_Frustum(disp, parameters) (*((disp)->Frustum)) parameters +#define GET_Frustum(disp) ((disp)->Frustum) +#define SET_Frustum(disp, fn) ((disp)->Frustum = fn) +#define CALL_LoadIdentity(disp, parameters) (*((disp)->LoadIdentity)) parameters +#define GET_LoadIdentity(disp) ((disp)->LoadIdentity) +#define SET_LoadIdentity(disp, fn) ((disp)->LoadIdentity = fn) +#define CALL_LoadMatrixf(disp, parameters) (*((disp)->LoadMatrixf)) parameters +#define GET_LoadMatrixf(disp) ((disp)->LoadMatrixf) +#define SET_LoadMatrixf(disp, fn) ((disp)->LoadMatrixf = fn) +#define CALL_LoadMatrixd(disp, parameters) (*((disp)->LoadMatrixd)) parameters +#define GET_LoadMatrixd(disp) ((disp)->LoadMatrixd) +#define SET_LoadMatrixd(disp, fn) ((disp)->LoadMatrixd = fn) +#define CALL_MatrixMode(disp, parameters) (*((disp)->MatrixMode)) parameters +#define GET_MatrixMode(disp) ((disp)->MatrixMode) +#define SET_MatrixMode(disp, fn) ((disp)->MatrixMode = fn) +#define CALL_MultMatrixf(disp, parameters) (*((disp)->MultMatrixf)) parameters +#define GET_MultMatrixf(disp) ((disp)->MultMatrixf) +#define SET_MultMatrixf(disp, fn) ((disp)->MultMatrixf = fn) +#define CALL_MultMatrixd(disp, parameters) (*((disp)->MultMatrixd)) parameters +#define GET_MultMatrixd(disp) ((disp)->MultMatrixd) +#define SET_MultMatrixd(disp, fn) ((disp)->MultMatrixd = fn) +#define CALL_Ortho(disp, parameters) (*((disp)->Ortho)) parameters +#define GET_Ortho(disp) ((disp)->Ortho) +#define SET_Ortho(disp, fn) ((disp)->Ortho = fn) +#define CALL_PopMatrix(disp, parameters) (*((disp)->PopMatrix)) parameters +#define GET_PopMatrix(disp) ((disp)->PopMatrix) +#define SET_PopMatrix(disp, fn) ((disp)->PopMatrix = fn) +#define CALL_PushMatrix(disp, parameters) (*((disp)->PushMatrix)) parameters +#define GET_PushMatrix(disp) ((disp)->PushMatrix) +#define SET_PushMatrix(disp, fn) ((disp)->PushMatrix = fn) +#define CALL_Rotated(disp, parameters) (*((disp)->Rotated)) parameters +#define GET_Rotated(disp) ((disp)->Rotated) +#define SET_Rotated(disp, fn) ((disp)->Rotated = fn) +#define CALL_Rotatef(disp, parameters) (*((disp)->Rotatef)) parameters +#define GET_Rotatef(disp) ((disp)->Rotatef) +#define SET_Rotatef(disp, fn) ((disp)->Rotatef = fn) +#define CALL_Scaled(disp, parameters) (*((disp)->Scaled)) parameters +#define GET_Scaled(disp) ((disp)->Scaled) +#define SET_Scaled(disp, fn) ((disp)->Scaled = fn) +#define CALL_Scalef(disp, parameters) (*((disp)->Scalef)) parameters +#define GET_Scalef(disp) ((disp)->Scalef) +#define SET_Scalef(disp, fn) ((disp)->Scalef = fn) +#define CALL_Translated(disp, parameters) (*((disp)->Translated)) parameters +#define GET_Translated(disp) ((disp)->Translated) +#define SET_Translated(disp, fn) ((disp)->Translated = fn) +#define CALL_Translatef(disp, parameters) (*((disp)->Translatef)) parameters +#define GET_Translatef(disp) ((disp)->Translatef) +#define SET_Translatef(disp, fn) ((disp)->Translatef = fn) +#define CALL_Viewport(disp, parameters) (*((disp)->Viewport)) parameters +#define GET_Viewport(disp) ((disp)->Viewport) +#define SET_Viewport(disp, fn) ((disp)->Viewport = fn) +#define CALL_ArrayElement(disp, parameters) (*((disp)->ArrayElement)) parameters +#define GET_ArrayElement(disp) ((disp)->ArrayElement) +#define SET_ArrayElement(disp, fn) ((disp)->ArrayElement = fn) +#define CALL_BindTexture(disp, parameters) (*((disp)->BindTexture)) parameters +#define GET_BindTexture(disp) ((disp)->BindTexture) +#define SET_BindTexture(disp, fn) ((disp)->BindTexture = fn) +#define CALL_ColorPointer(disp, parameters) (*((disp)->ColorPointer)) parameters +#define GET_ColorPointer(disp) ((disp)->ColorPointer) +#define SET_ColorPointer(disp, fn) ((disp)->ColorPointer = fn) +#define CALL_DisableClientState(disp, parameters) (*((disp)->DisableClientState)) parameters +#define GET_DisableClientState(disp) ((disp)->DisableClientState) +#define SET_DisableClientState(disp, fn) ((disp)->DisableClientState = fn) +#define CALL_DrawArrays(disp, parameters) (*((disp)->DrawArrays)) parameters +#define GET_DrawArrays(disp) ((disp)->DrawArrays) +#define SET_DrawArrays(disp, fn) ((disp)->DrawArrays = fn) +#define CALL_DrawElements(disp, parameters) (*((disp)->DrawElements)) parameters +#define GET_DrawElements(disp) ((disp)->DrawElements) +#define SET_DrawElements(disp, fn) ((disp)->DrawElements = fn) +#define CALL_EdgeFlagPointer(disp, parameters) (*((disp)->EdgeFlagPointer)) parameters +#define GET_EdgeFlagPointer(disp) ((disp)->EdgeFlagPointer) +#define SET_EdgeFlagPointer(disp, fn) ((disp)->EdgeFlagPointer = fn) +#define CALL_EnableClientState(disp, parameters) (*((disp)->EnableClientState)) parameters +#define GET_EnableClientState(disp) ((disp)->EnableClientState) +#define SET_EnableClientState(disp, fn) ((disp)->EnableClientState = fn) +#define CALL_IndexPointer(disp, parameters) (*((disp)->IndexPointer)) parameters +#define GET_IndexPointer(disp) ((disp)->IndexPointer) +#define SET_IndexPointer(disp, fn) ((disp)->IndexPointer = fn) +#define CALL_Indexub(disp, parameters) (*((disp)->Indexub)) parameters +#define GET_Indexub(disp) ((disp)->Indexub) +#define SET_Indexub(disp, fn) ((disp)->Indexub = fn) +#define CALL_Indexubv(disp, parameters) (*((disp)->Indexubv)) parameters +#define GET_Indexubv(disp) ((disp)->Indexubv) +#define SET_Indexubv(disp, fn) ((disp)->Indexubv = fn) +#define CALL_InterleavedArrays(disp, parameters) (*((disp)->InterleavedArrays)) parameters +#define GET_InterleavedArrays(disp) ((disp)->InterleavedArrays) +#define SET_InterleavedArrays(disp, fn) ((disp)->InterleavedArrays = fn) +#define CALL_NormalPointer(disp, parameters) (*((disp)->NormalPointer)) parameters +#define GET_NormalPointer(disp) ((disp)->NormalPointer) +#define SET_NormalPointer(disp, fn) ((disp)->NormalPointer = fn) +#define CALL_PolygonOffset(disp, parameters) (*((disp)->PolygonOffset)) parameters +#define GET_PolygonOffset(disp) ((disp)->PolygonOffset) +#define SET_PolygonOffset(disp, fn) ((disp)->PolygonOffset = fn) +#define CALL_TexCoordPointer(disp, parameters) (*((disp)->TexCoordPointer)) parameters +#define GET_TexCoordPointer(disp) ((disp)->TexCoordPointer) +#define SET_TexCoordPointer(disp, fn) ((disp)->TexCoordPointer = fn) +#define CALL_VertexPointer(disp, parameters) (*((disp)->VertexPointer)) parameters +#define GET_VertexPointer(disp) ((disp)->VertexPointer) +#define SET_VertexPointer(disp, fn) ((disp)->VertexPointer = fn) +#define CALL_AreTexturesResident(disp, parameters) (*((disp)->AreTexturesResident)) parameters +#define GET_AreTexturesResident(disp) ((disp)->AreTexturesResident) +#define SET_AreTexturesResident(disp, fn) ((disp)->AreTexturesResident = fn) +#define CALL_CopyTexImage1D(disp, parameters) (*((disp)->CopyTexImage1D)) parameters +#define GET_CopyTexImage1D(disp) ((disp)->CopyTexImage1D) +#define SET_CopyTexImage1D(disp, fn) ((disp)->CopyTexImage1D = fn) +#define CALL_CopyTexImage2D(disp, parameters) (*((disp)->CopyTexImage2D)) parameters +#define GET_CopyTexImage2D(disp) ((disp)->CopyTexImage2D) +#define SET_CopyTexImage2D(disp, fn) ((disp)->CopyTexImage2D = fn) +#define CALL_CopyTexSubImage1D(disp, parameters) (*((disp)->CopyTexSubImage1D)) parameters +#define GET_CopyTexSubImage1D(disp) ((disp)->CopyTexSubImage1D) +#define SET_CopyTexSubImage1D(disp, fn) ((disp)->CopyTexSubImage1D = fn) +#define CALL_CopyTexSubImage2D(disp, parameters) (*((disp)->CopyTexSubImage2D)) parameters +#define GET_CopyTexSubImage2D(disp) ((disp)->CopyTexSubImage2D) +#define SET_CopyTexSubImage2D(disp, fn) ((disp)->CopyTexSubImage2D = fn) +#define CALL_DeleteTextures(disp, parameters) (*((disp)->DeleteTextures)) parameters +#define GET_DeleteTextures(disp) ((disp)->DeleteTextures) +#define SET_DeleteTextures(disp, fn) ((disp)->DeleteTextures = fn) +#define CALL_GenTextures(disp, parameters) (*((disp)->GenTextures)) parameters +#define GET_GenTextures(disp) ((disp)->GenTextures) +#define SET_GenTextures(disp, fn) ((disp)->GenTextures = fn) +#define CALL_GetPointerv(disp, parameters) (*((disp)->GetPointerv)) parameters +#define GET_GetPointerv(disp) ((disp)->GetPointerv) +#define SET_GetPointerv(disp, fn) ((disp)->GetPointerv = fn) +#define CALL_IsTexture(disp, parameters) (*((disp)->IsTexture)) parameters +#define GET_IsTexture(disp) ((disp)->IsTexture) +#define SET_IsTexture(disp, fn) ((disp)->IsTexture = fn) +#define CALL_PrioritizeTextures(disp, parameters) (*((disp)->PrioritizeTextures)) parameters +#define GET_PrioritizeTextures(disp) ((disp)->PrioritizeTextures) +#define SET_PrioritizeTextures(disp, fn) ((disp)->PrioritizeTextures = fn) +#define CALL_TexSubImage1D(disp, parameters) (*((disp)->TexSubImage1D)) parameters +#define GET_TexSubImage1D(disp) ((disp)->TexSubImage1D) +#define SET_TexSubImage1D(disp, fn) ((disp)->TexSubImage1D = fn) +#define CALL_TexSubImage2D(disp, parameters) (*((disp)->TexSubImage2D)) parameters +#define GET_TexSubImage2D(disp) ((disp)->TexSubImage2D) +#define SET_TexSubImage2D(disp, fn) ((disp)->TexSubImage2D = fn) +#define CALL_PopClientAttrib(disp, parameters) (*((disp)->PopClientAttrib)) parameters +#define GET_PopClientAttrib(disp) ((disp)->PopClientAttrib) +#define SET_PopClientAttrib(disp, fn) ((disp)->PopClientAttrib = fn) +#define CALL_PushClientAttrib(disp, parameters) (*((disp)->PushClientAttrib)) parameters +#define GET_PushClientAttrib(disp) ((disp)->PushClientAttrib) +#define SET_PushClientAttrib(disp, fn) ((disp)->PushClientAttrib = fn) +#define CALL_BlendColor(disp, parameters) (*((disp)->BlendColor)) parameters +#define GET_BlendColor(disp) ((disp)->BlendColor) +#define SET_BlendColor(disp, fn) ((disp)->BlendColor = fn) +#define CALL_BlendEquation(disp, parameters) (*((disp)->BlendEquation)) parameters +#define GET_BlendEquation(disp) ((disp)->BlendEquation) +#define SET_BlendEquation(disp, fn) ((disp)->BlendEquation = fn) +#define CALL_DrawRangeElements(disp, parameters) (*((disp)->DrawRangeElements)) parameters +#define GET_DrawRangeElements(disp) ((disp)->DrawRangeElements) +#define SET_DrawRangeElements(disp, fn) ((disp)->DrawRangeElements = fn) +#define CALL_ColorTable(disp, parameters) (*((disp)->ColorTable)) parameters +#define GET_ColorTable(disp) ((disp)->ColorTable) +#define SET_ColorTable(disp, fn) ((disp)->ColorTable = fn) +#define CALL_ColorTableParameterfv(disp, parameters) (*((disp)->ColorTableParameterfv)) parameters +#define GET_ColorTableParameterfv(disp) ((disp)->ColorTableParameterfv) +#define SET_ColorTableParameterfv(disp, fn) ((disp)->ColorTableParameterfv = fn) +#define CALL_ColorTableParameteriv(disp, parameters) (*((disp)->ColorTableParameteriv)) parameters +#define GET_ColorTableParameteriv(disp) ((disp)->ColorTableParameteriv) +#define SET_ColorTableParameteriv(disp, fn) ((disp)->ColorTableParameteriv = fn) +#define CALL_CopyColorTable(disp, parameters) (*((disp)->CopyColorTable)) parameters +#define GET_CopyColorTable(disp) ((disp)->CopyColorTable) +#define SET_CopyColorTable(disp, fn) ((disp)->CopyColorTable = fn) +#define CALL_GetColorTable(disp, parameters) (*((disp)->GetColorTable)) parameters +#define GET_GetColorTable(disp) ((disp)->GetColorTable) +#define SET_GetColorTable(disp, fn) ((disp)->GetColorTable = fn) +#define CALL_GetColorTableParameterfv(disp, parameters) (*((disp)->GetColorTableParameterfv)) parameters +#define GET_GetColorTableParameterfv(disp) ((disp)->GetColorTableParameterfv) +#define SET_GetColorTableParameterfv(disp, fn) ((disp)->GetColorTableParameterfv = fn) +#define CALL_GetColorTableParameteriv(disp, parameters) (*((disp)->GetColorTableParameteriv)) parameters +#define GET_GetColorTableParameteriv(disp) ((disp)->GetColorTableParameteriv) +#define SET_GetColorTableParameteriv(disp, fn) ((disp)->GetColorTableParameteriv = fn) +#define CALL_ColorSubTable(disp, parameters) (*((disp)->ColorSubTable)) parameters +#define GET_ColorSubTable(disp) ((disp)->ColorSubTable) +#define SET_ColorSubTable(disp, fn) ((disp)->ColorSubTable = fn) +#define CALL_CopyColorSubTable(disp, parameters) (*((disp)->CopyColorSubTable)) parameters +#define GET_CopyColorSubTable(disp) ((disp)->CopyColorSubTable) +#define SET_CopyColorSubTable(disp, fn) ((disp)->CopyColorSubTable = fn) +#define CALL_ConvolutionFilter1D(disp, parameters) (*((disp)->ConvolutionFilter1D)) parameters +#define GET_ConvolutionFilter1D(disp) ((disp)->ConvolutionFilter1D) +#define SET_ConvolutionFilter1D(disp, fn) ((disp)->ConvolutionFilter1D = fn) +#define CALL_ConvolutionFilter2D(disp, parameters) (*((disp)->ConvolutionFilter2D)) parameters +#define GET_ConvolutionFilter2D(disp) ((disp)->ConvolutionFilter2D) +#define SET_ConvolutionFilter2D(disp, fn) ((disp)->ConvolutionFilter2D = fn) +#define CALL_ConvolutionParameterf(disp, parameters) (*((disp)->ConvolutionParameterf)) parameters +#define GET_ConvolutionParameterf(disp) ((disp)->ConvolutionParameterf) +#define SET_ConvolutionParameterf(disp, fn) ((disp)->ConvolutionParameterf = fn) +#define CALL_ConvolutionParameterfv(disp, parameters) (*((disp)->ConvolutionParameterfv)) parameters +#define GET_ConvolutionParameterfv(disp) ((disp)->ConvolutionParameterfv) +#define SET_ConvolutionParameterfv(disp, fn) ((disp)->ConvolutionParameterfv = fn) +#define CALL_ConvolutionParameteri(disp, parameters) (*((disp)->ConvolutionParameteri)) parameters +#define GET_ConvolutionParameteri(disp) ((disp)->ConvolutionParameteri) +#define SET_ConvolutionParameteri(disp, fn) ((disp)->ConvolutionParameteri = fn) +#define CALL_ConvolutionParameteriv(disp, parameters) (*((disp)->ConvolutionParameteriv)) parameters +#define GET_ConvolutionParameteriv(disp) ((disp)->ConvolutionParameteriv) +#define SET_ConvolutionParameteriv(disp, fn) ((disp)->ConvolutionParameteriv = fn) +#define CALL_CopyConvolutionFilter1D(disp, parameters) (*((disp)->CopyConvolutionFilter1D)) parameters +#define GET_CopyConvolutionFilter1D(disp) ((disp)->CopyConvolutionFilter1D) +#define SET_CopyConvolutionFilter1D(disp, fn) ((disp)->CopyConvolutionFilter1D = fn) +#define CALL_CopyConvolutionFilter2D(disp, parameters) (*((disp)->CopyConvolutionFilter2D)) parameters +#define GET_CopyConvolutionFilter2D(disp) ((disp)->CopyConvolutionFilter2D) +#define SET_CopyConvolutionFilter2D(disp, fn) ((disp)->CopyConvolutionFilter2D = fn) +#define CALL_GetConvolutionFilter(disp, parameters) (*((disp)->GetConvolutionFilter)) parameters +#define GET_GetConvolutionFilter(disp) ((disp)->GetConvolutionFilter) +#define SET_GetConvolutionFilter(disp, fn) ((disp)->GetConvolutionFilter = fn) +#define CALL_GetConvolutionParameterfv(disp, parameters) (*((disp)->GetConvolutionParameterfv)) parameters +#define GET_GetConvolutionParameterfv(disp) ((disp)->GetConvolutionParameterfv) +#define SET_GetConvolutionParameterfv(disp, fn) ((disp)->GetConvolutionParameterfv = fn) +#define CALL_GetConvolutionParameteriv(disp, parameters) (*((disp)->GetConvolutionParameteriv)) parameters +#define GET_GetConvolutionParameteriv(disp) ((disp)->GetConvolutionParameteriv) +#define SET_GetConvolutionParameteriv(disp, fn) ((disp)->GetConvolutionParameteriv = fn) +#define CALL_GetSeparableFilter(disp, parameters) (*((disp)->GetSeparableFilter)) parameters +#define GET_GetSeparableFilter(disp) ((disp)->GetSeparableFilter) +#define SET_GetSeparableFilter(disp, fn) ((disp)->GetSeparableFilter = fn) +#define CALL_SeparableFilter2D(disp, parameters) (*((disp)->SeparableFilter2D)) parameters +#define GET_SeparableFilter2D(disp) ((disp)->SeparableFilter2D) +#define SET_SeparableFilter2D(disp, fn) ((disp)->SeparableFilter2D = fn) +#define CALL_GetHistogram(disp, parameters) (*((disp)->GetHistogram)) parameters +#define GET_GetHistogram(disp) ((disp)->GetHistogram) +#define SET_GetHistogram(disp, fn) ((disp)->GetHistogram = fn) +#define CALL_GetHistogramParameterfv(disp, parameters) (*((disp)->GetHistogramParameterfv)) parameters +#define GET_GetHistogramParameterfv(disp) ((disp)->GetHistogramParameterfv) +#define SET_GetHistogramParameterfv(disp, fn) ((disp)->GetHistogramParameterfv = fn) +#define CALL_GetHistogramParameteriv(disp, parameters) (*((disp)->GetHistogramParameteriv)) parameters +#define GET_GetHistogramParameteriv(disp) ((disp)->GetHistogramParameteriv) +#define SET_GetHistogramParameteriv(disp, fn) ((disp)->GetHistogramParameteriv = fn) +#define CALL_GetMinmax(disp, parameters) (*((disp)->GetMinmax)) parameters +#define GET_GetMinmax(disp) ((disp)->GetMinmax) +#define SET_GetMinmax(disp, fn) ((disp)->GetMinmax = fn) +#define CALL_GetMinmaxParameterfv(disp, parameters) (*((disp)->GetMinmaxParameterfv)) parameters +#define GET_GetMinmaxParameterfv(disp) ((disp)->GetMinmaxParameterfv) +#define SET_GetMinmaxParameterfv(disp, fn) ((disp)->GetMinmaxParameterfv = fn) +#define CALL_GetMinmaxParameteriv(disp, parameters) (*((disp)->GetMinmaxParameteriv)) parameters +#define GET_GetMinmaxParameteriv(disp) ((disp)->GetMinmaxParameteriv) +#define SET_GetMinmaxParameteriv(disp, fn) ((disp)->GetMinmaxParameteriv = fn) +#define CALL_Histogram(disp, parameters) (*((disp)->Histogram)) parameters +#define GET_Histogram(disp) ((disp)->Histogram) +#define SET_Histogram(disp, fn) ((disp)->Histogram = fn) +#define CALL_Minmax(disp, parameters) (*((disp)->Minmax)) parameters +#define GET_Minmax(disp) ((disp)->Minmax) +#define SET_Minmax(disp, fn) ((disp)->Minmax = fn) +#define CALL_ResetHistogram(disp, parameters) (*((disp)->ResetHistogram)) parameters +#define GET_ResetHistogram(disp) ((disp)->ResetHistogram) +#define SET_ResetHistogram(disp, fn) ((disp)->ResetHistogram = fn) +#define CALL_ResetMinmax(disp, parameters) (*((disp)->ResetMinmax)) parameters +#define GET_ResetMinmax(disp) ((disp)->ResetMinmax) +#define SET_ResetMinmax(disp, fn) ((disp)->ResetMinmax = fn) +#define CALL_TexImage3D(disp, parameters) (*((disp)->TexImage3D)) parameters +#define GET_TexImage3D(disp) ((disp)->TexImage3D) +#define SET_TexImage3D(disp, fn) ((disp)->TexImage3D = fn) +#define CALL_TexSubImage3D(disp, parameters) (*((disp)->TexSubImage3D)) parameters +#define GET_TexSubImage3D(disp) ((disp)->TexSubImage3D) +#define SET_TexSubImage3D(disp, fn) ((disp)->TexSubImage3D = fn) +#define CALL_CopyTexSubImage3D(disp, parameters) (*((disp)->CopyTexSubImage3D)) parameters +#define GET_CopyTexSubImage3D(disp) ((disp)->CopyTexSubImage3D) +#define SET_CopyTexSubImage3D(disp, fn) ((disp)->CopyTexSubImage3D = fn) +#define CALL_ActiveTextureARB(disp, parameters) (*((disp)->ActiveTextureARB)) parameters +#define GET_ActiveTextureARB(disp) ((disp)->ActiveTextureARB) +#define SET_ActiveTextureARB(disp, fn) ((disp)->ActiveTextureARB = fn) +#define CALL_ClientActiveTextureARB(disp, parameters) (*((disp)->ClientActiveTextureARB)) parameters +#define GET_ClientActiveTextureARB(disp) ((disp)->ClientActiveTextureARB) +#define SET_ClientActiveTextureARB(disp, fn) ((disp)->ClientActiveTextureARB = fn) +#define CALL_MultiTexCoord1dARB(disp, parameters) (*((disp)->MultiTexCoord1dARB)) parameters +#define GET_MultiTexCoord1dARB(disp) ((disp)->MultiTexCoord1dARB) +#define SET_MultiTexCoord1dARB(disp, fn) ((disp)->MultiTexCoord1dARB = fn) +#define CALL_MultiTexCoord1dvARB(disp, parameters) (*((disp)->MultiTexCoord1dvARB)) parameters +#define GET_MultiTexCoord1dvARB(disp) ((disp)->MultiTexCoord1dvARB) +#define SET_MultiTexCoord1dvARB(disp, fn) ((disp)->MultiTexCoord1dvARB = fn) +#define CALL_MultiTexCoord1fARB(disp, parameters) (*((disp)->MultiTexCoord1fARB)) parameters +#define GET_MultiTexCoord1fARB(disp) ((disp)->MultiTexCoord1fARB) +#define SET_MultiTexCoord1fARB(disp, fn) ((disp)->MultiTexCoord1fARB = fn) +#define CALL_MultiTexCoord1fvARB(disp, parameters) (*((disp)->MultiTexCoord1fvARB)) parameters +#define GET_MultiTexCoord1fvARB(disp) ((disp)->MultiTexCoord1fvARB) +#define SET_MultiTexCoord1fvARB(disp, fn) ((disp)->MultiTexCoord1fvARB = fn) +#define CALL_MultiTexCoord1iARB(disp, parameters) (*((disp)->MultiTexCoord1iARB)) parameters +#define GET_MultiTexCoord1iARB(disp) ((disp)->MultiTexCoord1iARB) +#define SET_MultiTexCoord1iARB(disp, fn) ((disp)->MultiTexCoord1iARB = fn) +#define CALL_MultiTexCoord1ivARB(disp, parameters) (*((disp)->MultiTexCoord1ivARB)) parameters +#define GET_MultiTexCoord1ivARB(disp) ((disp)->MultiTexCoord1ivARB) +#define SET_MultiTexCoord1ivARB(disp, fn) ((disp)->MultiTexCoord1ivARB = fn) +#define CALL_MultiTexCoord1sARB(disp, parameters) (*((disp)->MultiTexCoord1sARB)) parameters +#define GET_MultiTexCoord1sARB(disp) ((disp)->MultiTexCoord1sARB) +#define SET_MultiTexCoord1sARB(disp, fn) ((disp)->MultiTexCoord1sARB = fn) +#define CALL_MultiTexCoord1svARB(disp, parameters) (*((disp)->MultiTexCoord1svARB)) parameters +#define GET_MultiTexCoord1svARB(disp) ((disp)->MultiTexCoord1svARB) +#define SET_MultiTexCoord1svARB(disp, fn) ((disp)->MultiTexCoord1svARB = fn) +#define CALL_MultiTexCoord2dARB(disp, parameters) (*((disp)->MultiTexCoord2dARB)) parameters +#define GET_MultiTexCoord2dARB(disp) ((disp)->MultiTexCoord2dARB) +#define SET_MultiTexCoord2dARB(disp, fn) ((disp)->MultiTexCoord2dARB = fn) +#define CALL_MultiTexCoord2dvARB(disp, parameters) (*((disp)->MultiTexCoord2dvARB)) parameters +#define GET_MultiTexCoord2dvARB(disp) ((disp)->MultiTexCoord2dvARB) +#define SET_MultiTexCoord2dvARB(disp, fn) ((disp)->MultiTexCoord2dvARB = fn) +#define CALL_MultiTexCoord2fARB(disp, parameters) (*((disp)->MultiTexCoord2fARB)) parameters +#define GET_MultiTexCoord2fARB(disp) ((disp)->MultiTexCoord2fARB) +#define SET_MultiTexCoord2fARB(disp, fn) ((disp)->MultiTexCoord2fARB = fn) +#define CALL_MultiTexCoord2fvARB(disp, parameters) (*((disp)->MultiTexCoord2fvARB)) parameters +#define GET_MultiTexCoord2fvARB(disp) ((disp)->MultiTexCoord2fvARB) +#define SET_MultiTexCoord2fvARB(disp, fn) ((disp)->MultiTexCoord2fvARB = fn) +#define CALL_MultiTexCoord2iARB(disp, parameters) (*((disp)->MultiTexCoord2iARB)) parameters +#define GET_MultiTexCoord2iARB(disp) ((disp)->MultiTexCoord2iARB) +#define SET_MultiTexCoord2iARB(disp, fn) ((disp)->MultiTexCoord2iARB = fn) +#define CALL_MultiTexCoord2ivARB(disp, parameters) (*((disp)->MultiTexCoord2ivARB)) parameters +#define GET_MultiTexCoord2ivARB(disp) ((disp)->MultiTexCoord2ivARB) +#define SET_MultiTexCoord2ivARB(disp, fn) ((disp)->MultiTexCoord2ivARB = fn) +#define CALL_MultiTexCoord2sARB(disp, parameters) (*((disp)->MultiTexCoord2sARB)) parameters +#define GET_MultiTexCoord2sARB(disp) ((disp)->MultiTexCoord2sARB) +#define SET_MultiTexCoord2sARB(disp, fn) ((disp)->MultiTexCoord2sARB = fn) +#define CALL_MultiTexCoord2svARB(disp, parameters) (*((disp)->MultiTexCoord2svARB)) parameters +#define GET_MultiTexCoord2svARB(disp) ((disp)->MultiTexCoord2svARB) +#define SET_MultiTexCoord2svARB(disp, fn) ((disp)->MultiTexCoord2svARB = fn) +#define CALL_MultiTexCoord3dARB(disp, parameters) (*((disp)->MultiTexCoord3dARB)) parameters +#define GET_MultiTexCoord3dARB(disp) ((disp)->MultiTexCoord3dARB) +#define SET_MultiTexCoord3dARB(disp, fn) ((disp)->MultiTexCoord3dARB = fn) +#define CALL_MultiTexCoord3dvARB(disp, parameters) (*((disp)->MultiTexCoord3dvARB)) parameters +#define GET_MultiTexCoord3dvARB(disp) ((disp)->MultiTexCoord3dvARB) +#define SET_MultiTexCoord3dvARB(disp, fn) ((disp)->MultiTexCoord3dvARB = fn) +#define CALL_MultiTexCoord3fARB(disp, parameters) (*((disp)->MultiTexCoord3fARB)) parameters +#define GET_MultiTexCoord3fARB(disp) ((disp)->MultiTexCoord3fARB) +#define SET_MultiTexCoord3fARB(disp, fn) ((disp)->MultiTexCoord3fARB = fn) +#define CALL_MultiTexCoord3fvARB(disp, parameters) (*((disp)->MultiTexCoord3fvARB)) parameters +#define GET_MultiTexCoord3fvARB(disp) ((disp)->MultiTexCoord3fvARB) +#define SET_MultiTexCoord3fvARB(disp, fn) ((disp)->MultiTexCoord3fvARB = fn) +#define CALL_MultiTexCoord3iARB(disp, parameters) (*((disp)->MultiTexCoord3iARB)) parameters +#define GET_MultiTexCoord3iARB(disp) ((disp)->MultiTexCoord3iARB) +#define SET_MultiTexCoord3iARB(disp, fn) ((disp)->MultiTexCoord3iARB = fn) +#define CALL_MultiTexCoord3ivARB(disp, parameters) (*((disp)->MultiTexCoord3ivARB)) parameters +#define GET_MultiTexCoord3ivARB(disp) ((disp)->MultiTexCoord3ivARB) +#define SET_MultiTexCoord3ivARB(disp, fn) ((disp)->MultiTexCoord3ivARB = fn) +#define CALL_MultiTexCoord3sARB(disp, parameters) (*((disp)->MultiTexCoord3sARB)) parameters +#define GET_MultiTexCoord3sARB(disp) ((disp)->MultiTexCoord3sARB) +#define SET_MultiTexCoord3sARB(disp, fn) ((disp)->MultiTexCoord3sARB = fn) +#define CALL_MultiTexCoord3svARB(disp, parameters) (*((disp)->MultiTexCoord3svARB)) parameters +#define GET_MultiTexCoord3svARB(disp) ((disp)->MultiTexCoord3svARB) +#define SET_MultiTexCoord3svARB(disp, fn) ((disp)->MultiTexCoord3svARB = fn) +#define CALL_MultiTexCoord4dARB(disp, parameters) (*((disp)->MultiTexCoord4dARB)) parameters +#define GET_MultiTexCoord4dARB(disp) ((disp)->MultiTexCoord4dARB) +#define SET_MultiTexCoord4dARB(disp, fn) ((disp)->MultiTexCoord4dARB = fn) +#define CALL_MultiTexCoord4dvARB(disp, parameters) (*((disp)->MultiTexCoord4dvARB)) parameters +#define GET_MultiTexCoord4dvARB(disp) ((disp)->MultiTexCoord4dvARB) +#define SET_MultiTexCoord4dvARB(disp, fn) ((disp)->MultiTexCoord4dvARB = fn) +#define CALL_MultiTexCoord4fARB(disp, parameters) (*((disp)->MultiTexCoord4fARB)) parameters +#define GET_MultiTexCoord4fARB(disp) ((disp)->MultiTexCoord4fARB) +#define SET_MultiTexCoord4fARB(disp, fn) ((disp)->MultiTexCoord4fARB = fn) +#define CALL_MultiTexCoord4fvARB(disp, parameters) (*((disp)->MultiTexCoord4fvARB)) parameters +#define GET_MultiTexCoord4fvARB(disp) ((disp)->MultiTexCoord4fvARB) +#define SET_MultiTexCoord4fvARB(disp, fn) ((disp)->MultiTexCoord4fvARB = fn) +#define CALL_MultiTexCoord4iARB(disp, parameters) (*((disp)->MultiTexCoord4iARB)) parameters +#define GET_MultiTexCoord4iARB(disp) ((disp)->MultiTexCoord4iARB) +#define SET_MultiTexCoord4iARB(disp, fn) ((disp)->MultiTexCoord4iARB = fn) +#define CALL_MultiTexCoord4ivARB(disp, parameters) (*((disp)->MultiTexCoord4ivARB)) parameters +#define GET_MultiTexCoord4ivARB(disp) ((disp)->MultiTexCoord4ivARB) +#define SET_MultiTexCoord4ivARB(disp, fn) ((disp)->MultiTexCoord4ivARB = fn) +#define CALL_MultiTexCoord4sARB(disp, parameters) (*((disp)->MultiTexCoord4sARB)) parameters +#define GET_MultiTexCoord4sARB(disp) ((disp)->MultiTexCoord4sARB) +#define SET_MultiTexCoord4sARB(disp, fn) ((disp)->MultiTexCoord4sARB = fn) +#define CALL_MultiTexCoord4svARB(disp, parameters) (*((disp)->MultiTexCoord4svARB)) parameters +#define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) +#define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) + +#if !defined(_GLAPI_USE_REMAP_TABLE) + +#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters +#define GET_AttachShader(disp) ((disp)->AttachShader) +#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn) +#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters +#define GET_CreateProgram(disp) ((disp)->CreateProgram) +#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn) +#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters +#define GET_CreateShader(disp) ((disp)->CreateShader) +#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn) +#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters +#define GET_DeleteProgram(disp) ((disp)->DeleteProgram) +#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn) +#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters +#define GET_DeleteShader(disp) ((disp)->DeleteShader) +#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn) +#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters +#define GET_DetachShader(disp) ((disp)->DetachShader) +#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn) +#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters +#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders) +#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn) +#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters +#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog) +#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn) +#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters +#define GET_GetProgramiv(disp) ((disp)->GetProgramiv) +#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn) +#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters +#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog) +#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn) +#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters +#define GET_GetShaderiv(disp) ((disp)->GetShaderiv) +#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn) +#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters +#define GET_IsProgram(disp) ((disp)->IsProgram) +#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn) +#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters +#define GET_IsShader(disp) ((disp)->IsShader) +#define SET_IsShader(disp, fn) ((disp)->IsShader = fn) +#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters +#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate) +#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn) +#define CALL_StencilMaskSeparate(disp, parameters) (*((disp)->StencilMaskSeparate)) parameters +#define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) +#define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) +#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters +#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate) +#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn) +#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters +#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv) +#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn) +#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters +#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv) +#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn) +#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters +#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv) +#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn) +#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters +#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv) +#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn) +#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters +#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv) +#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn) +#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters +#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv) +#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn) +#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters +#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB) +#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn) +#define CALL_LoadTransposeMatrixfARB(disp, parameters) (*((disp)->LoadTransposeMatrixfARB)) parameters +#define GET_LoadTransposeMatrixfARB(disp) ((disp)->LoadTransposeMatrixfARB) +#define SET_LoadTransposeMatrixfARB(disp, fn) ((disp)->LoadTransposeMatrixfARB = fn) +#define CALL_MultTransposeMatrixdARB(disp, parameters) (*((disp)->MultTransposeMatrixdARB)) parameters +#define GET_MultTransposeMatrixdARB(disp) ((disp)->MultTransposeMatrixdARB) +#define SET_MultTransposeMatrixdARB(disp, fn) ((disp)->MultTransposeMatrixdARB = fn) +#define CALL_MultTransposeMatrixfARB(disp, parameters) (*((disp)->MultTransposeMatrixfARB)) parameters +#define GET_MultTransposeMatrixfARB(disp) ((disp)->MultTransposeMatrixfARB) +#define SET_MultTransposeMatrixfARB(disp, fn) ((disp)->MultTransposeMatrixfARB = fn) +#define CALL_SampleCoverageARB(disp, parameters) (*((disp)->SampleCoverageARB)) parameters +#define GET_SampleCoverageARB(disp) ((disp)->SampleCoverageARB) +#define SET_SampleCoverageARB(disp, fn) ((disp)->SampleCoverageARB = fn) +#define CALL_CompressedTexImage1DARB(disp, parameters) (*((disp)->CompressedTexImage1DARB)) parameters +#define GET_CompressedTexImage1DARB(disp) ((disp)->CompressedTexImage1DARB) +#define SET_CompressedTexImage1DARB(disp, fn) ((disp)->CompressedTexImage1DARB = fn) +#define CALL_CompressedTexImage2DARB(disp, parameters) (*((disp)->CompressedTexImage2DARB)) parameters +#define GET_CompressedTexImage2DARB(disp) ((disp)->CompressedTexImage2DARB) +#define SET_CompressedTexImage2DARB(disp, fn) ((disp)->CompressedTexImage2DARB = fn) +#define CALL_CompressedTexImage3DARB(disp, parameters) (*((disp)->CompressedTexImage3DARB)) parameters +#define GET_CompressedTexImage3DARB(disp) ((disp)->CompressedTexImage3DARB) +#define SET_CompressedTexImage3DARB(disp, fn) ((disp)->CompressedTexImage3DARB = fn) +#define CALL_CompressedTexSubImage1DARB(disp, parameters) (*((disp)->CompressedTexSubImage1DARB)) parameters +#define GET_CompressedTexSubImage1DARB(disp) ((disp)->CompressedTexSubImage1DARB) +#define SET_CompressedTexSubImage1DARB(disp, fn) ((disp)->CompressedTexSubImage1DARB = fn) +#define CALL_CompressedTexSubImage2DARB(disp, parameters) (*((disp)->CompressedTexSubImage2DARB)) parameters +#define GET_CompressedTexSubImage2DARB(disp) ((disp)->CompressedTexSubImage2DARB) +#define SET_CompressedTexSubImage2DARB(disp, fn) ((disp)->CompressedTexSubImage2DARB = fn) +#define CALL_CompressedTexSubImage3DARB(disp, parameters) (*((disp)->CompressedTexSubImage3DARB)) parameters +#define GET_CompressedTexSubImage3DARB(disp) ((disp)->CompressedTexSubImage3DARB) +#define SET_CompressedTexSubImage3DARB(disp, fn) ((disp)->CompressedTexSubImage3DARB = fn) +#define CALL_GetCompressedTexImageARB(disp, parameters) (*((disp)->GetCompressedTexImageARB)) parameters +#define GET_GetCompressedTexImageARB(disp) ((disp)->GetCompressedTexImageARB) +#define SET_GetCompressedTexImageARB(disp, fn) ((disp)->GetCompressedTexImageARB = fn) +#define CALL_DisableVertexAttribArrayARB(disp, parameters) (*((disp)->DisableVertexAttribArrayARB)) parameters +#define GET_DisableVertexAttribArrayARB(disp) ((disp)->DisableVertexAttribArrayARB) +#define SET_DisableVertexAttribArrayARB(disp, fn) ((disp)->DisableVertexAttribArrayARB = fn) +#define CALL_EnableVertexAttribArrayARB(disp, parameters) (*((disp)->EnableVertexAttribArrayARB)) parameters +#define GET_EnableVertexAttribArrayARB(disp) ((disp)->EnableVertexAttribArrayARB) +#define SET_EnableVertexAttribArrayARB(disp, fn) ((disp)->EnableVertexAttribArrayARB = fn) +#define CALL_GetProgramEnvParameterdvARB(disp, parameters) (*((disp)->GetProgramEnvParameterdvARB)) parameters +#define GET_GetProgramEnvParameterdvARB(disp) ((disp)->GetProgramEnvParameterdvARB) +#define SET_GetProgramEnvParameterdvARB(disp, fn) ((disp)->GetProgramEnvParameterdvARB = fn) +#define CALL_GetProgramEnvParameterfvARB(disp, parameters) (*((disp)->GetProgramEnvParameterfvARB)) parameters +#define GET_GetProgramEnvParameterfvARB(disp) ((disp)->GetProgramEnvParameterfvARB) +#define SET_GetProgramEnvParameterfvARB(disp, fn) ((disp)->GetProgramEnvParameterfvARB = fn) +#define CALL_GetProgramLocalParameterdvARB(disp, parameters) (*((disp)->GetProgramLocalParameterdvARB)) parameters +#define GET_GetProgramLocalParameterdvARB(disp) ((disp)->GetProgramLocalParameterdvARB) +#define SET_GetProgramLocalParameterdvARB(disp, fn) ((disp)->GetProgramLocalParameterdvARB = fn) +#define CALL_GetProgramLocalParameterfvARB(disp, parameters) (*((disp)->GetProgramLocalParameterfvARB)) parameters +#define GET_GetProgramLocalParameterfvARB(disp) ((disp)->GetProgramLocalParameterfvARB) +#define SET_GetProgramLocalParameterfvARB(disp, fn) ((disp)->GetProgramLocalParameterfvARB = fn) +#define CALL_GetProgramStringARB(disp, parameters) (*((disp)->GetProgramStringARB)) parameters +#define GET_GetProgramStringARB(disp) ((disp)->GetProgramStringARB) +#define SET_GetProgramStringARB(disp, fn) ((disp)->GetProgramStringARB = fn) +#define CALL_GetProgramivARB(disp, parameters) (*((disp)->GetProgramivARB)) parameters +#define GET_GetProgramivARB(disp) ((disp)->GetProgramivARB) +#define SET_GetProgramivARB(disp, fn) ((disp)->GetProgramivARB = fn) +#define CALL_GetVertexAttribdvARB(disp, parameters) (*((disp)->GetVertexAttribdvARB)) parameters +#define GET_GetVertexAttribdvARB(disp) ((disp)->GetVertexAttribdvARB) +#define SET_GetVertexAttribdvARB(disp, fn) ((disp)->GetVertexAttribdvARB = fn) +#define CALL_GetVertexAttribfvARB(disp, parameters) (*((disp)->GetVertexAttribfvARB)) parameters +#define GET_GetVertexAttribfvARB(disp) ((disp)->GetVertexAttribfvARB) +#define SET_GetVertexAttribfvARB(disp, fn) ((disp)->GetVertexAttribfvARB = fn) +#define CALL_GetVertexAttribivARB(disp, parameters) (*((disp)->GetVertexAttribivARB)) parameters +#define GET_GetVertexAttribivARB(disp) ((disp)->GetVertexAttribivARB) +#define SET_GetVertexAttribivARB(disp, fn) ((disp)->GetVertexAttribivARB = fn) +#define CALL_ProgramEnvParameter4dARB(disp, parameters) (*((disp)->ProgramEnvParameter4dARB)) parameters +#define GET_ProgramEnvParameter4dARB(disp) ((disp)->ProgramEnvParameter4dARB) +#define SET_ProgramEnvParameter4dARB(disp, fn) ((disp)->ProgramEnvParameter4dARB = fn) +#define CALL_ProgramEnvParameter4dvARB(disp, parameters) (*((disp)->ProgramEnvParameter4dvARB)) parameters +#define GET_ProgramEnvParameter4dvARB(disp) ((disp)->ProgramEnvParameter4dvARB) +#define SET_ProgramEnvParameter4dvARB(disp, fn) ((disp)->ProgramEnvParameter4dvARB = fn) +#define CALL_ProgramEnvParameter4fARB(disp, parameters) (*((disp)->ProgramEnvParameter4fARB)) parameters +#define GET_ProgramEnvParameter4fARB(disp) ((disp)->ProgramEnvParameter4fARB) +#define SET_ProgramEnvParameter4fARB(disp, fn) ((disp)->ProgramEnvParameter4fARB = fn) +#define CALL_ProgramEnvParameter4fvARB(disp, parameters) (*((disp)->ProgramEnvParameter4fvARB)) parameters +#define GET_ProgramEnvParameter4fvARB(disp) ((disp)->ProgramEnvParameter4fvARB) +#define SET_ProgramEnvParameter4fvARB(disp, fn) ((disp)->ProgramEnvParameter4fvARB = fn) +#define CALL_ProgramLocalParameter4dARB(disp, parameters) (*((disp)->ProgramLocalParameter4dARB)) parameters +#define GET_ProgramLocalParameter4dARB(disp) ((disp)->ProgramLocalParameter4dARB) +#define SET_ProgramLocalParameter4dARB(disp, fn) ((disp)->ProgramLocalParameter4dARB = fn) +#define CALL_ProgramLocalParameter4dvARB(disp, parameters) (*((disp)->ProgramLocalParameter4dvARB)) parameters +#define GET_ProgramLocalParameter4dvARB(disp) ((disp)->ProgramLocalParameter4dvARB) +#define SET_ProgramLocalParameter4dvARB(disp, fn) ((disp)->ProgramLocalParameter4dvARB = fn) +#define CALL_ProgramLocalParameter4fARB(disp, parameters) (*((disp)->ProgramLocalParameter4fARB)) parameters +#define GET_ProgramLocalParameter4fARB(disp) ((disp)->ProgramLocalParameter4fARB) +#define SET_ProgramLocalParameter4fARB(disp, fn) ((disp)->ProgramLocalParameter4fARB = fn) +#define CALL_ProgramLocalParameter4fvARB(disp, parameters) (*((disp)->ProgramLocalParameter4fvARB)) parameters +#define GET_ProgramLocalParameter4fvARB(disp) ((disp)->ProgramLocalParameter4fvARB) +#define SET_ProgramLocalParameter4fvARB(disp, fn) ((disp)->ProgramLocalParameter4fvARB = fn) +#define CALL_ProgramStringARB(disp, parameters) (*((disp)->ProgramStringARB)) parameters +#define GET_ProgramStringARB(disp) ((disp)->ProgramStringARB) +#define SET_ProgramStringARB(disp, fn) ((disp)->ProgramStringARB = fn) +#define CALL_VertexAttrib1dARB(disp, parameters) (*((disp)->VertexAttrib1dARB)) parameters +#define GET_VertexAttrib1dARB(disp) ((disp)->VertexAttrib1dARB) +#define SET_VertexAttrib1dARB(disp, fn) ((disp)->VertexAttrib1dARB = fn) +#define CALL_VertexAttrib1dvARB(disp, parameters) (*((disp)->VertexAttrib1dvARB)) parameters +#define GET_VertexAttrib1dvARB(disp) ((disp)->VertexAttrib1dvARB) +#define SET_VertexAttrib1dvARB(disp, fn) ((disp)->VertexAttrib1dvARB = fn) +#define CALL_VertexAttrib1fARB(disp, parameters) (*((disp)->VertexAttrib1fARB)) parameters +#define GET_VertexAttrib1fARB(disp) ((disp)->VertexAttrib1fARB) +#define SET_VertexAttrib1fARB(disp, fn) ((disp)->VertexAttrib1fARB = fn) +#define CALL_VertexAttrib1fvARB(disp, parameters) (*((disp)->VertexAttrib1fvARB)) parameters +#define GET_VertexAttrib1fvARB(disp) ((disp)->VertexAttrib1fvARB) +#define SET_VertexAttrib1fvARB(disp, fn) ((disp)->VertexAttrib1fvARB = fn) +#define CALL_VertexAttrib1sARB(disp, parameters) (*((disp)->VertexAttrib1sARB)) parameters +#define GET_VertexAttrib1sARB(disp) ((disp)->VertexAttrib1sARB) +#define SET_VertexAttrib1sARB(disp, fn) ((disp)->VertexAttrib1sARB = fn) +#define CALL_VertexAttrib1svARB(disp, parameters) (*((disp)->VertexAttrib1svARB)) parameters +#define GET_VertexAttrib1svARB(disp) ((disp)->VertexAttrib1svARB) +#define SET_VertexAttrib1svARB(disp, fn) ((disp)->VertexAttrib1svARB = fn) +#define CALL_VertexAttrib2dARB(disp, parameters) (*((disp)->VertexAttrib2dARB)) parameters +#define GET_VertexAttrib2dARB(disp) ((disp)->VertexAttrib2dARB) +#define SET_VertexAttrib2dARB(disp, fn) ((disp)->VertexAttrib2dARB = fn) +#define CALL_VertexAttrib2dvARB(disp, parameters) (*((disp)->VertexAttrib2dvARB)) parameters +#define GET_VertexAttrib2dvARB(disp) ((disp)->VertexAttrib2dvARB) +#define SET_VertexAttrib2dvARB(disp, fn) ((disp)->VertexAttrib2dvARB = fn) +#define CALL_VertexAttrib2fARB(disp, parameters) (*((disp)->VertexAttrib2fARB)) parameters +#define GET_VertexAttrib2fARB(disp) ((disp)->VertexAttrib2fARB) +#define SET_VertexAttrib2fARB(disp, fn) ((disp)->VertexAttrib2fARB = fn) +#define CALL_VertexAttrib2fvARB(disp, parameters) (*((disp)->VertexAttrib2fvARB)) parameters +#define GET_VertexAttrib2fvARB(disp) ((disp)->VertexAttrib2fvARB) +#define SET_VertexAttrib2fvARB(disp, fn) ((disp)->VertexAttrib2fvARB = fn) +#define CALL_VertexAttrib2sARB(disp, parameters) (*((disp)->VertexAttrib2sARB)) parameters +#define GET_VertexAttrib2sARB(disp) ((disp)->VertexAttrib2sARB) +#define SET_VertexAttrib2sARB(disp, fn) ((disp)->VertexAttrib2sARB = fn) +#define CALL_VertexAttrib2svARB(disp, parameters) (*((disp)->VertexAttrib2svARB)) parameters +#define GET_VertexAttrib2svARB(disp) ((disp)->VertexAttrib2svARB) +#define SET_VertexAttrib2svARB(disp, fn) ((disp)->VertexAttrib2svARB = fn) +#define CALL_VertexAttrib3dARB(disp, parameters) (*((disp)->VertexAttrib3dARB)) parameters +#define GET_VertexAttrib3dARB(disp) ((disp)->VertexAttrib3dARB) +#define SET_VertexAttrib3dARB(disp, fn) ((disp)->VertexAttrib3dARB = fn) +#define CALL_VertexAttrib3dvARB(disp, parameters) (*((disp)->VertexAttrib3dvARB)) parameters +#define GET_VertexAttrib3dvARB(disp) ((disp)->VertexAttrib3dvARB) +#define SET_VertexAttrib3dvARB(disp, fn) ((disp)->VertexAttrib3dvARB = fn) +#define CALL_VertexAttrib3fARB(disp, parameters) (*((disp)->VertexAttrib3fARB)) parameters +#define GET_VertexAttrib3fARB(disp) ((disp)->VertexAttrib3fARB) +#define SET_VertexAttrib3fARB(disp, fn) ((disp)->VertexAttrib3fARB = fn) +#define CALL_VertexAttrib3fvARB(disp, parameters) (*((disp)->VertexAttrib3fvARB)) parameters +#define GET_VertexAttrib3fvARB(disp) ((disp)->VertexAttrib3fvARB) +#define SET_VertexAttrib3fvARB(disp, fn) ((disp)->VertexAttrib3fvARB = fn) +#define CALL_VertexAttrib3sARB(disp, parameters) (*((disp)->VertexAttrib3sARB)) parameters +#define GET_VertexAttrib3sARB(disp) ((disp)->VertexAttrib3sARB) +#define SET_VertexAttrib3sARB(disp, fn) ((disp)->VertexAttrib3sARB = fn) +#define CALL_VertexAttrib3svARB(disp, parameters) (*((disp)->VertexAttrib3svARB)) parameters +#define GET_VertexAttrib3svARB(disp) ((disp)->VertexAttrib3svARB) +#define SET_VertexAttrib3svARB(disp, fn) ((disp)->VertexAttrib3svARB = fn) +#define CALL_VertexAttrib4NbvARB(disp, parameters) (*((disp)->VertexAttrib4NbvARB)) parameters +#define GET_VertexAttrib4NbvARB(disp) ((disp)->VertexAttrib4NbvARB) +#define SET_VertexAttrib4NbvARB(disp, fn) ((disp)->VertexAttrib4NbvARB = fn) +#define CALL_VertexAttrib4NivARB(disp, parameters) (*((disp)->VertexAttrib4NivARB)) parameters +#define GET_VertexAttrib4NivARB(disp) ((disp)->VertexAttrib4NivARB) +#define SET_VertexAttrib4NivARB(disp, fn) ((disp)->VertexAttrib4NivARB = fn) +#define CALL_VertexAttrib4NsvARB(disp, parameters) (*((disp)->VertexAttrib4NsvARB)) parameters +#define GET_VertexAttrib4NsvARB(disp) ((disp)->VertexAttrib4NsvARB) +#define SET_VertexAttrib4NsvARB(disp, fn) ((disp)->VertexAttrib4NsvARB = fn) +#define CALL_VertexAttrib4NubARB(disp, parameters) (*((disp)->VertexAttrib4NubARB)) parameters +#define GET_VertexAttrib4NubARB(disp) ((disp)->VertexAttrib4NubARB) +#define SET_VertexAttrib4NubARB(disp, fn) ((disp)->VertexAttrib4NubARB = fn) +#define CALL_VertexAttrib4NubvARB(disp, parameters) (*((disp)->VertexAttrib4NubvARB)) parameters +#define GET_VertexAttrib4NubvARB(disp) ((disp)->VertexAttrib4NubvARB) +#define SET_VertexAttrib4NubvARB(disp, fn) ((disp)->VertexAttrib4NubvARB = fn) +#define CALL_VertexAttrib4NuivARB(disp, parameters) (*((disp)->VertexAttrib4NuivARB)) parameters +#define GET_VertexAttrib4NuivARB(disp) ((disp)->VertexAttrib4NuivARB) +#define SET_VertexAttrib4NuivARB(disp, fn) ((disp)->VertexAttrib4NuivARB = fn) +#define CALL_VertexAttrib4NusvARB(disp, parameters) (*((disp)->VertexAttrib4NusvARB)) parameters +#define GET_VertexAttrib4NusvARB(disp) ((disp)->VertexAttrib4NusvARB) +#define SET_VertexAttrib4NusvARB(disp, fn) ((disp)->VertexAttrib4NusvARB = fn) +#define CALL_VertexAttrib4bvARB(disp, parameters) (*((disp)->VertexAttrib4bvARB)) parameters +#define GET_VertexAttrib4bvARB(disp) ((disp)->VertexAttrib4bvARB) +#define SET_VertexAttrib4bvARB(disp, fn) ((disp)->VertexAttrib4bvARB = fn) +#define CALL_VertexAttrib4dARB(disp, parameters) (*((disp)->VertexAttrib4dARB)) parameters +#define GET_VertexAttrib4dARB(disp) ((disp)->VertexAttrib4dARB) +#define SET_VertexAttrib4dARB(disp, fn) ((disp)->VertexAttrib4dARB = fn) +#define CALL_VertexAttrib4dvARB(disp, parameters) (*((disp)->VertexAttrib4dvARB)) parameters +#define GET_VertexAttrib4dvARB(disp) ((disp)->VertexAttrib4dvARB) +#define SET_VertexAttrib4dvARB(disp, fn) ((disp)->VertexAttrib4dvARB = fn) +#define CALL_VertexAttrib4fARB(disp, parameters) (*((disp)->VertexAttrib4fARB)) parameters +#define GET_VertexAttrib4fARB(disp) ((disp)->VertexAttrib4fARB) +#define SET_VertexAttrib4fARB(disp, fn) ((disp)->VertexAttrib4fARB = fn) +#define CALL_VertexAttrib4fvARB(disp, parameters) (*((disp)->VertexAttrib4fvARB)) parameters +#define GET_VertexAttrib4fvARB(disp) ((disp)->VertexAttrib4fvARB) +#define SET_VertexAttrib4fvARB(disp, fn) ((disp)->VertexAttrib4fvARB = fn) +#define CALL_VertexAttrib4ivARB(disp, parameters) (*((disp)->VertexAttrib4ivARB)) parameters +#define GET_VertexAttrib4ivARB(disp) ((disp)->VertexAttrib4ivARB) +#define SET_VertexAttrib4ivARB(disp, fn) ((disp)->VertexAttrib4ivARB = fn) +#define CALL_VertexAttrib4sARB(disp, parameters) (*((disp)->VertexAttrib4sARB)) parameters +#define GET_VertexAttrib4sARB(disp) ((disp)->VertexAttrib4sARB) +#define SET_VertexAttrib4sARB(disp, fn) ((disp)->VertexAttrib4sARB = fn) +#define CALL_VertexAttrib4svARB(disp, parameters) (*((disp)->VertexAttrib4svARB)) parameters +#define GET_VertexAttrib4svARB(disp) ((disp)->VertexAttrib4svARB) +#define SET_VertexAttrib4svARB(disp, fn) ((disp)->VertexAttrib4svARB = fn) +#define CALL_VertexAttrib4ubvARB(disp, parameters) (*((disp)->VertexAttrib4ubvARB)) parameters +#define GET_VertexAttrib4ubvARB(disp) ((disp)->VertexAttrib4ubvARB) +#define SET_VertexAttrib4ubvARB(disp, fn) ((disp)->VertexAttrib4ubvARB = fn) +#define CALL_VertexAttrib4uivARB(disp, parameters) (*((disp)->VertexAttrib4uivARB)) parameters +#define GET_VertexAttrib4uivARB(disp) ((disp)->VertexAttrib4uivARB) +#define SET_VertexAttrib4uivARB(disp, fn) ((disp)->VertexAttrib4uivARB = fn) +#define CALL_VertexAttrib4usvARB(disp, parameters) (*((disp)->VertexAttrib4usvARB)) parameters +#define GET_VertexAttrib4usvARB(disp) ((disp)->VertexAttrib4usvARB) +#define SET_VertexAttrib4usvARB(disp, fn) ((disp)->VertexAttrib4usvARB = fn) +#define CALL_VertexAttribPointerARB(disp, parameters) (*((disp)->VertexAttribPointerARB)) parameters +#define GET_VertexAttribPointerARB(disp) ((disp)->VertexAttribPointerARB) +#define SET_VertexAttribPointerARB(disp, fn) ((disp)->VertexAttribPointerARB = fn) +#define CALL_BindBufferARB(disp, parameters) (*((disp)->BindBufferARB)) parameters +#define GET_BindBufferARB(disp) ((disp)->BindBufferARB) +#define SET_BindBufferARB(disp, fn) ((disp)->BindBufferARB = fn) +#define CALL_BufferDataARB(disp, parameters) (*((disp)->BufferDataARB)) parameters +#define GET_BufferDataARB(disp) ((disp)->BufferDataARB) +#define SET_BufferDataARB(disp, fn) ((disp)->BufferDataARB = fn) +#define CALL_BufferSubDataARB(disp, parameters) (*((disp)->BufferSubDataARB)) parameters +#define GET_BufferSubDataARB(disp) ((disp)->BufferSubDataARB) +#define SET_BufferSubDataARB(disp, fn) ((disp)->BufferSubDataARB = fn) +#define CALL_DeleteBuffersARB(disp, parameters) (*((disp)->DeleteBuffersARB)) parameters +#define GET_DeleteBuffersARB(disp) ((disp)->DeleteBuffersARB) +#define SET_DeleteBuffersARB(disp, fn) ((disp)->DeleteBuffersARB = fn) +#define CALL_GenBuffersARB(disp, parameters) (*((disp)->GenBuffersARB)) parameters +#define GET_GenBuffersARB(disp) ((disp)->GenBuffersARB) +#define SET_GenBuffersARB(disp, fn) ((disp)->GenBuffersARB = fn) +#define CALL_GetBufferParameterivARB(disp, parameters) (*((disp)->GetBufferParameterivARB)) parameters +#define GET_GetBufferParameterivARB(disp) ((disp)->GetBufferParameterivARB) +#define SET_GetBufferParameterivARB(disp, fn) ((disp)->GetBufferParameterivARB = fn) +#define CALL_GetBufferPointervARB(disp, parameters) (*((disp)->GetBufferPointervARB)) parameters +#define GET_GetBufferPointervARB(disp) ((disp)->GetBufferPointervARB) +#define SET_GetBufferPointervARB(disp, fn) ((disp)->GetBufferPointervARB = fn) +#define CALL_GetBufferSubDataARB(disp, parameters) (*((disp)->GetBufferSubDataARB)) parameters +#define GET_GetBufferSubDataARB(disp) ((disp)->GetBufferSubDataARB) +#define SET_GetBufferSubDataARB(disp, fn) ((disp)->GetBufferSubDataARB = fn) +#define CALL_IsBufferARB(disp, parameters) (*((disp)->IsBufferARB)) parameters +#define GET_IsBufferARB(disp) ((disp)->IsBufferARB) +#define SET_IsBufferARB(disp, fn) ((disp)->IsBufferARB = fn) +#define CALL_MapBufferARB(disp, parameters) (*((disp)->MapBufferARB)) parameters +#define GET_MapBufferARB(disp) ((disp)->MapBufferARB) +#define SET_MapBufferARB(disp, fn) ((disp)->MapBufferARB = fn) +#define CALL_UnmapBufferARB(disp, parameters) (*((disp)->UnmapBufferARB)) parameters +#define GET_UnmapBufferARB(disp) ((disp)->UnmapBufferARB) +#define SET_UnmapBufferARB(disp, fn) ((disp)->UnmapBufferARB = fn) +#define CALL_BeginQueryARB(disp, parameters) (*((disp)->BeginQueryARB)) parameters +#define GET_BeginQueryARB(disp) ((disp)->BeginQueryARB) +#define SET_BeginQueryARB(disp, fn) ((disp)->BeginQueryARB = fn) +#define CALL_DeleteQueriesARB(disp, parameters) (*((disp)->DeleteQueriesARB)) parameters +#define GET_DeleteQueriesARB(disp) ((disp)->DeleteQueriesARB) +#define SET_DeleteQueriesARB(disp, fn) ((disp)->DeleteQueriesARB = fn) +#define CALL_EndQueryARB(disp, parameters) (*((disp)->EndQueryARB)) parameters +#define GET_EndQueryARB(disp) ((disp)->EndQueryARB) +#define SET_EndQueryARB(disp, fn) ((disp)->EndQueryARB = fn) +#define CALL_GenQueriesARB(disp, parameters) (*((disp)->GenQueriesARB)) parameters +#define GET_GenQueriesARB(disp) ((disp)->GenQueriesARB) +#define SET_GenQueriesARB(disp, fn) ((disp)->GenQueriesARB = fn) +#define CALL_GetQueryObjectivARB(disp, parameters) (*((disp)->GetQueryObjectivARB)) parameters +#define GET_GetQueryObjectivARB(disp) ((disp)->GetQueryObjectivARB) +#define SET_GetQueryObjectivARB(disp, fn) ((disp)->GetQueryObjectivARB = fn) +#define CALL_GetQueryObjectuivARB(disp, parameters) (*((disp)->GetQueryObjectuivARB)) parameters +#define GET_GetQueryObjectuivARB(disp) ((disp)->GetQueryObjectuivARB) +#define SET_GetQueryObjectuivARB(disp, fn) ((disp)->GetQueryObjectuivARB = fn) +#define CALL_GetQueryivARB(disp, parameters) (*((disp)->GetQueryivARB)) parameters +#define GET_GetQueryivARB(disp) ((disp)->GetQueryivARB) +#define SET_GetQueryivARB(disp, fn) ((disp)->GetQueryivARB = fn) +#define CALL_IsQueryARB(disp, parameters) (*((disp)->IsQueryARB)) parameters +#define GET_IsQueryARB(disp) ((disp)->IsQueryARB) +#define SET_IsQueryARB(disp, fn) ((disp)->IsQueryARB = fn) +#define CALL_AttachObjectARB(disp, parameters) (*((disp)->AttachObjectARB)) parameters +#define GET_AttachObjectARB(disp) ((disp)->AttachObjectARB) +#define SET_AttachObjectARB(disp, fn) ((disp)->AttachObjectARB = fn) +#define CALL_CompileShaderARB(disp, parameters) (*((disp)->CompileShaderARB)) parameters +#define GET_CompileShaderARB(disp) ((disp)->CompileShaderARB) +#define SET_CompileShaderARB(disp, fn) ((disp)->CompileShaderARB = fn) +#define CALL_CreateProgramObjectARB(disp, parameters) (*((disp)->CreateProgramObjectARB)) parameters +#define GET_CreateProgramObjectARB(disp) ((disp)->CreateProgramObjectARB) +#define SET_CreateProgramObjectARB(disp, fn) ((disp)->CreateProgramObjectARB = fn) +#define CALL_CreateShaderObjectARB(disp, parameters) (*((disp)->CreateShaderObjectARB)) parameters +#define GET_CreateShaderObjectARB(disp) ((disp)->CreateShaderObjectARB) +#define SET_CreateShaderObjectARB(disp, fn) ((disp)->CreateShaderObjectARB = fn) +#define CALL_DeleteObjectARB(disp, parameters) (*((disp)->DeleteObjectARB)) parameters +#define GET_DeleteObjectARB(disp) ((disp)->DeleteObjectARB) +#define SET_DeleteObjectARB(disp, fn) ((disp)->DeleteObjectARB = fn) +#define CALL_DetachObjectARB(disp, parameters) (*((disp)->DetachObjectARB)) parameters +#define GET_DetachObjectARB(disp) ((disp)->DetachObjectARB) +#define SET_DetachObjectARB(disp, fn) ((disp)->DetachObjectARB = fn) +#define CALL_GetActiveUniformARB(disp, parameters) (*((disp)->GetActiveUniformARB)) parameters +#define GET_GetActiveUniformARB(disp) ((disp)->GetActiveUniformARB) +#define SET_GetActiveUniformARB(disp, fn) ((disp)->GetActiveUniformARB = fn) +#define CALL_GetAttachedObjectsARB(disp, parameters) (*((disp)->GetAttachedObjectsARB)) parameters +#define GET_GetAttachedObjectsARB(disp) ((disp)->GetAttachedObjectsARB) +#define SET_GetAttachedObjectsARB(disp, fn) ((disp)->GetAttachedObjectsARB = fn) +#define CALL_GetHandleARB(disp, parameters) (*((disp)->GetHandleARB)) parameters +#define GET_GetHandleARB(disp) ((disp)->GetHandleARB) +#define SET_GetHandleARB(disp, fn) ((disp)->GetHandleARB = fn) +#define CALL_GetInfoLogARB(disp, parameters) (*((disp)->GetInfoLogARB)) parameters +#define GET_GetInfoLogARB(disp) ((disp)->GetInfoLogARB) +#define SET_GetInfoLogARB(disp, fn) ((disp)->GetInfoLogARB = fn) +#define CALL_GetObjectParameterfvARB(disp, parameters) (*((disp)->GetObjectParameterfvARB)) parameters +#define GET_GetObjectParameterfvARB(disp) ((disp)->GetObjectParameterfvARB) +#define SET_GetObjectParameterfvARB(disp, fn) ((disp)->GetObjectParameterfvARB = fn) +#define CALL_GetObjectParameterivARB(disp, parameters) (*((disp)->GetObjectParameterivARB)) parameters +#define GET_GetObjectParameterivARB(disp) ((disp)->GetObjectParameterivARB) +#define SET_GetObjectParameterivARB(disp, fn) ((disp)->GetObjectParameterivARB = fn) +#define CALL_GetShaderSourceARB(disp, parameters) (*((disp)->GetShaderSourceARB)) parameters +#define GET_GetShaderSourceARB(disp) ((disp)->GetShaderSourceARB) +#define SET_GetShaderSourceARB(disp, fn) ((disp)->GetShaderSourceARB = fn) +#define CALL_GetUniformLocationARB(disp, parameters) (*((disp)->GetUniformLocationARB)) parameters +#define GET_GetUniformLocationARB(disp) ((disp)->GetUniformLocationARB) +#define SET_GetUniformLocationARB(disp, fn) ((disp)->GetUniformLocationARB = fn) +#define CALL_GetUniformfvARB(disp, parameters) (*((disp)->GetUniformfvARB)) parameters +#define GET_GetUniformfvARB(disp) ((disp)->GetUniformfvARB) +#define SET_GetUniformfvARB(disp, fn) ((disp)->GetUniformfvARB = fn) +#define CALL_GetUniformivARB(disp, parameters) (*((disp)->GetUniformivARB)) parameters +#define GET_GetUniformivARB(disp) ((disp)->GetUniformivARB) +#define SET_GetUniformivARB(disp, fn) ((disp)->GetUniformivARB = fn) +#define CALL_LinkProgramARB(disp, parameters) (*((disp)->LinkProgramARB)) parameters +#define GET_LinkProgramARB(disp) ((disp)->LinkProgramARB) +#define SET_LinkProgramARB(disp, fn) ((disp)->LinkProgramARB = fn) +#define CALL_ShaderSourceARB(disp, parameters) (*((disp)->ShaderSourceARB)) parameters +#define GET_ShaderSourceARB(disp) ((disp)->ShaderSourceARB) +#define SET_ShaderSourceARB(disp, fn) ((disp)->ShaderSourceARB = fn) +#define CALL_Uniform1fARB(disp, parameters) (*((disp)->Uniform1fARB)) parameters +#define GET_Uniform1fARB(disp) ((disp)->Uniform1fARB) +#define SET_Uniform1fARB(disp, fn) ((disp)->Uniform1fARB = fn) +#define CALL_Uniform1fvARB(disp, parameters) (*((disp)->Uniform1fvARB)) parameters +#define GET_Uniform1fvARB(disp) ((disp)->Uniform1fvARB) +#define SET_Uniform1fvARB(disp, fn) ((disp)->Uniform1fvARB = fn) +#define CALL_Uniform1iARB(disp, parameters) (*((disp)->Uniform1iARB)) parameters +#define GET_Uniform1iARB(disp) ((disp)->Uniform1iARB) +#define SET_Uniform1iARB(disp, fn) ((disp)->Uniform1iARB = fn) +#define CALL_Uniform1ivARB(disp, parameters) (*((disp)->Uniform1ivARB)) parameters +#define GET_Uniform1ivARB(disp) ((disp)->Uniform1ivARB) +#define SET_Uniform1ivARB(disp, fn) ((disp)->Uniform1ivARB = fn) +#define CALL_Uniform2fARB(disp, parameters) (*((disp)->Uniform2fARB)) parameters +#define GET_Uniform2fARB(disp) ((disp)->Uniform2fARB) +#define SET_Uniform2fARB(disp, fn) ((disp)->Uniform2fARB = fn) +#define CALL_Uniform2fvARB(disp, parameters) (*((disp)->Uniform2fvARB)) parameters +#define GET_Uniform2fvARB(disp) ((disp)->Uniform2fvARB) +#define SET_Uniform2fvARB(disp, fn) ((disp)->Uniform2fvARB = fn) +#define CALL_Uniform2iARB(disp, parameters) (*((disp)->Uniform2iARB)) parameters +#define GET_Uniform2iARB(disp) ((disp)->Uniform2iARB) +#define SET_Uniform2iARB(disp, fn) ((disp)->Uniform2iARB = fn) +#define CALL_Uniform2ivARB(disp, parameters) (*((disp)->Uniform2ivARB)) parameters +#define GET_Uniform2ivARB(disp) ((disp)->Uniform2ivARB) +#define SET_Uniform2ivARB(disp, fn) ((disp)->Uniform2ivARB = fn) +#define CALL_Uniform3fARB(disp, parameters) (*((disp)->Uniform3fARB)) parameters +#define GET_Uniform3fARB(disp) ((disp)->Uniform3fARB) +#define SET_Uniform3fARB(disp, fn) ((disp)->Uniform3fARB = fn) +#define CALL_Uniform3fvARB(disp, parameters) (*((disp)->Uniform3fvARB)) parameters +#define GET_Uniform3fvARB(disp) ((disp)->Uniform3fvARB) +#define SET_Uniform3fvARB(disp, fn) ((disp)->Uniform3fvARB = fn) +#define CALL_Uniform3iARB(disp, parameters) (*((disp)->Uniform3iARB)) parameters +#define GET_Uniform3iARB(disp) ((disp)->Uniform3iARB) +#define SET_Uniform3iARB(disp, fn) ((disp)->Uniform3iARB = fn) +#define CALL_Uniform3ivARB(disp, parameters) (*((disp)->Uniform3ivARB)) parameters +#define GET_Uniform3ivARB(disp) ((disp)->Uniform3ivARB) +#define SET_Uniform3ivARB(disp, fn) ((disp)->Uniform3ivARB = fn) +#define CALL_Uniform4fARB(disp, parameters) (*((disp)->Uniform4fARB)) parameters +#define GET_Uniform4fARB(disp) ((disp)->Uniform4fARB) +#define SET_Uniform4fARB(disp, fn) ((disp)->Uniform4fARB = fn) +#define CALL_Uniform4fvARB(disp, parameters) (*((disp)->Uniform4fvARB)) parameters +#define GET_Uniform4fvARB(disp) ((disp)->Uniform4fvARB) +#define SET_Uniform4fvARB(disp, fn) ((disp)->Uniform4fvARB = fn) +#define CALL_Uniform4iARB(disp, parameters) (*((disp)->Uniform4iARB)) parameters +#define GET_Uniform4iARB(disp) ((disp)->Uniform4iARB) +#define SET_Uniform4iARB(disp, fn) ((disp)->Uniform4iARB = fn) +#define CALL_Uniform4ivARB(disp, parameters) (*((disp)->Uniform4ivARB)) parameters +#define GET_Uniform4ivARB(disp) ((disp)->Uniform4ivARB) +#define SET_Uniform4ivARB(disp, fn) ((disp)->Uniform4ivARB = fn) +#define CALL_UniformMatrix2fvARB(disp, parameters) (*((disp)->UniformMatrix2fvARB)) parameters +#define GET_UniformMatrix2fvARB(disp) ((disp)->UniformMatrix2fvARB) +#define SET_UniformMatrix2fvARB(disp, fn) ((disp)->UniformMatrix2fvARB = fn) +#define CALL_UniformMatrix3fvARB(disp, parameters) (*((disp)->UniformMatrix3fvARB)) parameters +#define GET_UniformMatrix3fvARB(disp) ((disp)->UniformMatrix3fvARB) +#define SET_UniformMatrix3fvARB(disp, fn) ((disp)->UniformMatrix3fvARB = fn) +#define CALL_UniformMatrix4fvARB(disp, parameters) (*((disp)->UniformMatrix4fvARB)) parameters +#define GET_UniformMatrix4fvARB(disp) ((disp)->UniformMatrix4fvARB) +#define SET_UniformMatrix4fvARB(disp, fn) ((disp)->UniformMatrix4fvARB = fn) +#define CALL_UseProgramObjectARB(disp, parameters) (*((disp)->UseProgramObjectARB)) parameters +#define GET_UseProgramObjectARB(disp) ((disp)->UseProgramObjectARB) +#define SET_UseProgramObjectARB(disp, fn) ((disp)->UseProgramObjectARB = fn) +#define CALL_ValidateProgramARB(disp, parameters) (*((disp)->ValidateProgramARB)) parameters +#define GET_ValidateProgramARB(disp) ((disp)->ValidateProgramARB) +#define SET_ValidateProgramARB(disp, fn) ((disp)->ValidateProgramARB = fn) +#define CALL_BindAttribLocationARB(disp, parameters) (*((disp)->BindAttribLocationARB)) parameters +#define GET_BindAttribLocationARB(disp) ((disp)->BindAttribLocationARB) +#define SET_BindAttribLocationARB(disp, fn) ((disp)->BindAttribLocationARB = fn) +#define CALL_GetActiveAttribARB(disp, parameters) (*((disp)->GetActiveAttribARB)) parameters +#define GET_GetActiveAttribARB(disp) ((disp)->GetActiveAttribARB) +#define SET_GetActiveAttribARB(disp, fn) ((disp)->GetActiveAttribARB = fn) +#define CALL_GetAttribLocationARB(disp, parameters) (*((disp)->GetAttribLocationARB)) parameters +#define GET_GetAttribLocationARB(disp) ((disp)->GetAttribLocationARB) +#define SET_GetAttribLocationARB(disp, fn) ((disp)->GetAttribLocationARB = fn) +#define CALL_DrawBuffersARB(disp, parameters) (*((disp)->DrawBuffersARB)) parameters +#define GET_DrawBuffersARB(disp) ((disp)->DrawBuffersARB) +#define SET_DrawBuffersARB(disp, fn) ((disp)->DrawBuffersARB = fn) +#define CALL_RenderbufferStorageMultisample(disp, parameters) (*((disp)->RenderbufferStorageMultisample)) parameters +#define GET_RenderbufferStorageMultisample(disp) ((disp)->RenderbufferStorageMultisample) +#define SET_RenderbufferStorageMultisample(disp, fn) ((disp)->RenderbufferStorageMultisample = fn) +#define CALL_FlushMappedBufferRange(disp, parameters) (*((disp)->FlushMappedBufferRange)) parameters +#define GET_FlushMappedBufferRange(disp) ((disp)->FlushMappedBufferRange) +#define SET_FlushMappedBufferRange(disp, fn) ((disp)->FlushMappedBufferRange = fn) +#define CALL_MapBufferRange(disp, parameters) (*((disp)->MapBufferRange)) parameters +#define GET_MapBufferRange(disp) ((disp)->MapBufferRange) +#define SET_MapBufferRange(disp, fn) ((disp)->MapBufferRange = fn) +#define CALL_BindVertexArray(disp, parameters) (*((disp)->BindVertexArray)) parameters +#define GET_BindVertexArray(disp) ((disp)->BindVertexArray) +#define SET_BindVertexArray(disp, fn) ((disp)->BindVertexArray = fn) +#define CALL_GenVertexArrays(disp, parameters) (*((disp)->GenVertexArrays)) parameters +#define GET_GenVertexArrays(disp) ((disp)->GenVertexArrays) +#define SET_GenVertexArrays(disp, fn) ((disp)->GenVertexArrays = fn) +#define CALL_CopyBufferSubData(disp, parameters) (*((disp)->CopyBufferSubData)) parameters +#define GET_CopyBufferSubData(disp) ((disp)->CopyBufferSubData) +#define SET_CopyBufferSubData(disp, fn) ((disp)->CopyBufferSubData = fn) +#define CALL_ClientWaitSync(disp, parameters) (*((disp)->ClientWaitSync)) parameters +#define GET_ClientWaitSync(disp) ((disp)->ClientWaitSync) +#define SET_ClientWaitSync(disp, fn) ((disp)->ClientWaitSync = fn) +#define CALL_DeleteSync(disp, parameters) (*((disp)->DeleteSync)) parameters +#define GET_DeleteSync(disp) ((disp)->DeleteSync) +#define SET_DeleteSync(disp, fn) ((disp)->DeleteSync = fn) +#define CALL_FenceSync(disp, parameters) (*((disp)->FenceSync)) parameters +#define GET_FenceSync(disp) ((disp)->FenceSync) +#define SET_FenceSync(disp, fn) ((disp)->FenceSync = fn) +#define CALL_GetInteger64v(disp, parameters) (*((disp)->GetInteger64v)) parameters +#define GET_GetInteger64v(disp) ((disp)->GetInteger64v) +#define SET_GetInteger64v(disp, fn) ((disp)->GetInteger64v = fn) +#define CALL_GetSynciv(disp, parameters) (*((disp)->GetSynciv)) parameters +#define GET_GetSynciv(disp) ((disp)->GetSynciv) +#define SET_GetSynciv(disp, fn) ((disp)->GetSynciv = fn) +#define CALL_IsSync(disp, parameters) (*((disp)->IsSync)) parameters +#define GET_IsSync(disp) ((disp)->IsSync) +#define SET_IsSync(disp, fn) ((disp)->IsSync = fn) +#define CALL_WaitSync(disp, parameters) (*((disp)->WaitSync)) parameters +#define GET_WaitSync(disp) ((disp)->WaitSync) +#define SET_WaitSync(disp, fn) ((disp)->WaitSync = fn) +#define CALL_DrawElementsBaseVertex(disp, parameters) (*((disp)->DrawElementsBaseVertex)) parameters +#define GET_DrawElementsBaseVertex(disp) ((disp)->DrawElementsBaseVertex) +#define SET_DrawElementsBaseVertex(disp, fn) ((disp)->DrawElementsBaseVertex = fn) +#define CALL_DrawRangeElementsBaseVertex(disp, parameters) (*((disp)->DrawRangeElementsBaseVertex)) parameters +#define GET_DrawRangeElementsBaseVertex(disp) ((disp)->DrawRangeElementsBaseVertex) +#define SET_DrawRangeElementsBaseVertex(disp, fn) ((disp)->DrawRangeElementsBaseVertex = fn) +#define CALL_MultiDrawElementsBaseVertex(disp, parameters) (*((disp)->MultiDrawElementsBaseVertex)) parameters +#define GET_MultiDrawElementsBaseVertex(disp) ((disp)->MultiDrawElementsBaseVertex) +#define SET_MultiDrawElementsBaseVertex(disp, fn) ((disp)->MultiDrawElementsBaseVertex = fn) +#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters +#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) +#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) +#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters +#define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS) +#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn) +#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterivSGIS)) parameters +#define GET_GetPixelTexGenParameterivSGIS(disp) ((disp)->GetPixelTexGenParameterivSGIS) +#define SET_GetPixelTexGenParameterivSGIS(disp, fn) ((disp)->GetPixelTexGenParameterivSGIS = fn) +#define CALL_PixelTexGenParameterfSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfSGIS)) parameters +#define GET_PixelTexGenParameterfSGIS(disp) ((disp)->PixelTexGenParameterfSGIS) +#define SET_PixelTexGenParameterfSGIS(disp, fn) ((disp)->PixelTexGenParameterfSGIS = fn) +#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfvSGIS)) parameters +#define GET_PixelTexGenParameterfvSGIS(disp) ((disp)->PixelTexGenParameterfvSGIS) +#define SET_PixelTexGenParameterfvSGIS(disp, fn) ((disp)->PixelTexGenParameterfvSGIS = fn) +#define CALL_PixelTexGenParameteriSGIS(disp, parameters) (*((disp)->PixelTexGenParameteriSGIS)) parameters +#define GET_PixelTexGenParameteriSGIS(disp) ((disp)->PixelTexGenParameteriSGIS) +#define SET_PixelTexGenParameteriSGIS(disp, fn) ((disp)->PixelTexGenParameteriSGIS = fn) +#define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters +#define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS) +#define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn) +#define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters +#define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS) +#define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn) +#define CALL_SamplePatternSGIS(disp, parameters) (*((disp)->SamplePatternSGIS)) parameters +#define GET_SamplePatternSGIS(disp) ((disp)->SamplePatternSGIS) +#define SET_SamplePatternSGIS(disp, fn) ((disp)->SamplePatternSGIS = fn) +#define CALL_ColorPointerEXT(disp, parameters) (*((disp)->ColorPointerEXT)) parameters +#define GET_ColorPointerEXT(disp) ((disp)->ColorPointerEXT) +#define SET_ColorPointerEXT(disp, fn) ((disp)->ColorPointerEXT = fn) +#define CALL_EdgeFlagPointerEXT(disp, parameters) (*((disp)->EdgeFlagPointerEXT)) parameters +#define GET_EdgeFlagPointerEXT(disp) ((disp)->EdgeFlagPointerEXT) +#define SET_EdgeFlagPointerEXT(disp, fn) ((disp)->EdgeFlagPointerEXT = fn) +#define CALL_IndexPointerEXT(disp, parameters) (*((disp)->IndexPointerEXT)) parameters +#define GET_IndexPointerEXT(disp) ((disp)->IndexPointerEXT) +#define SET_IndexPointerEXT(disp, fn) ((disp)->IndexPointerEXT = fn) +#define CALL_NormalPointerEXT(disp, parameters) (*((disp)->NormalPointerEXT)) parameters +#define GET_NormalPointerEXT(disp) ((disp)->NormalPointerEXT) +#define SET_NormalPointerEXT(disp, fn) ((disp)->NormalPointerEXT = fn) +#define CALL_TexCoordPointerEXT(disp, parameters) (*((disp)->TexCoordPointerEXT)) parameters +#define GET_TexCoordPointerEXT(disp) ((disp)->TexCoordPointerEXT) +#define SET_TexCoordPointerEXT(disp, fn) ((disp)->TexCoordPointerEXT = fn) +#define CALL_VertexPointerEXT(disp, parameters) (*((disp)->VertexPointerEXT)) parameters +#define GET_VertexPointerEXT(disp) ((disp)->VertexPointerEXT) +#define SET_VertexPointerEXT(disp, fn) ((disp)->VertexPointerEXT = fn) +#define CALL_PointParameterfEXT(disp, parameters) (*((disp)->PointParameterfEXT)) parameters +#define GET_PointParameterfEXT(disp) ((disp)->PointParameterfEXT) +#define SET_PointParameterfEXT(disp, fn) ((disp)->PointParameterfEXT = fn) +#define CALL_PointParameterfvEXT(disp, parameters) (*((disp)->PointParameterfvEXT)) parameters +#define GET_PointParameterfvEXT(disp) ((disp)->PointParameterfvEXT) +#define SET_PointParameterfvEXT(disp, fn) ((disp)->PointParameterfvEXT = fn) +#define CALL_LockArraysEXT(disp, parameters) (*((disp)->LockArraysEXT)) parameters +#define GET_LockArraysEXT(disp) ((disp)->LockArraysEXT) +#define SET_LockArraysEXT(disp, fn) ((disp)->LockArraysEXT = fn) +#define CALL_UnlockArraysEXT(disp, parameters) (*((disp)->UnlockArraysEXT)) parameters +#define GET_UnlockArraysEXT(disp) ((disp)->UnlockArraysEXT) +#define SET_UnlockArraysEXT(disp, fn) ((disp)->UnlockArraysEXT = fn) +#define CALL_CullParameterdvEXT(disp, parameters) (*((disp)->CullParameterdvEXT)) parameters +#define GET_CullParameterdvEXT(disp) ((disp)->CullParameterdvEXT) +#define SET_CullParameterdvEXT(disp, fn) ((disp)->CullParameterdvEXT = fn) +#define CALL_CullParameterfvEXT(disp, parameters) (*((disp)->CullParameterfvEXT)) parameters +#define GET_CullParameterfvEXT(disp) ((disp)->CullParameterfvEXT) +#define SET_CullParameterfvEXT(disp, fn) ((disp)->CullParameterfvEXT = fn) +#define CALL_SecondaryColor3bEXT(disp, parameters) (*((disp)->SecondaryColor3bEXT)) parameters +#define GET_SecondaryColor3bEXT(disp) ((disp)->SecondaryColor3bEXT) +#define SET_SecondaryColor3bEXT(disp, fn) ((disp)->SecondaryColor3bEXT = fn) +#define CALL_SecondaryColor3bvEXT(disp, parameters) (*((disp)->SecondaryColor3bvEXT)) parameters +#define GET_SecondaryColor3bvEXT(disp) ((disp)->SecondaryColor3bvEXT) +#define SET_SecondaryColor3bvEXT(disp, fn) ((disp)->SecondaryColor3bvEXT = fn) +#define CALL_SecondaryColor3dEXT(disp, parameters) (*((disp)->SecondaryColor3dEXT)) parameters +#define GET_SecondaryColor3dEXT(disp) ((disp)->SecondaryColor3dEXT) +#define SET_SecondaryColor3dEXT(disp, fn) ((disp)->SecondaryColor3dEXT = fn) +#define CALL_SecondaryColor3dvEXT(disp, parameters) (*((disp)->SecondaryColor3dvEXT)) parameters +#define GET_SecondaryColor3dvEXT(disp) ((disp)->SecondaryColor3dvEXT) +#define SET_SecondaryColor3dvEXT(disp, fn) ((disp)->SecondaryColor3dvEXT = fn) +#define CALL_SecondaryColor3fEXT(disp, parameters) (*((disp)->SecondaryColor3fEXT)) parameters +#define GET_SecondaryColor3fEXT(disp) ((disp)->SecondaryColor3fEXT) +#define SET_SecondaryColor3fEXT(disp, fn) ((disp)->SecondaryColor3fEXT = fn) +#define CALL_SecondaryColor3fvEXT(disp, parameters) (*((disp)->SecondaryColor3fvEXT)) parameters +#define GET_SecondaryColor3fvEXT(disp) ((disp)->SecondaryColor3fvEXT) +#define SET_SecondaryColor3fvEXT(disp, fn) ((disp)->SecondaryColor3fvEXT = fn) +#define CALL_SecondaryColor3iEXT(disp, parameters) (*((disp)->SecondaryColor3iEXT)) parameters +#define GET_SecondaryColor3iEXT(disp) ((disp)->SecondaryColor3iEXT) +#define SET_SecondaryColor3iEXT(disp, fn) ((disp)->SecondaryColor3iEXT = fn) +#define CALL_SecondaryColor3ivEXT(disp, parameters) (*((disp)->SecondaryColor3ivEXT)) parameters +#define GET_SecondaryColor3ivEXT(disp) ((disp)->SecondaryColor3ivEXT) +#define SET_SecondaryColor3ivEXT(disp, fn) ((disp)->SecondaryColor3ivEXT = fn) +#define CALL_SecondaryColor3sEXT(disp, parameters) (*((disp)->SecondaryColor3sEXT)) parameters +#define GET_SecondaryColor3sEXT(disp) ((disp)->SecondaryColor3sEXT) +#define SET_SecondaryColor3sEXT(disp, fn) ((disp)->SecondaryColor3sEXT = fn) +#define CALL_SecondaryColor3svEXT(disp, parameters) (*((disp)->SecondaryColor3svEXT)) parameters +#define GET_SecondaryColor3svEXT(disp) ((disp)->SecondaryColor3svEXT) +#define SET_SecondaryColor3svEXT(disp, fn) ((disp)->SecondaryColor3svEXT = fn) +#define CALL_SecondaryColor3ubEXT(disp, parameters) (*((disp)->SecondaryColor3ubEXT)) parameters +#define GET_SecondaryColor3ubEXT(disp) ((disp)->SecondaryColor3ubEXT) +#define SET_SecondaryColor3ubEXT(disp, fn) ((disp)->SecondaryColor3ubEXT = fn) +#define CALL_SecondaryColor3ubvEXT(disp, parameters) (*((disp)->SecondaryColor3ubvEXT)) parameters +#define GET_SecondaryColor3ubvEXT(disp) ((disp)->SecondaryColor3ubvEXT) +#define SET_SecondaryColor3ubvEXT(disp, fn) ((disp)->SecondaryColor3ubvEXT = fn) +#define CALL_SecondaryColor3uiEXT(disp, parameters) (*((disp)->SecondaryColor3uiEXT)) parameters +#define GET_SecondaryColor3uiEXT(disp) ((disp)->SecondaryColor3uiEXT) +#define SET_SecondaryColor3uiEXT(disp, fn) ((disp)->SecondaryColor3uiEXT = fn) +#define CALL_SecondaryColor3uivEXT(disp, parameters) (*((disp)->SecondaryColor3uivEXT)) parameters +#define GET_SecondaryColor3uivEXT(disp) ((disp)->SecondaryColor3uivEXT) +#define SET_SecondaryColor3uivEXT(disp, fn) ((disp)->SecondaryColor3uivEXT = fn) +#define CALL_SecondaryColor3usEXT(disp, parameters) (*((disp)->SecondaryColor3usEXT)) parameters +#define GET_SecondaryColor3usEXT(disp) ((disp)->SecondaryColor3usEXT) +#define SET_SecondaryColor3usEXT(disp, fn) ((disp)->SecondaryColor3usEXT = fn) +#define CALL_SecondaryColor3usvEXT(disp, parameters) (*((disp)->SecondaryColor3usvEXT)) parameters +#define GET_SecondaryColor3usvEXT(disp) ((disp)->SecondaryColor3usvEXT) +#define SET_SecondaryColor3usvEXT(disp, fn) ((disp)->SecondaryColor3usvEXT = fn) +#define CALL_SecondaryColorPointerEXT(disp, parameters) (*((disp)->SecondaryColorPointerEXT)) parameters +#define GET_SecondaryColorPointerEXT(disp) ((disp)->SecondaryColorPointerEXT) +#define SET_SecondaryColorPointerEXT(disp, fn) ((disp)->SecondaryColorPointerEXT = fn) +#define CALL_MultiDrawArraysEXT(disp, parameters) (*((disp)->MultiDrawArraysEXT)) parameters +#define GET_MultiDrawArraysEXT(disp) ((disp)->MultiDrawArraysEXT) +#define SET_MultiDrawArraysEXT(disp, fn) ((disp)->MultiDrawArraysEXT = fn) +#define CALL_MultiDrawElementsEXT(disp, parameters) (*((disp)->MultiDrawElementsEXT)) parameters +#define GET_MultiDrawElementsEXT(disp) ((disp)->MultiDrawElementsEXT) +#define SET_MultiDrawElementsEXT(disp, fn) ((disp)->MultiDrawElementsEXT = fn) +#define CALL_FogCoordPointerEXT(disp, parameters) (*((disp)->FogCoordPointerEXT)) parameters +#define GET_FogCoordPointerEXT(disp) ((disp)->FogCoordPointerEXT) +#define SET_FogCoordPointerEXT(disp, fn) ((disp)->FogCoordPointerEXT = fn) +#define CALL_FogCoorddEXT(disp, parameters) (*((disp)->FogCoorddEXT)) parameters +#define GET_FogCoorddEXT(disp) ((disp)->FogCoorddEXT) +#define SET_FogCoorddEXT(disp, fn) ((disp)->FogCoorddEXT = fn) +#define CALL_FogCoorddvEXT(disp, parameters) (*((disp)->FogCoorddvEXT)) parameters +#define GET_FogCoorddvEXT(disp) ((disp)->FogCoorddvEXT) +#define SET_FogCoorddvEXT(disp, fn) ((disp)->FogCoorddvEXT = fn) +#define CALL_FogCoordfEXT(disp, parameters) (*((disp)->FogCoordfEXT)) parameters +#define GET_FogCoordfEXT(disp) ((disp)->FogCoordfEXT) +#define SET_FogCoordfEXT(disp, fn) ((disp)->FogCoordfEXT = fn) +#define CALL_FogCoordfvEXT(disp, parameters) (*((disp)->FogCoordfvEXT)) parameters +#define GET_FogCoordfvEXT(disp) ((disp)->FogCoordfvEXT) +#define SET_FogCoordfvEXT(disp, fn) ((disp)->FogCoordfvEXT = fn) +#define CALL_PixelTexGenSGIX(disp, parameters) (*((disp)->PixelTexGenSGIX)) parameters +#define GET_PixelTexGenSGIX(disp) ((disp)->PixelTexGenSGIX) +#define SET_PixelTexGenSGIX(disp, fn) ((disp)->PixelTexGenSGIX = fn) +#define CALL_BlendFuncSeparateEXT(disp, parameters) (*((disp)->BlendFuncSeparateEXT)) parameters +#define GET_BlendFuncSeparateEXT(disp) ((disp)->BlendFuncSeparateEXT) +#define SET_BlendFuncSeparateEXT(disp, fn) ((disp)->BlendFuncSeparateEXT = fn) +#define CALL_FlushVertexArrayRangeNV(disp, parameters) (*((disp)->FlushVertexArrayRangeNV)) parameters +#define GET_FlushVertexArrayRangeNV(disp) ((disp)->FlushVertexArrayRangeNV) +#define SET_FlushVertexArrayRangeNV(disp, fn) ((disp)->FlushVertexArrayRangeNV = fn) +#define CALL_VertexArrayRangeNV(disp, parameters) (*((disp)->VertexArrayRangeNV)) parameters +#define GET_VertexArrayRangeNV(disp) ((disp)->VertexArrayRangeNV) +#define SET_VertexArrayRangeNV(disp, fn) ((disp)->VertexArrayRangeNV = fn) +#define CALL_CombinerInputNV(disp, parameters) (*((disp)->CombinerInputNV)) parameters +#define GET_CombinerInputNV(disp) ((disp)->CombinerInputNV) +#define SET_CombinerInputNV(disp, fn) ((disp)->CombinerInputNV = fn) +#define CALL_CombinerOutputNV(disp, parameters) (*((disp)->CombinerOutputNV)) parameters +#define GET_CombinerOutputNV(disp) ((disp)->CombinerOutputNV) +#define SET_CombinerOutputNV(disp, fn) ((disp)->CombinerOutputNV = fn) +#define CALL_CombinerParameterfNV(disp, parameters) (*((disp)->CombinerParameterfNV)) parameters +#define GET_CombinerParameterfNV(disp) ((disp)->CombinerParameterfNV) +#define SET_CombinerParameterfNV(disp, fn) ((disp)->CombinerParameterfNV = fn) +#define CALL_CombinerParameterfvNV(disp, parameters) (*((disp)->CombinerParameterfvNV)) parameters +#define GET_CombinerParameterfvNV(disp) ((disp)->CombinerParameterfvNV) +#define SET_CombinerParameterfvNV(disp, fn) ((disp)->CombinerParameterfvNV = fn) +#define CALL_CombinerParameteriNV(disp, parameters) (*((disp)->CombinerParameteriNV)) parameters +#define GET_CombinerParameteriNV(disp) ((disp)->CombinerParameteriNV) +#define SET_CombinerParameteriNV(disp, fn) ((disp)->CombinerParameteriNV = fn) +#define CALL_CombinerParameterivNV(disp, parameters) (*((disp)->CombinerParameterivNV)) parameters +#define GET_CombinerParameterivNV(disp) ((disp)->CombinerParameterivNV) +#define SET_CombinerParameterivNV(disp, fn) ((disp)->CombinerParameterivNV = fn) +#define CALL_FinalCombinerInputNV(disp, parameters) (*((disp)->FinalCombinerInputNV)) parameters +#define GET_FinalCombinerInputNV(disp) ((disp)->FinalCombinerInputNV) +#define SET_FinalCombinerInputNV(disp, fn) ((disp)->FinalCombinerInputNV = fn) +#define CALL_GetCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetCombinerInputParameterfvNV)) parameters +#define GET_GetCombinerInputParameterfvNV(disp) ((disp)->GetCombinerInputParameterfvNV) +#define SET_GetCombinerInputParameterfvNV(disp, fn) ((disp)->GetCombinerInputParameterfvNV = fn) +#define CALL_GetCombinerInputParameterivNV(disp, parameters) (*((disp)->GetCombinerInputParameterivNV)) parameters +#define GET_GetCombinerInputParameterivNV(disp) ((disp)->GetCombinerInputParameterivNV) +#define SET_GetCombinerInputParameterivNV(disp, fn) ((disp)->GetCombinerInputParameterivNV = fn) +#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) (*((disp)->GetCombinerOutputParameterfvNV)) parameters +#define GET_GetCombinerOutputParameterfvNV(disp) ((disp)->GetCombinerOutputParameterfvNV) +#define SET_GetCombinerOutputParameterfvNV(disp, fn) ((disp)->GetCombinerOutputParameterfvNV = fn) +#define CALL_GetCombinerOutputParameterivNV(disp, parameters) (*((disp)->GetCombinerOutputParameterivNV)) parameters +#define GET_GetCombinerOutputParameterivNV(disp) ((disp)->GetCombinerOutputParameterivNV) +#define SET_GetCombinerOutputParameterivNV(disp, fn) ((disp)->GetCombinerOutputParameterivNV = fn) +#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterfvNV)) parameters +#define GET_GetFinalCombinerInputParameterfvNV(disp) ((disp)->GetFinalCombinerInputParameterfvNV) +#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) ((disp)->GetFinalCombinerInputParameterfvNV = fn) +#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterivNV)) parameters +#define GET_GetFinalCombinerInputParameterivNV(disp) ((disp)->GetFinalCombinerInputParameterivNV) +#define SET_GetFinalCombinerInputParameterivNV(disp, fn) ((disp)->GetFinalCombinerInputParameterivNV = fn) +#define CALL_ResizeBuffersMESA(disp, parameters) (*((disp)->ResizeBuffersMESA)) parameters +#define GET_ResizeBuffersMESA(disp) ((disp)->ResizeBuffersMESA) +#define SET_ResizeBuffersMESA(disp, fn) ((disp)->ResizeBuffersMESA = fn) +#define CALL_WindowPos2dMESA(disp, parameters) (*((disp)->WindowPos2dMESA)) parameters +#define GET_WindowPos2dMESA(disp) ((disp)->WindowPos2dMESA) +#define SET_WindowPos2dMESA(disp, fn) ((disp)->WindowPos2dMESA = fn) +#define CALL_WindowPos2dvMESA(disp, parameters) (*((disp)->WindowPos2dvMESA)) parameters +#define GET_WindowPos2dvMESA(disp) ((disp)->WindowPos2dvMESA) +#define SET_WindowPos2dvMESA(disp, fn) ((disp)->WindowPos2dvMESA = fn) +#define CALL_WindowPos2fMESA(disp, parameters) (*((disp)->WindowPos2fMESA)) parameters +#define GET_WindowPos2fMESA(disp) ((disp)->WindowPos2fMESA) +#define SET_WindowPos2fMESA(disp, fn) ((disp)->WindowPos2fMESA = fn) +#define CALL_WindowPos2fvMESA(disp, parameters) (*((disp)->WindowPos2fvMESA)) parameters +#define GET_WindowPos2fvMESA(disp) ((disp)->WindowPos2fvMESA) +#define SET_WindowPos2fvMESA(disp, fn) ((disp)->WindowPos2fvMESA = fn) +#define CALL_WindowPos2iMESA(disp, parameters) (*((disp)->WindowPos2iMESA)) parameters +#define GET_WindowPos2iMESA(disp) ((disp)->WindowPos2iMESA) +#define SET_WindowPos2iMESA(disp, fn) ((disp)->WindowPos2iMESA = fn) +#define CALL_WindowPos2ivMESA(disp, parameters) (*((disp)->WindowPos2ivMESA)) parameters +#define GET_WindowPos2ivMESA(disp) ((disp)->WindowPos2ivMESA) +#define SET_WindowPos2ivMESA(disp, fn) ((disp)->WindowPos2ivMESA = fn) +#define CALL_WindowPos2sMESA(disp, parameters) (*((disp)->WindowPos2sMESA)) parameters +#define GET_WindowPos2sMESA(disp) ((disp)->WindowPos2sMESA) +#define SET_WindowPos2sMESA(disp, fn) ((disp)->WindowPos2sMESA = fn) +#define CALL_WindowPos2svMESA(disp, parameters) (*((disp)->WindowPos2svMESA)) parameters +#define GET_WindowPos2svMESA(disp) ((disp)->WindowPos2svMESA) +#define SET_WindowPos2svMESA(disp, fn) ((disp)->WindowPos2svMESA = fn) +#define CALL_WindowPos3dMESA(disp, parameters) (*((disp)->WindowPos3dMESA)) parameters +#define GET_WindowPos3dMESA(disp) ((disp)->WindowPos3dMESA) +#define SET_WindowPos3dMESA(disp, fn) ((disp)->WindowPos3dMESA = fn) +#define CALL_WindowPos3dvMESA(disp, parameters) (*((disp)->WindowPos3dvMESA)) parameters +#define GET_WindowPos3dvMESA(disp) ((disp)->WindowPos3dvMESA) +#define SET_WindowPos3dvMESA(disp, fn) ((disp)->WindowPos3dvMESA = fn) +#define CALL_WindowPos3fMESA(disp, parameters) (*((disp)->WindowPos3fMESA)) parameters +#define GET_WindowPos3fMESA(disp) ((disp)->WindowPos3fMESA) +#define SET_WindowPos3fMESA(disp, fn) ((disp)->WindowPos3fMESA = fn) +#define CALL_WindowPos3fvMESA(disp, parameters) (*((disp)->WindowPos3fvMESA)) parameters +#define GET_WindowPos3fvMESA(disp) ((disp)->WindowPos3fvMESA) +#define SET_WindowPos3fvMESA(disp, fn) ((disp)->WindowPos3fvMESA = fn) +#define CALL_WindowPos3iMESA(disp, parameters) (*((disp)->WindowPos3iMESA)) parameters +#define GET_WindowPos3iMESA(disp) ((disp)->WindowPos3iMESA) +#define SET_WindowPos3iMESA(disp, fn) ((disp)->WindowPos3iMESA = fn) +#define CALL_WindowPos3ivMESA(disp, parameters) (*((disp)->WindowPos3ivMESA)) parameters +#define GET_WindowPos3ivMESA(disp) ((disp)->WindowPos3ivMESA) +#define SET_WindowPos3ivMESA(disp, fn) ((disp)->WindowPos3ivMESA = fn) +#define CALL_WindowPos3sMESA(disp, parameters) (*((disp)->WindowPos3sMESA)) parameters +#define GET_WindowPos3sMESA(disp) ((disp)->WindowPos3sMESA) +#define SET_WindowPos3sMESA(disp, fn) ((disp)->WindowPos3sMESA = fn) +#define CALL_WindowPos3svMESA(disp, parameters) (*((disp)->WindowPos3svMESA)) parameters +#define GET_WindowPos3svMESA(disp) ((disp)->WindowPos3svMESA) +#define SET_WindowPos3svMESA(disp, fn) ((disp)->WindowPos3svMESA = fn) +#define CALL_WindowPos4dMESA(disp, parameters) (*((disp)->WindowPos4dMESA)) parameters +#define GET_WindowPos4dMESA(disp) ((disp)->WindowPos4dMESA) +#define SET_WindowPos4dMESA(disp, fn) ((disp)->WindowPos4dMESA = fn) +#define CALL_WindowPos4dvMESA(disp, parameters) (*((disp)->WindowPos4dvMESA)) parameters +#define GET_WindowPos4dvMESA(disp) ((disp)->WindowPos4dvMESA) +#define SET_WindowPos4dvMESA(disp, fn) ((disp)->WindowPos4dvMESA = fn) +#define CALL_WindowPos4fMESA(disp, parameters) (*((disp)->WindowPos4fMESA)) parameters +#define GET_WindowPos4fMESA(disp) ((disp)->WindowPos4fMESA) +#define SET_WindowPos4fMESA(disp, fn) ((disp)->WindowPos4fMESA = fn) +#define CALL_WindowPos4fvMESA(disp, parameters) (*((disp)->WindowPos4fvMESA)) parameters +#define GET_WindowPos4fvMESA(disp) ((disp)->WindowPos4fvMESA) +#define SET_WindowPos4fvMESA(disp, fn) ((disp)->WindowPos4fvMESA = fn) +#define CALL_WindowPos4iMESA(disp, parameters) (*((disp)->WindowPos4iMESA)) parameters +#define GET_WindowPos4iMESA(disp) ((disp)->WindowPos4iMESA) +#define SET_WindowPos4iMESA(disp, fn) ((disp)->WindowPos4iMESA = fn) +#define CALL_WindowPos4ivMESA(disp, parameters) (*((disp)->WindowPos4ivMESA)) parameters +#define GET_WindowPos4ivMESA(disp) ((disp)->WindowPos4ivMESA) +#define SET_WindowPos4ivMESA(disp, fn) ((disp)->WindowPos4ivMESA = fn) +#define CALL_WindowPos4sMESA(disp, parameters) (*((disp)->WindowPos4sMESA)) parameters +#define GET_WindowPos4sMESA(disp) ((disp)->WindowPos4sMESA) +#define SET_WindowPos4sMESA(disp, fn) ((disp)->WindowPos4sMESA = fn) +#define CALL_WindowPos4svMESA(disp, parameters) (*((disp)->WindowPos4svMESA)) parameters +#define GET_WindowPos4svMESA(disp) ((disp)->WindowPos4svMESA) +#define SET_WindowPos4svMESA(disp, fn) ((disp)->WindowPos4svMESA = fn) +#define CALL_MultiModeDrawArraysIBM(disp, parameters) (*((disp)->MultiModeDrawArraysIBM)) parameters +#define GET_MultiModeDrawArraysIBM(disp) ((disp)->MultiModeDrawArraysIBM) +#define SET_MultiModeDrawArraysIBM(disp, fn) ((disp)->MultiModeDrawArraysIBM = fn) +#define CALL_MultiModeDrawElementsIBM(disp, parameters) (*((disp)->MultiModeDrawElementsIBM)) parameters +#define GET_MultiModeDrawElementsIBM(disp) ((disp)->MultiModeDrawElementsIBM) +#define SET_MultiModeDrawElementsIBM(disp, fn) ((disp)->MultiModeDrawElementsIBM = fn) +#define CALL_DeleteFencesNV(disp, parameters) (*((disp)->DeleteFencesNV)) parameters +#define GET_DeleteFencesNV(disp) ((disp)->DeleteFencesNV) +#define SET_DeleteFencesNV(disp, fn) ((disp)->DeleteFencesNV = fn) +#define CALL_FinishFenceNV(disp, parameters) (*((disp)->FinishFenceNV)) parameters +#define GET_FinishFenceNV(disp) ((disp)->FinishFenceNV) +#define SET_FinishFenceNV(disp, fn) ((disp)->FinishFenceNV = fn) +#define CALL_GenFencesNV(disp, parameters) (*((disp)->GenFencesNV)) parameters +#define GET_GenFencesNV(disp) ((disp)->GenFencesNV) +#define SET_GenFencesNV(disp, fn) ((disp)->GenFencesNV = fn) +#define CALL_GetFenceivNV(disp, parameters) (*((disp)->GetFenceivNV)) parameters +#define GET_GetFenceivNV(disp) ((disp)->GetFenceivNV) +#define SET_GetFenceivNV(disp, fn) ((disp)->GetFenceivNV = fn) +#define CALL_IsFenceNV(disp, parameters) (*((disp)->IsFenceNV)) parameters +#define GET_IsFenceNV(disp) ((disp)->IsFenceNV) +#define SET_IsFenceNV(disp, fn) ((disp)->IsFenceNV = fn) +#define CALL_SetFenceNV(disp, parameters) (*((disp)->SetFenceNV)) parameters +#define GET_SetFenceNV(disp) ((disp)->SetFenceNV) +#define SET_SetFenceNV(disp, fn) ((disp)->SetFenceNV = fn) +#define CALL_TestFenceNV(disp, parameters) (*((disp)->TestFenceNV)) parameters +#define GET_TestFenceNV(disp) ((disp)->TestFenceNV) +#define SET_TestFenceNV(disp, fn) ((disp)->TestFenceNV = fn) +#define CALL_AreProgramsResidentNV(disp, parameters) (*((disp)->AreProgramsResidentNV)) parameters +#define GET_AreProgramsResidentNV(disp) ((disp)->AreProgramsResidentNV) +#define SET_AreProgramsResidentNV(disp, fn) ((disp)->AreProgramsResidentNV = fn) +#define CALL_BindProgramNV(disp, parameters) (*((disp)->BindProgramNV)) parameters +#define GET_BindProgramNV(disp) ((disp)->BindProgramNV) +#define SET_BindProgramNV(disp, fn) ((disp)->BindProgramNV = fn) +#define CALL_DeleteProgramsNV(disp, parameters) (*((disp)->DeleteProgramsNV)) parameters +#define GET_DeleteProgramsNV(disp) ((disp)->DeleteProgramsNV) +#define SET_DeleteProgramsNV(disp, fn) ((disp)->DeleteProgramsNV = fn) +#define CALL_ExecuteProgramNV(disp, parameters) (*((disp)->ExecuteProgramNV)) parameters +#define GET_ExecuteProgramNV(disp) ((disp)->ExecuteProgramNV) +#define SET_ExecuteProgramNV(disp, fn) ((disp)->ExecuteProgramNV = fn) +#define CALL_GenProgramsNV(disp, parameters) (*((disp)->GenProgramsNV)) parameters +#define GET_GenProgramsNV(disp) ((disp)->GenProgramsNV) +#define SET_GenProgramsNV(disp, fn) ((disp)->GenProgramsNV = fn) +#define CALL_GetProgramParameterdvNV(disp, parameters) (*((disp)->GetProgramParameterdvNV)) parameters +#define GET_GetProgramParameterdvNV(disp) ((disp)->GetProgramParameterdvNV) +#define SET_GetProgramParameterdvNV(disp, fn) ((disp)->GetProgramParameterdvNV = fn) +#define CALL_GetProgramParameterfvNV(disp, parameters) (*((disp)->GetProgramParameterfvNV)) parameters +#define GET_GetProgramParameterfvNV(disp) ((disp)->GetProgramParameterfvNV) +#define SET_GetProgramParameterfvNV(disp, fn) ((disp)->GetProgramParameterfvNV = fn) +#define CALL_GetProgramStringNV(disp, parameters) (*((disp)->GetProgramStringNV)) parameters +#define GET_GetProgramStringNV(disp) ((disp)->GetProgramStringNV) +#define SET_GetProgramStringNV(disp, fn) ((disp)->GetProgramStringNV = fn) +#define CALL_GetProgramivNV(disp, parameters) (*((disp)->GetProgramivNV)) parameters +#define GET_GetProgramivNV(disp) ((disp)->GetProgramivNV) +#define SET_GetProgramivNV(disp, fn) ((disp)->GetProgramivNV = fn) +#define CALL_GetTrackMatrixivNV(disp, parameters) (*((disp)->GetTrackMatrixivNV)) parameters +#define GET_GetTrackMatrixivNV(disp) ((disp)->GetTrackMatrixivNV) +#define SET_GetTrackMatrixivNV(disp, fn) ((disp)->GetTrackMatrixivNV = fn) +#define CALL_GetVertexAttribPointervNV(disp, parameters) (*((disp)->GetVertexAttribPointervNV)) parameters +#define GET_GetVertexAttribPointervNV(disp) ((disp)->GetVertexAttribPointervNV) +#define SET_GetVertexAttribPointervNV(disp, fn) ((disp)->GetVertexAttribPointervNV = fn) +#define CALL_GetVertexAttribdvNV(disp, parameters) (*((disp)->GetVertexAttribdvNV)) parameters +#define GET_GetVertexAttribdvNV(disp) ((disp)->GetVertexAttribdvNV) +#define SET_GetVertexAttribdvNV(disp, fn) ((disp)->GetVertexAttribdvNV = fn) +#define CALL_GetVertexAttribfvNV(disp, parameters) (*((disp)->GetVertexAttribfvNV)) parameters +#define GET_GetVertexAttribfvNV(disp) ((disp)->GetVertexAttribfvNV) +#define SET_GetVertexAttribfvNV(disp, fn) ((disp)->GetVertexAttribfvNV = fn) +#define CALL_GetVertexAttribivNV(disp, parameters) (*((disp)->GetVertexAttribivNV)) parameters +#define GET_GetVertexAttribivNV(disp) ((disp)->GetVertexAttribivNV) +#define SET_GetVertexAttribivNV(disp, fn) ((disp)->GetVertexAttribivNV = fn) +#define CALL_IsProgramNV(disp, parameters) (*((disp)->IsProgramNV)) parameters +#define GET_IsProgramNV(disp) ((disp)->IsProgramNV) +#define SET_IsProgramNV(disp, fn) ((disp)->IsProgramNV = fn) +#define CALL_LoadProgramNV(disp, parameters) (*((disp)->LoadProgramNV)) parameters +#define GET_LoadProgramNV(disp) ((disp)->LoadProgramNV) +#define SET_LoadProgramNV(disp, fn) ((disp)->LoadProgramNV = fn) +#define CALL_ProgramParameters4dvNV(disp, parameters) (*((disp)->ProgramParameters4dvNV)) parameters +#define GET_ProgramParameters4dvNV(disp) ((disp)->ProgramParameters4dvNV) +#define SET_ProgramParameters4dvNV(disp, fn) ((disp)->ProgramParameters4dvNV = fn) +#define CALL_ProgramParameters4fvNV(disp, parameters) (*((disp)->ProgramParameters4fvNV)) parameters +#define GET_ProgramParameters4fvNV(disp) ((disp)->ProgramParameters4fvNV) +#define SET_ProgramParameters4fvNV(disp, fn) ((disp)->ProgramParameters4fvNV = fn) +#define CALL_RequestResidentProgramsNV(disp, parameters) (*((disp)->RequestResidentProgramsNV)) parameters +#define GET_RequestResidentProgramsNV(disp) ((disp)->RequestResidentProgramsNV) +#define SET_RequestResidentProgramsNV(disp, fn) ((disp)->RequestResidentProgramsNV = fn) +#define CALL_TrackMatrixNV(disp, parameters) (*((disp)->TrackMatrixNV)) parameters +#define GET_TrackMatrixNV(disp) ((disp)->TrackMatrixNV) +#define SET_TrackMatrixNV(disp, fn) ((disp)->TrackMatrixNV = fn) +#define CALL_VertexAttrib1dNV(disp, parameters) (*((disp)->VertexAttrib1dNV)) parameters +#define GET_VertexAttrib1dNV(disp) ((disp)->VertexAttrib1dNV) +#define SET_VertexAttrib1dNV(disp, fn) ((disp)->VertexAttrib1dNV = fn) +#define CALL_VertexAttrib1dvNV(disp, parameters) (*((disp)->VertexAttrib1dvNV)) parameters +#define GET_VertexAttrib1dvNV(disp) ((disp)->VertexAttrib1dvNV) +#define SET_VertexAttrib1dvNV(disp, fn) ((disp)->VertexAttrib1dvNV = fn) +#define CALL_VertexAttrib1fNV(disp, parameters) (*((disp)->VertexAttrib1fNV)) parameters +#define GET_VertexAttrib1fNV(disp) ((disp)->VertexAttrib1fNV) +#define SET_VertexAttrib1fNV(disp, fn) ((disp)->VertexAttrib1fNV = fn) +#define CALL_VertexAttrib1fvNV(disp, parameters) (*((disp)->VertexAttrib1fvNV)) parameters +#define GET_VertexAttrib1fvNV(disp) ((disp)->VertexAttrib1fvNV) +#define SET_VertexAttrib1fvNV(disp, fn) ((disp)->VertexAttrib1fvNV = fn) +#define CALL_VertexAttrib1sNV(disp, parameters) (*((disp)->VertexAttrib1sNV)) parameters +#define GET_VertexAttrib1sNV(disp) ((disp)->VertexAttrib1sNV) +#define SET_VertexAttrib1sNV(disp, fn) ((disp)->VertexAttrib1sNV = fn) +#define CALL_VertexAttrib1svNV(disp, parameters) (*((disp)->VertexAttrib1svNV)) parameters +#define GET_VertexAttrib1svNV(disp) ((disp)->VertexAttrib1svNV) +#define SET_VertexAttrib1svNV(disp, fn) ((disp)->VertexAttrib1svNV = fn) +#define CALL_VertexAttrib2dNV(disp, parameters) (*((disp)->VertexAttrib2dNV)) parameters +#define GET_VertexAttrib2dNV(disp) ((disp)->VertexAttrib2dNV) +#define SET_VertexAttrib2dNV(disp, fn) ((disp)->VertexAttrib2dNV = fn) +#define CALL_VertexAttrib2dvNV(disp, parameters) (*((disp)->VertexAttrib2dvNV)) parameters +#define GET_VertexAttrib2dvNV(disp) ((disp)->VertexAttrib2dvNV) +#define SET_VertexAttrib2dvNV(disp, fn) ((disp)->VertexAttrib2dvNV = fn) +#define CALL_VertexAttrib2fNV(disp, parameters) (*((disp)->VertexAttrib2fNV)) parameters +#define GET_VertexAttrib2fNV(disp) ((disp)->VertexAttrib2fNV) +#define SET_VertexAttrib2fNV(disp, fn) ((disp)->VertexAttrib2fNV = fn) +#define CALL_VertexAttrib2fvNV(disp, parameters) (*((disp)->VertexAttrib2fvNV)) parameters +#define GET_VertexAttrib2fvNV(disp) ((disp)->VertexAttrib2fvNV) +#define SET_VertexAttrib2fvNV(disp, fn) ((disp)->VertexAttrib2fvNV = fn) +#define CALL_VertexAttrib2sNV(disp, parameters) (*((disp)->VertexAttrib2sNV)) parameters +#define GET_VertexAttrib2sNV(disp) ((disp)->VertexAttrib2sNV) +#define SET_VertexAttrib2sNV(disp, fn) ((disp)->VertexAttrib2sNV = fn) +#define CALL_VertexAttrib2svNV(disp, parameters) (*((disp)->VertexAttrib2svNV)) parameters +#define GET_VertexAttrib2svNV(disp) ((disp)->VertexAttrib2svNV) +#define SET_VertexAttrib2svNV(disp, fn) ((disp)->VertexAttrib2svNV = fn) +#define CALL_VertexAttrib3dNV(disp, parameters) (*((disp)->VertexAttrib3dNV)) parameters +#define GET_VertexAttrib3dNV(disp) ((disp)->VertexAttrib3dNV) +#define SET_VertexAttrib3dNV(disp, fn) ((disp)->VertexAttrib3dNV = fn) +#define CALL_VertexAttrib3dvNV(disp, parameters) (*((disp)->VertexAttrib3dvNV)) parameters +#define GET_VertexAttrib3dvNV(disp) ((disp)->VertexAttrib3dvNV) +#define SET_VertexAttrib3dvNV(disp, fn) ((disp)->VertexAttrib3dvNV = fn) +#define CALL_VertexAttrib3fNV(disp, parameters) (*((disp)->VertexAttrib3fNV)) parameters +#define GET_VertexAttrib3fNV(disp) ((disp)->VertexAttrib3fNV) +#define SET_VertexAttrib3fNV(disp, fn) ((disp)->VertexAttrib3fNV = fn) +#define CALL_VertexAttrib3fvNV(disp, parameters) (*((disp)->VertexAttrib3fvNV)) parameters +#define GET_VertexAttrib3fvNV(disp) ((disp)->VertexAttrib3fvNV) +#define SET_VertexAttrib3fvNV(disp, fn) ((disp)->VertexAttrib3fvNV = fn) +#define CALL_VertexAttrib3sNV(disp, parameters) (*((disp)->VertexAttrib3sNV)) parameters +#define GET_VertexAttrib3sNV(disp) ((disp)->VertexAttrib3sNV) +#define SET_VertexAttrib3sNV(disp, fn) ((disp)->VertexAttrib3sNV = fn) +#define CALL_VertexAttrib3svNV(disp, parameters) (*((disp)->VertexAttrib3svNV)) parameters +#define GET_VertexAttrib3svNV(disp) ((disp)->VertexAttrib3svNV) +#define SET_VertexAttrib3svNV(disp, fn) ((disp)->VertexAttrib3svNV = fn) +#define CALL_VertexAttrib4dNV(disp, parameters) (*((disp)->VertexAttrib4dNV)) parameters +#define GET_VertexAttrib4dNV(disp) ((disp)->VertexAttrib4dNV) +#define SET_VertexAttrib4dNV(disp, fn) ((disp)->VertexAttrib4dNV = fn) +#define CALL_VertexAttrib4dvNV(disp, parameters) (*((disp)->VertexAttrib4dvNV)) parameters +#define GET_VertexAttrib4dvNV(disp) ((disp)->VertexAttrib4dvNV) +#define SET_VertexAttrib4dvNV(disp, fn) ((disp)->VertexAttrib4dvNV = fn) +#define CALL_VertexAttrib4fNV(disp, parameters) (*((disp)->VertexAttrib4fNV)) parameters +#define GET_VertexAttrib4fNV(disp) ((disp)->VertexAttrib4fNV) +#define SET_VertexAttrib4fNV(disp, fn) ((disp)->VertexAttrib4fNV = fn) +#define CALL_VertexAttrib4fvNV(disp, parameters) (*((disp)->VertexAttrib4fvNV)) parameters +#define GET_VertexAttrib4fvNV(disp) ((disp)->VertexAttrib4fvNV) +#define SET_VertexAttrib4fvNV(disp, fn) ((disp)->VertexAttrib4fvNV = fn) +#define CALL_VertexAttrib4sNV(disp, parameters) (*((disp)->VertexAttrib4sNV)) parameters +#define GET_VertexAttrib4sNV(disp) ((disp)->VertexAttrib4sNV) +#define SET_VertexAttrib4sNV(disp, fn) ((disp)->VertexAttrib4sNV = fn) +#define CALL_VertexAttrib4svNV(disp, parameters) (*((disp)->VertexAttrib4svNV)) parameters +#define GET_VertexAttrib4svNV(disp) ((disp)->VertexAttrib4svNV) +#define SET_VertexAttrib4svNV(disp, fn) ((disp)->VertexAttrib4svNV = fn) +#define CALL_VertexAttrib4ubNV(disp, parameters) (*((disp)->VertexAttrib4ubNV)) parameters +#define GET_VertexAttrib4ubNV(disp) ((disp)->VertexAttrib4ubNV) +#define SET_VertexAttrib4ubNV(disp, fn) ((disp)->VertexAttrib4ubNV = fn) +#define CALL_VertexAttrib4ubvNV(disp, parameters) (*((disp)->VertexAttrib4ubvNV)) parameters +#define GET_VertexAttrib4ubvNV(disp) ((disp)->VertexAttrib4ubvNV) +#define SET_VertexAttrib4ubvNV(disp, fn) ((disp)->VertexAttrib4ubvNV = fn) +#define CALL_VertexAttribPointerNV(disp, parameters) (*((disp)->VertexAttribPointerNV)) parameters +#define GET_VertexAttribPointerNV(disp) ((disp)->VertexAttribPointerNV) +#define SET_VertexAttribPointerNV(disp, fn) ((disp)->VertexAttribPointerNV = fn) +#define CALL_VertexAttribs1dvNV(disp, parameters) (*((disp)->VertexAttribs1dvNV)) parameters +#define GET_VertexAttribs1dvNV(disp) ((disp)->VertexAttribs1dvNV) +#define SET_VertexAttribs1dvNV(disp, fn) ((disp)->VertexAttribs1dvNV = fn) +#define CALL_VertexAttribs1fvNV(disp, parameters) (*((disp)->VertexAttribs1fvNV)) parameters +#define GET_VertexAttribs1fvNV(disp) ((disp)->VertexAttribs1fvNV) +#define SET_VertexAttribs1fvNV(disp, fn) ((disp)->VertexAttribs1fvNV = fn) +#define CALL_VertexAttribs1svNV(disp, parameters) (*((disp)->VertexAttribs1svNV)) parameters +#define GET_VertexAttribs1svNV(disp) ((disp)->VertexAttribs1svNV) +#define SET_VertexAttribs1svNV(disp, fn) ((disp)->VertexAttribs1svNV = fn) +#define CALL_VertexAttribs2dvNV(disp, parameters) (*((disp)->VertexAttribs2dvNV)) parameters +#define GET_VertexAttribs2dvNV(disp) ((disp)->VertexAttribs2dvNV) +#define SET_VertexAttribs2dvNV(disp, fn) ((disp)->VertexAttribs2dvNV = fn) +#define CALL_VertexAttribs2fvNV(disp, parameters) (*((disp)->VertexAttribs2fvNV)) parameters +#define GET_VertexAttribs2fvNV(disp) ((disp)->VertexAttribs2fvNV) +#define SET_VertexAttribs2fvNV(disp, fn) ((disp)->VertexAttribs2fvNV = fn) +#define CALL_VertexAttribs2svNV(disp, parameters) (*((disp)->VertexAttribs2svNV)) parameters +#define GET_VertexAttribs2svNV(disp) ((disp)->VertexAttribs2svNV) +#define SET_VertexAttribs2svNV(disp, fn) ((disp)->VertexAttribs2svNV = fn) +#define CALL_VertexAttribs3dvNV(disp, parameters) (*((disp)->VertexAttribs3dvNV)) parameters +#define GET_VertexAttribs3dvNV(disp) ((disp)->VertexAttribs3dvNV) +#define SET_VertexAttribs3dvNV(disp, fn) ((disp)->VertexAttribs3dvNV = fn) +#define CALL_VertexAttribs3fvNV(disp, parameters) (*((disp)->VertexAttribs3fvNV)) parameters +#define GET_VertexAttribs3fvNV(disp) ((disp)->VertexAttribs3fvNV) +#define SET_VertexAttribs3fvNV(disp, fn) ((disp)->VertexAttribs3fvNV = fn) +#define CALL_VertexAttribs3svNV(disp, parameters) (*((disp)->VertexAttribs3svNV)) parameters +#define GET_VertexAttribs3svNV(disp) ((disp)->VertexAttribs3svNV) +#define SET_VertexAttribs3svNV(disp, fn) ((disp)->VertexAttribs3svNV = fn) +#define CALL_VertexAttribs4dvNV(disp, parameters) (*((disp)->VertexAttribs4dvNV)) parameters +#define GET_VertexAttribs4dvNV(disp) ((disp)->VertexAttribs4dvNV) +#define SET_VertexAttribs4dvNV(disp, fn) ((disp)->VertexAttribs4dvNV = fn) +#define CALL_VertexAttribs4fvNV(disp, parameters) (*((disp)->VertexAttribs4fvNV)) parameters +#define GET_VertexAttribs4fvNV(disp) ((disp)->VertexAttribs4fvNV) +#define SET_VertexAttribs4fvNV(disp, fn) ((disp)->VertexAttribs4fvNV = fn) +#define CALL_VertexAttribs4svNV(disp, parameters) (*((disp)->VertexAttribs4svNV)) parameters +#define GET_VertexAttribs4svNV(disp) ((disp)->VertexAttribs4svNV) +#define SET_VertexAttribs4svNV(disp, fn) ((disp)->VertexAttribs4svNV = fn) +#define CALL_VertexAttribs4ubvNV(disp, parameters) (*((disp)->VertexAttribs4ubvNV)) parameters +#define GET_VertexAttribs4ubvNV(disp) ((disp)->VertexAttribs4ubvNV) +#define SET_VertexAttribs4ubvNV(disp, fn) ((disp)->VertexAttribs4ubvNV = fn) +#define CALL_GetTexBumpParameterfvATI(disp, parameters) (*((disp)->GetTexBumpParameterfvATI)) parameters +#define GET_GetTexBumpParameterfvATI(disp) ((disp)->GetTexBumpParameterfvATI) +#define SET_GetTexBumpParameterfvATI(disp, fn) ((disp)->GetTexBumpParameterfvATI = fn) +#define CALL_GetTexBumpParameterivATI(disp, parameters) (*((disp)->GetTexBumpParameterivATI)) parameters +#define GET_GetTexBumpParameterivATI(disp) ((disp)->GetTexBumpParameterivATI) +#define SET_GetTexBumpParameterivATI(disp, fn) ((disp)->GetTexBumpParameterivATI = fn) +#define CALL_TexBumpParameterfvATI(disp, parameters) (*((disp)->TexBumpParameterfvATI)) parameters +#define GET_TexBumpParameterfvATI(disp) ((disp)->TexBumpParameterfvATI) +#define SET_TexBumpParameterfvATI(disp, fn) ((disp)->TexBumpParameterfvATI = fn) +#define CALL_TexBumpParameterivATI(disp, parameters) (*((disp)->TexBumpParameterivATI)) parameters +#define GET_TexBumpParameterivATI(disp) ((disp)->TexBumpParameterivATI) +#define SET_TexBumpParameterivATI(disp, fn) ((disp)->TexBumpParameterivATI = fn) +#define CALL_AlphaFragmentOp1ATI(disp, parameters) (*((disp)->AlphaFragmentOp1ATI)) parameters +#define GET_AlphaFragmentOp1ATI(disp) ((disp)->AlphaFragmentOp1ATI) +#define SET_AlphaFragmentOp1ATI(disp, fn) ((disp)->AlphaFragmentOp1ATI = fn) +#define CALL_AlphaFragmentOp2ATI(disp, parameters) (*((disp)->AlphaFragmentOp2ATI)) parameters +#define GET_AlphaFragmentOp2ATI(disp) ((disp)->AlphaFragmentOp2ATI) +#define SET_AlphaFragmentOp2ATI(disp, fn) ((disp)->AlphaFragmentOp2ATI = fn) +#define CALL_AlphaFragmentOp3ATI(disp, parameters) (*((disp)->AlphaFragmentOp3ATI)) parameters +#define GET_AlphaFragmentOp3ATI(disp) ((disp)->AlphaFragmentOp3ATI) +#define SET_AlphaFragmentOp3ATI(disp, fn) ((disp)->AlphaFragmentOp3ATI = fn) +#define CALL_BeginFragmentShaderATI(disp, parameters) (*((disp)->BeginFragmentShaderATI)) parameters +#define GET_BeginFragmentShaderATI(disp) ((disp)->BeginFragmentShaderATI) +#define SET_BeginFragmentShaderATI(disp, fn) ((disp)->BeginFragmentShaderATI = fn) +#define CALL_BindFragmentShaderATI(disp, parameters) (*((disp)->BindFragmentShaderATI)) parameters +#define GET_BindFragmentShaderATI(disp) ((disp)->BindFragmentShaderATI) +#define SET_BindFragmentShaderATI(disp, fn) ((disp)->BindFragmentShaderATI = fn) +#define CALL_ColorFragmentOp1ATI(disp, parameters) (*((disp)->ColorFragmentOp1ATI)) parameters +#define GET_ColorFragmentOp1ATI(disp) ((disp)->ColorFragmentOp1ATI) +#define SET_ColorFragmentOp1ATI(disp, fn) ((disp)->ColorFragmentOp1ATI = fn) +#define CALL_ColorFragmentOp2ATI(disp, parameters) (*((disp)->ColorFragmentOp2ATI)) parameters +#define GET_ColorFragmentOp2ATI(disp) ((disp)->ColorFragmentOp2ATI) +#define SET_ColorFragmentOp2ATI(disp, fn) ((disp)->ColorFragmentOp2ATI = fn) +#define CALL_ColorFragmentOp3ATI(disp, parameters) (*((disp)->ColorFragmentOp3ATI)) parameters +#define GET_ColorFragmentOp3ATI(disp) ((disp)->ColorFragmentOp3ATI) +#define SET_ColorFragmentOp3ATI(disp, fn) ((disp)->ColorFragmentOp3ATI = fn) +#define CALL_DeleteFragmentShaderATI(disp, parameters) (*((disp)->DeleteFragmentShaderATI)) parameters +#define GET_DeleteFragmentShaderATI(disp) ((disp)->DeleteFragmentShaderATI) +#define SET_DeleteFragmentShaderATI(disp, fn) ((disp)->DeleteFragmentShaderATI = fn) +#define CALL_EndFragmentShaderATI(disp, parameters) (*((disp)->EndFragmentShaderATI)) parameters +#define GET_EndFragmentShaderATI(disp) ((disp)->EndFragmentShaderATI) +#define SET_EndFragmentShaderATI(disp, fn) ((disp)->EndFragmentShaderATI = fn) +#define CALL_GenFragmentShadersATI(disp, parameters) (*((disp)->GenFragmentShadersATI)) parameters +#define GET_GenFragmentShadersATI(disp) ((disp)->GenFragmentShadersATI) +#define SET_GenFragmentShadersATI(disp, fn) ((disp)->GenFragmentShadersATI = fn) +#define CALL_PassTexCoordATI(disp, parameters) (*((disp)->PassTexCoordATI)) parameters +#define GET_PassTexCoordATI(disp) ((disp)->PassTexCoordATI) +#define SET_PassTexCoordATI(disp, fn) ((disp)->PassTexCoordATI = fn) +#define CALL_SampleMapATI(disp, parameters) (*((disp)->SampleMapATI)) parameters +#define GET_SampleMapATI(disp) ((disp)->SampleMapATI) +#define SET_SampleMapATI(disp, fn) ((disp)->SampleMapATI = fn) +#define CALL_SetFragmentShaderConstantATI(disp, parameters) (*((disp)->SetFragmentShaderConstantATI)) parameters +#define GET_SetFragmentShaderConstantATI(disp) ((disp)->SetFragmentShaderConstantATI) +#define SET_SetFragmentShaderConstantATI(disp, fn) ((disp)->SetFragmentShaderConstantATI = fn) +#define CALL_PointParameteriNV(disp, parameters) (*((disp)->PointParameteriNV)) parameters +#define GET_PointParameteriNV(disp) ((disp)->PointParameteriNV) +#define SET_PointParameteriNV(disp, fn) ((disp)->PointParameteriNV = fn) +#define CALL_PointParameterivNV(disp, parameters) (*((disp)->PointParameterivNV)) parameters +#define GET_PointParameterivNV(disp) ((disp)->PointParameterivNV) +#define SET_PointParameterivNV(disp, fn) ((disp)->PointParameterivNV = fn) +#define CALL_ActiveStencilFaceEXT(disp, parameters) (*((disp)->ActiveStencilFaceEXT)) parameters +#define GET_ActiveStencilFaceEXT(disp) ((disp)->ActiveStencilFaceEXT) +#define SET_ActiveStencilFaceEXT(disp, fn) ((disp)->ActiveStencilFaceEXT = fn) +#define CALL_BindVertexArrayAPPLE(disp, parameters) (*((disp)->BindVertexArrayAPPLE)) parameters +#define GET_BindVertexArrayAPPLE(disp) ((disp)->BindVertexArrayAPPLE) +#define SET_BindVertexArrayAPPLE(disp, fn) ((disp)->BindVertexArrayAPPLE = fn) +#define CALL_DeleteVertexArraysAPPLE(disp, parameters) (*((disp)->DeleteVertexArraysAPPLE)) parameters +#define GET_DeleteVertexArraysAPPLE(disp) ((disp)->DeleteVertexArraysAPPLE) +#define SET_DeleteVertexArraysAPPLE(disp, fn) ((disp)->DeleteVertexArraysAPPLE = fn) +#define CALL_GenVertexArraysAPPLE(disp, parameters) (*((disp)->GenVertexArraysAPPLE)) parameters +#define GET_GenVertexArraysAPPLE(disp) ((disp)->GenVertexArraysAPPLE) +#define SET_GenVertexArraysAPPLE(disp, fn) ((disp)->GenVertexArraysAPPLE = fn) +#define CALL_IsVertexArrayAPPLE(disp, parameters) (*((disp)->IsVertexArrayAPPLE)) parameters +#define GET_IsVertexArrayAPPLE(disp) ((disp)->IsVertexArrayAPPLE) +#define SET_IsVertexArrayAPPLE(disp, fn) ((disp)->IsVertexArrayAPPLE = fn) +#define CALL_GetProgramNamedParameterdvNV(disp, parameters) (*((disp)->GetProgramNamedParameterdvNV)) parameters +#define GET_GetProgramNamedParameterdvNV(disp) ((disp)->GetProgramNamedParameterdvNV) +#define SET_GetProgramNamedParameterdvNV(disp, fn) ((disp)->GetProgramNamedParameterdvNV = fn) +#define CALL_GetProgramNamedParameterfvNV(disp, parameters) (*((disp)->GetProgramNamedParameterfvNV)) parameters +#define GET_GetProgramNamedParameterfvNV(disp) ((disp)->GetProgramNamedParameterfvNV) +#define SET_GetProgramNamedParameterfvNV(disp, fn) ((disp)->GetProgramNamedParameterfvNV = fn) +#define CALL_ProgramNamedParameter4dNV(disp, parameters) (*((disp)->ProgramNamedParameter4dNV)) parameters +#define GET_ProgramNamedParameter4dNV(disp) ((disp)->ProgramNamedParameter4dNV) +#define SET_ProgramNamedParameter4dNV(disp, fn) ((disp)->ProgramNamedParameter4dNV = fn) +#define CALL_ProgramNamedParameter4dvNV(disp, parameters) (*((disp)->ProgramNamedParameter4dvNV)) parameters +#define GET_ProgramNamedParameter4dvNV(disp) ((disp)->ProgramNamedParameter4dvNV) +#define SET_ProgramNamedParameter4dvNV(disp, fn) ((disp)->ProgramNamedParameter4dvNV = fn) +#define CALL_ProgramNamedParameter4fNV(disp, parameters) (*((disp)->ProgramNamedParameter4fNV)) parameters +#define GET_ProgramNamedParameter4fNV(disp) ((disp)->ProgramNamedParameter4fNV) +#define SET_ProgramNamedParameter4fNV(disp, fn) ((disp)->ProgramNamedParameter4fNV = fn) +#define CALL_ProgramNamedParameter4fvNV(disp, parameters) (*((disp)->ProgramNamedParameter4fvNV)) parameters +#define GET_ProgramNamedParameter4fvNV(disp) ((disp)->ProgramNamedParameter4fvNV) +#define SET_ProgramNamedParameter4fvNV(disp, fn) ((disp)->ProgramNamedParameter4fvNV = fn) +#define CALL_DepthBoundsEXT(disp, parameters) (*((disp)->DepthBoundsEXT)) parameters +#define GET_DepthBoundsEXT(disp) ((disp)->DepthBoundsEXT) +#define SET_DepthBoundsEXT(disp, fn) ((disp)->DepthBoundsEXT = fn) +#define CALL_BlendEquationSeparateEXT(disp, parameters) (*((disp)->BlendEquationSeparateEXT)) parameters +#define GET_BlendEquationSeparateEXT(disp) ((disp)->BlendEquationSeparateEXT) +#define SET_BlendEquationSeparateEXT(disp, fn) ((disp)->BlendEquationSeparateEXT = fn) +#define CALL_BindFramebufferEXT(disp, parameters) (*((disp)->BindFramebufferEXT)) parameters +#define GET_BindFramebufferEXT(disp) ((disp)->BindFramebufferEXT) +#define SET_BindFramebufferEXT(disp, fn) ((disp)->BindFramebufferEXT = fn) +#define CALL_BindRenderbufferEXT(disp, parameters) (*((disp)->BindRenderbufferEXT)) parameters +#define GET_BindRenderbufferEXT(disp) ((disp)->BindRenderbufferEXT) +#define SET_BindRenderbufferEXT(disp, fn) ((disp)->BindRenderbufferEXT = fn) +#define CALL_CheckFramebufferStatusEXT(disp, parameters) (*((disp)->CheckFramebufferStatusEXT)) parameters +#define GET_CheckFramebufferStatusEXT(disp) ((disp)->CheckFramebufferStatusEXT) +#define SET_CheckFramebufferStatusEXT(disp, fn) ((disp)->CheckFramebufferStatusEXT = fn) +#define CALL_DeleteFramebuffersEXT(disp, parameters) (*((disp)->DeleteFramebuffersEXT)) parameters +#define GET_DeleteFramebuffersEXT(disp) ((disp)->DeleteFramebuffersEXT) +#define SET_DeleteFramebuffersEXT(disp, fn) ((disp)->DeleteFramebuffersEXT = fn) +#define CALL_DeleteRenderbuffersEXT(disp, parameters) (*((disp)->DeleteRenderbuffersEXT)) parameters +#define GET_DeleteRenderbuffersEXT(disp) ((disp)->DeleteRenderbuffersEXT) +#define SET_DeleteRenderbuffersEXT(disp, fn) ((disp)->DeleteRenderbuffersEXT = fn) +#define CALL_FramebufferRenderbufferEXT(disp, parameters) (*((disp)->FramebufferRenderbufferEXT)) parameters +#define GET_FramebufferRenderbufferEXT(disp) ((disp)->FramebufferRenderbufferEXT) +#define SET_FramebufferRenderbufferEXT(disp, fn) ((disp)->FramebufferRenderbufferEXT = fn) +#define CALL_FramebufferTexture1DEXT(disp, parameters) (*((disp)->FramebufferTexture1DEXT)) parameters +#define GET_FramebufferTexture1DEXT(disp) ((disp)->FramebufferTexture1DEXT) +#define SET_FramebufferTexture1DEXT(disp, fn) ((disp)->FramebufferTexture1DEXT = fn) +#define CALL_FramebufferTexture2DEXT(disp, parameters) (*((disp)->FramebufferTexture2DEXT)) parameters +#define GET_FramebufferTexture2DEXT(disp) ((disp)->FramebufferTexture2DEXT) +#define SET_FramebufferTexture2DEXT(disp, fn) ((disp)->FramebufferTexture2DEXT = fn) +#define CALL_FramebufferTexture3DEXT(disp, parameters) (*((disp)->FramebufferTexture3DEXT)) parameters +#define GET_FramebufferTexture3DEXT(disp) ((disp)->FramebufferTexture3DEXT) +#define SET_FramebufferTexture3DEXT(disp, fn) ((disp)->FramebufferTexture3DEXT = fn) +#define CALL_GenFramebuffersEXT(disp, parameters) (*((disp)->GenFramebuffersEXT)) parameters +#define GET_GenFramebuffersEXT(disp) ((disp)->GenFramebuffersEXT) +#define SET_GenFramebuffersEXT(disp, fn) ((disp)->GenFramebuffersEXT = fn) +#define CALL_GenRenderbuffersEXT(disp, parameters) (*((disp)->GenRenderbuffersEXT)) parameters +#define GET_GenRenderbuffersEXT(disp) ((disp)->GenRenderbuffersEXT) +#define SET_GenRenderbuffersEXT(disp, fn) ((disp)->GenRenderbuffersEXT = fn) +#define CALL_GenerateMipmapEXT(disp, parameters) (*((disp)->GenerateMipmapEXT)) parameters +#define GET_GenerateMipmapEXT(disp) ((disp)->GenerateMipmapEXT) +#define SET_GenerateMipmapEXT(disp, fn) ((disp)->GenerateMipmapEXT = fn) +#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters +#define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT) +#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn) +#define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters +#define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT) +#define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn) +#define CALL_IsFramebufferEXT(disp, parameters) (*((disp)->IsFramebufferEXT)) parameters +#define GET_IsFramebufferEXT(disp) ((disp)->IsFramebufferEXT) +#define SET_IsFramebufferEXT(disp, fn) ((disp)->IsFramebufferEXT = fn) +#define CALL_IsRenderbufferEXT(disp, parameters) (*((disp)->IsRenderbufferEXT)) parameters +#define GET_IsRenderbufferEXT(disp) ((disp)->IsRenderbufferEXT) +#define SET_IsRenderbufferEXT(disp, fn) ((disp)->IsRenderbufferEXT = fn) +#define CALL_RenderbufferStorageEXT(disp, parameters) (*((disp)->RenderbufferStorageEXT)) parameters +#define GET_RenderbufferStorageEXT(disp) ((disp)->RenderbufferStorageEXT) +#define SET_RenderbufferStorageEXT(disp, fn) ((disp)->RenderbufferStorageEXT = fn) +#define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters +#define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT) +#define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn) +#define CALL_BufferParameteriAPPLE(disp, parameters) (*((disp)->BufferParameteriAPPLE)) parameters +#define GET_BufferParameteriAPPLE(disp) ((disp)->BufferParameteriAPPLE) +#define SET_BufferParameteriAPPLE(disp, fn) ((disp)->BufferParameteriAPPLE = fn) +#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) (*((disp)->FlushMappedBufferRangeAPPLE)) parameters +#define GET_FlushMappedBufferRangeAPPLE(disp) ((disp)->FlushMappedBufferRangeAPPLE) +#define SET_FlushMappedBufferRangeAPPLE(disp, fn) ((disp)->FlushMappedBufferRangeAPPLE = fn) +#define CALL_FramebufferTextureLayerEXT(disp, parameters) (*((disp)->FramebufferTextureLayerEXT)) parameters +#define GET_FramebufferTextureLayerEXT(disp) ((disp)->FramebufferTextureLayerEXT) +#define SET_FramebufferTextureLayerEXT(disp, fn) ((disp)->FramebufferTextureLayerEXT = fn) +#define CALL_ProvokingVertexEXT(disp, parameters) (*((disp)->ProvokingVertexEXT)) parameters +#define GET_ProvokingVertexEXT(disp) ((disp)->ProvokingVertexEXT) +#define SET_ProvokingVertexEXT(disp, fn) ((disp)->ProvokingVertexEXT = fn) +#define CALL_GetTexParameterPointervAPPLE(disp, parameters) (*((disp)->GetTexParameterPointervAPPLE)) parameters +#define GET_GetTexParameterPointervAPPLE(disp) ((disp)->GetTexParameterPointervAPPLE) +#define SET_GetTexParameterPointervAPPLE(disp, fn) ((disp)->GetTexParameterPointervAPPLE = fn) +#define CALL_TextureRangeAPPLE(disp, parameters) (*((disp)->TextureRangeAPPLE)) parameters +#define GET_TextureRangeAPPLE(disp) ((disp)->TextureRangeAPPLE) +#define SET_TextureRangeAPPLE(disp, fn) ((disp)->TextureRangeAPPLE = fn) +#define CALL_StencilFuncSeparateATI(disp, parameters) (*((disp)->StencilFuncSeparateATI)) parameters +#define GET_StencilFuncSeparateATI(disp) ((disp)->StencilFuncSeparateATI) +#define SET_StencilFuncSeparateATI(disp, fn) ((disp)->StencilFuncSeparateATI = fn) +#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters +#define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT) +#define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn) +#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters +#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT) +#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters +#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) +#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters +#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) +#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) + +#else + +#define driDispatchRemapTable_size 387 +extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; + +#define AttachShader_remap_index 0 +#define CreateProgram_remap_index 1 +#define CreateShader_remap_index 2 +#define DeleteProgram_remap_index 3 +#define DeleteShader_remap_index 4 +#define DetachShader_remap_index 5 +#define GetAttachedShaders_remap_index 6 +#define GetProgramInfoLog_remap_index 7 +#define GetProgramiv_remap_index 8 +#define GetShaderInfoLog_remap_index 9 +#define GetShaderiv_remap_index 10 +#define IsProgram_remap_index 11 +#define IsShader_remap_index 12 +#define StencilFuncSeparate_remap_index 13 +#define StencilMaskSeparate_remap_index 14 +#define StencilOpSeparate_remap_index 15 +#define UniformMatrix2x3fv_remap_index 16 +#define UniformMatrix2x4fv_remap_index 17 +#define UniformMatrix3x2fv_remap_index 18 +#define UniformMatrix3x4fv_remap_index 19 +#define UniformMatrix4x2fv_remap_index 20 +#define UniformMatrix4x3fv_remap_index 21 +#define LoadTransposeMatrixdARB_remap_index 22 +#define LoadTransposeMatrixfARB_remap_index 23 +#define MultTransposeMatrixdARB_remap_index 24 +#define MultTransposeMatrixfARB_remap_index 25 +#define SampleCoverageARB_remap_index 26 +#define CompressedTexImage1DARB_remap_index 27 +#define CompressedTexImage2DARB_remap_index 28 +#define CompressedTexImage3DARB_remap_index 29 +#define CompressedTexSubImage1DARB_remap_index 30 +#define CompressedTexSubImage2DARB_remap_index 31 +#define CompressedTexSubImage3DARB_remap_index 32 +#define GetCompressedTexImageARB_remap_index 33 +#define DisableVertexAttribArrayARB_remap_index 34 +#define EnableVertexAttribArrayARB_remap_index 35 +#define GetProgramEnvParameterdvARB_remap_index 36 +#define GetProgramEnvParameterfvARB_remap_index 37 +#define GetProgramLocalParameterdvARB_remap_index 38 +#define GetProgramLocalParameterfvARB_remap_index 39 +#define GetProgramStringARB_remap_index 40 +#define GetProgramivARB_remap_index 41 +#define GetVertexAttribdvARB_remap_index 42 +#define GetVertexAttribfvARB_remap_index 43 +#define GetVertexAttribivARB_remap_index 44 +#define ProgramEnvParameter4dARB_remap_index 45 +#define ProgramEnvParameter4dvARB_remap_index 46 +#define ProgramEnvParameter4fARB_remap_index 47 +#define ProgramEnvParameter4fvARB_remap_index 48 +#define ProgramLocalParameter4dARB_remap_index 49 +#define ProgramLocalParameter4dvARB_remap_index 50 +#define ProgramLocalParameter4fARB_remap_index 51 +#define ProgramLocalParameter4fvARB_remap_index 52 +#define ProgramStringARB_remap_index 53 +#define VertexAttrib1dARB_remap_index 54 +#define VertexAttrib1dvARB_remap_index 55 +#define VertexAttrib1fARB_remap_index 56 +#define VertexAttrib1fvARB_remap_index 57 +#define VertexAttrib1sARB_remap_index 58 +#define VertexAttrib1svARB_remap_index 59 +#define VertexAttrib2dARB_remap_index 60 +#define VertexAttrib2dvARB_remap_index 61 +#define VertexAttrib2fARB_remap_index 62 +#define VertexAttrib2fvARB_remap_index 63 +#define VertexAttrib2sARB_remap_index 64 +#define VertexAttrib2svARB_remap_index 65 +#define VertexAttrib3dARB_remap_index 66 +#define VertexAttrib3dvARB_remap_index 67 +#define VertexAttrib3fARB_remap_index 68 +#define VertexAttrib3fvARB_remap_index 69 +#define VertexAttrib3sARB_remap_index 70 +#define VertexAttrib3svARB_remap_index 71 +#define VertexAttrib4NbvARB_remap_index 72 +#define VertexAttrib4NivARB_remap_index 73 +#define VertexAttrib4NsvARB_remap_index 74 +#define VertexAttrib4NubARB_remap_index 75 +#define VertexAttrib4NubvARB_remap_index 76 +#define VertexAttrib4NuivARB_remap_index 77 +#define VertexAttrib4NusvARB_remap_index 78 +#define VertexAttrib4bvARB_remap_index 79 +#define VertexAttrib4dARB_remap_index 80 +#define VertexAttrib4dvARB_remap_index 81 +#define VertexAttrib4fARB_remap_index 82 +#define VertexAttrib4fvARB_remap_index 83 +#define VertexAttrib4ivARB_remap_index 84 +#define VertexAttrib4sARB_remap_index 85 +#define VertexAttrib4svARB_remap_index 86 +#define VertexAttrib4ubvARB_remap_index 87 +#define VertexAttrib4uivARB_remap_index 88 +#define VertexAttrib4usvARB_remap_index 89 +#define VertexAttribPointerARB_remap_index 90 +#define BindBufferARB_remap_index 91 +#define BufferDataARB_remap_index 92 +#define BufferSubDataARB_remap_index 93 +#define DeleteBuffersARB_remap_index 94 +#define GenBuffersARB_remap_index 95 +#define GetBufferParameterivARB_remap_index 96 +#define GetBufferPointervARB_remap_index 97 +#define GetBufferSubDataARB_remap_index 98 +#define IsBufferARB_remap_index 99 +#define MapBufferARB_remap_index 100 +#define UnmapBufferARB_remap_index 101 +#define BeginQueryARB_remap_index 102 +#define DeleteQueriesARB_remap_index 103 +#define EndQueryARB_remap_index 104 +#define GenQueriesARB_remap_index 105 +#define GetQueryObjectivARB_remap_index 106 +#define GetQueryObjectuivARB_remap_index 107 +#define GetQueryivARB_remap_index 108 +#define IsQueryARB_remap_index 109 +#define AttachObjectARB_remap_index 110 +#define CompileShaderARB_remap_index 111 +#define CreateProgramObjectARB_remap_index 112 +#define CreateShaderObjectARB_remap_index 113 +#define DeleteObjectARB_remap_index 114 +#define DetachObjectARB_remap_index 115 +#define GetActiveUniformARB_remap_index 116 +#define GetAttachedObjectsARB_remap_index 117 +#define GetHandleARB_remap_index 118 +#define GetInfoLogARB_remap_index 119 +#define GetObjectParameterfvARB_remap_index 120 +#define GetObjectParameterivARB_remap_index 121 +#define GetShaderSourceARB_remap_index 122 +#define GetUniformLocationARB_remap_index 123 +#define GetUniformfvARB_remap_index 124 +#define GetUniformivARB_remap_index 125 +#define LinkProgramARB_remap_index 126 +#define ShaderSourceARB_remap_index 127 +#define Uniform1fARB_remap_index 128 +#define Uniform1fvARB_remap_index 129 +#define Uniform1iARB_remap_index 130 +#define Uniform1ivARB_remap_index 131 +#define Uniform2fARB_remap_index 132 +#define Uniform2fvARB_remap_index 133 +#define Uniform2iARB_remap_index 134 +#define Uniform2ivARB_remap_index 135 +#define Uniform3fARB_remap_index 136 +#define Uniform3fvARB_remap_index 137 +#define Uniform3iARB_remap_index 138 +#define Uniform3ivARB_remap_index 139 +#define Uniform4fARB_remap_index 140 +#define Uniform4fvARB_remap_index 141 +#define Uniform4iARB_remap_index 142 +#define Uniform4ivARB_remap_index 143 +#define UniformMatrix2fvARB_remap_index 144 +#define UniformMatrix3fvARB_remap_index 145 +#define UniformMatrix4fvARB_remap_index 146 +#define UseProgramObjectARB_remap_index 147 +#define ValidateProgramARB_remap_index 148 +#define BindAttribLocationARB_remap_index 149 +#define GetActiveAttribARB_remap_index 150 +#define GetAttribLocationARB_remap_index 151 +#define DrawBuffersARB_remap_index 152 +#define RenderbufferStorageMultisample_remap_index 153 +#define FlushMappedBufferRange_remap_index 154 +#define MapBufferRange_remap_index 155 +#define BindVertexArray_remap_index 156 +#define GenVertexArrays_remap_index 157 +#define CopyBufferSubData_remap_index 158 +#define ClientWaitSync_remap_index 159 +#define DeleteSync_remap_index 160 +#define FenceSync_remap_index 161 +#define GetInteger64v_remap_index 162 +#define GetSynciv_remap_index 163 +#define IsSync_remap_index 164 +#define WaitSync_remap_index 165 +#define DrawElementsBaseVertex_remap_index 166 +#define DrawRangeElementsBaseVertex_remap_index 167 +#define MultiDrawElementsBaseVertex_remap_index 168 +#define PolygonOffsetEXT_remap_index 169 +#define GetPixelTexGenParameterfvSGIS_remap_index 170 +#define GetPixelTexGenParameterivSGIS_remap_index 171 +#define PixelTexGenParameterfSGIS_remap_index 172 +#define PixelTexGenParameterfvSGIS_remap_index 173 +#define PixelTexGenParameteriSGIS_remap_index 174 +#define PixelTexGenParameterivSGIS_remap_index 175 +#define SampleMaskSGIS_remap_index 176 +#define SamplePatternSGIS_remap_index 177 +#define ColorPointerEXT_remap_index 178 +#define EdgeFlagPointerEXT_remap_index 179 +#define IndexPointerEXT_remap_index 180 +#define NormalPointerEXT_remap_index 181 +#define TexCoordPointerEXT_remap_index 182 +#define VertexPointerEXT_remap_index 183 +#define PointParameterfEXT_remap_index 184 +#define PointParameterfvEXT_remap_index 185 +#define LockArraysEXT_remap_index 186 +#define UnlockArraysEXT_remap_index 187 +#define CullParameterdvEXT_remap_index 188 +#define CullParameterfvEXT_remap_index 189 +#define SecondaryColor3bEXT_remap_index 190 +#define SecondaryColor3bvEXT_remap_index 191 +#define SecondaryColor3dEXT_remap_index 192 +#define SecondaryColor3dvEXT_remap_index 193 +#define SecondaryColor3fEXT_remap_index 194 +#define SecondaryColor3fvEXT_remap_index 195 +#define SecondaryColor3iEXT_remap_index 196 +#define SecondaryColor3ivEXT_remap_index 197 +#define SecondaryColor3sEXT_remap_index 198 +#define SecondaryColor3svEXT_remap_index 199 +#define SecondaryColor3ubEXT_remap_index 200 +#define SecondaryColor3ubvEXT_remap_index 201 +#define SecondaryColor3uiEXT_remap_index 202 +#define SecondaryColor3uivEXT_remap_index 203 +#define SecondaryColor3usEXT_remap_index 204 +#define SecondaryColor3usvEXT_remap_index 205 +#define SecondaryColorPointerEXT_remap_index 206 +#define MultiDrawArraysEXT_remap_index 207 +#define MultiDrawElementsEXT_remap_index 208 +#define FogCoordPointerEXT_remap_index 209 +#define FogCoorddEXT_remap_index 210 +#define FogCoorddvEXT_remap_index 211 +#define FogCoordfEXT_remap_index 212 +#define FogCoordfvEXT_remap_index 213 +#define PixelTexGenSGIX_remap_index 214 +#define BlendFuncSeparateEXT_remap_index 215 +#define FlushVertexArrayRangeNV_remap_index 216 +#define VertexArrayRangeNV_remap_index 217 +#define CombinerInputNV_remap_index 218 +#define CombinerOutputNV_remap_index 219 +#define CombinerParameterfNV_remap_index 220 +#define CombinerParameterfvNV_remap_index 221 +#define CombinerParameteriNV_remap_index 222 +#define CombinerParameterivNV_remap_index 223 +#define FinalCombinerInputNV_remap_index 224 +#define GetCombinerInputParameterfvNV_remap_index 225 +#define GetCombinerInputParameterivNV_remap_index 226 +#define GetCombinerOutputParameterfvNV_remap_index 227 +#define GetCombinerOutputParameterivNV_remap_index 228 +#define GetFinalCombinerInputParameterfvNV_remap_index 229 +#define GetFinalCombinerInputParameterivNV_remap_index 230 +#define ResizeBuffersMESA_remap_index 231 +#define WindowPos2dMESA_remap_index 232 +#define WindowPos2dvMESA_remap_index 233 +#define WindowPos2fMESA_remap_index 234 +#define WindowPos2fvMESA_remap_index 235 +#define WindowPos2iMESA_remap_index 236 +#define WindowPos2ivMESA_remap_index 237 +#define WindowPos2sMESA_remap_index 238 +#define WindowPos2svMESA_remap_index 239 +#define WindowPos3dMESA_remap_index 240 +#define WindowPos3dvMESA_remap_index 241 +#define WindowPos3fMESA_remap_index 242 +#define WindowPos3fvMESA_remap_index 243 +#define WindowPos3iMESA_remap_index 244 +#define WindowPos3ivMESA_remap_index 245 +#define WindowPos3sMESA_remap_index 246 +#define WindowPos3svMESA_remap_index 247 +#define WindowPos4dMESA_remap_index 248 +#define WindowPos4dvMESA_remap_index 249 +#define WindowPos4fMESA_remap_index 250 +#define WindowPos4fvMESA_remap_index 251 +#define WindowPos4iMESA_remap_index 252 +#define WindowPos4ivMESA_remap_index 253 +#define WindowPos4sMESA_remap_index 254 +#define WindowPos4svMESA_remap_index 255 +#define MultiModeDrawArraysIBM_remap_index 256 +#define MultiModeDrawElementsIBM_remap_index 257 +#define DeleteFencesNV_remap_index 258 +#define FinishFenceNV_remap_index 259 +#define GenFencesNV_remap_index 260 +#define GetFenceivNV_remap_index 261 +#define IsFenceNV_remap_index 262 +#define SetFenceNV_remap_index 263 +#define TestFenceNV_remap_index 264 +#define AreProgramsResidentNV_remap_index 265 +#define BindProgramNV_remap_index 266 +#define DeleteProgramsNV_remap_index 267 +#define ExecuteProgramNV_remap_index 268 +#define GenProgramsNV_remap_index 269 +#define GetProgramParameterdvNV_remap_index 270 +#define GetProgramParameterfvNV_remap_index 271 +#define GetProgramStringNV_remap_index 272 +#define GetProgramivNV_remap_index 273 +#define GetTrackMatrixivNV_remap_index 274 +#define GetVertexAttribPointervNV_remap_index 275 +#define GetVertexAttribdvNV_remap_index 276 +#define GetVertexAttribfvNV_remap_index 277 +#define GetVertexAttribivNV_remap_index 278 +#define IsProgramNV_remap_index 279 +#define LoadProgramNV_remap_index 280 +#define ProgramParameters4dvNV_remap_index 281 +#define ProgramParameters4fvNV_remap_index 282 +#define RequestResidentProgramsNV_remap_index 283 +#define TrackMatrixNV_remap_index 284 +#define VertexAttrib1dNV_remap_index 285 +#define VertexAttrib1dvNV_remap_index 286 +#define VertexAttrib1fNV_remap_index 287 +#define VertexAttrib1fvNV_remap_index 288 +#define VertexAttrib1sNV_remap_index 289 +#define VertexAttrib1svNV_remap_index 290 +#define VertexAttrib2dNV_remap_index 291 +#define VertexAttrib2dvNV_remap_index 292 +#define VertexAttrib2fNV_remap_index 293 +#define VertexAttrib2fvNV_remap_index 294 +#define VertexAttrib2sNV_remap_index 295 +#define VertexAttrib2svNV_remap_index 296 +#define VertexAttrib3dNV_remap_index 297 +#define VertexAttrib3dvNV_remap_index 298 +#define VertexAttrib3fNV_remap_index 299 +#define VertexAttrib3fvNV_remap_index 300 +#define VertexAttrib3sNV_remap_index 301 +#define VertexAttrib3svNV_remap_index 302 +#define VertexAttrib4dNV_remap_index 303 +#define VertexAttrib4dvNV_remap_index 304 +#define VertexAttrib4fNV_remap_index 305 +#define VertexAttrib4fvNV_remap_index 306 +#define VertexAttrib4sNV_remap_index 307 +#define VertexAttrib4svNV_remap_index 308 +#define VertexAttrib4ubNV_remap_index 309 +#define VertexAttrib4ubvNV_remap_index 310 +#define VertexAttribPointerNV_remap_index 311 +#define VertexAttribs1dvNV_remap_index 312 +#define VertexAttribs1fvNV_remap_index 313 +#define VertexAttribs1svNV_remap_index 314 +#define VertexAttribs2dvNV_remap_index 315 +#define VertexAttribs2fvNV_remap_index 316 +#define VertexAttribs2svNV_remap_index 317 +#define VertexAttribs3dvNV_remap_index 318 +#define VertexAttribs3fvNV_remap_index 319 +#define VertexAttribs3svNV_remap_index 320 +#define VertexAttribs4dvNV_remap_index 321 +#define VertexAttribs4fvNV_remap_index 322 +#define VertexAttribs4svNV_remap_index 323 +#define VertexAttribs4ubvNV_remap_index 324 +#define GetTexBumpParameterfvATI_remap_index 325 +#define GetTexBumpParameterivATI_remap_index 326 +#define TexBumpParameterfvATI_remap_index 327 +#define TexBumpParameterivATI_remap_index 328 +#define AlphaFragmentOp1ATI_remap_index 329 +#define AlphaFragmentOp2ATI_remap_index 330 +#define AlphaFragmentOp3ATI_remap_index 331 +#define BeginFragmentShaderATI_remap_index 332 +#define BindFragmentShaderATI_remap_index 333 +#define ColorFragmentOp1ATI_remap_index 334 +#define ColorFragmentOp2ATI_remap_index 335 +#define ColorFragmentOp3ATI_remap_index 336 +#define DeleteFragmentShaderATI_remap_index 337 +#define EndFragmentShaderATI_remap_index 338 +#define GenFragmentShadersATI_remap_index 339 +#define PassTexCoordATI_remap_index 340 +#define SampleMapATI_remap_index 341 +#define SetFragmentShaderConstantATI_remap_index 342 +#define PointParameteriNV_remap_index 343 +#define PointParameterivNV_remap_index 344 +#define ActiveStencilFaceEXT_remap_index 345 +#define BindVertexArrayAPPLE_remap_index 346 +#define DeleteVertexArraysAPPLE_remap_index 347 +#define GenVertexArraysAPPLE_remap_index 348 +#define IsVertexArrayAPPLE_remap_index 349 +#define GetProgramNamedParameterdvNV_remap_index 350 +#define GetProgramNamedParameterfvNV_remap_index 351 +#define ProgramNamedParameter4dNV_remap_index 352 +#define ProgramNamedParameter4dvNV_remap_index 353 +#define ProgramNamedParameter4fNV_remap_index 354 +#define ProgramNamedParameter4fvNV_remap_index 355 +#define DepthBoundsEXT_remap_index 356 +#define BlendEquationSeparateEXT_remap_index 357 +#define BindFramebufferEXT_remap_index 358 +#define BindRenderbufferEXT_remap_index 359 +#define CheckFramebufferStatusEXT_remap_index 360 +#define DeleteFramebuffersEXT_remap_index 361 +#define DeleteRenderbuffersEXT_remap_index 362 +#define FramebufferRenderbufferEXT_remap_index 363 +#define FramebufferTexture1DEXT_remap_index 364 +#define FramebufferTexture2DEXT_remap_index 365 +#define FramebufferTexture3DEXT_remap_index 366 +#define GenFramebuffersEXT_remap_index 367 +#define GenRenderbuffersEXT_remap_index 368 +#define GenerateMipmapEXT_remap_index 369 +#define GetFramebufferAttachmentParameterivEXT_remap_index 370 +#define GetRenderbufferParameterivEXT_remap_index 371 +#define IsFramebufferEXT_remap_index 372 +#define IsRenderbufferEXT_remap_index 373 +#define RenderbufferStorageEXT_remap_index 374 +#define BlitFramebufferEXT_remap_index 375 +#define BufferParameteriAPPLE_remap_index 376 +#define FlushMappedBufferRangeAPPLE_remap_index 377 +#define FramebufferTextureLayerEXT_remap_index 378 +#define ProvokingVertexEXT_remap_index 379 +#define GetTexParameterPointervAPPLE_remap_index 380 +#define TextureRangeAPPLE_remap_index 381 +#define StencilFuncSeparateATI_remap_index 382 +#define ProgramEnvParameters4fvEXT_remap_index 383 +#define ProgramLocalParameters4fvEXT_remap_index 384 +#define GetQueryObjecti64vEXT_remap_index 385 +#define GetQueryObjectui64vEXT_remap_index 386 + +#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) +#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) +#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn) +#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters) +#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index]) +#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn) +#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters) +#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index]) +#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn) +#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters) +#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index]) +#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn) +#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters) +#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index]) +#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn) +#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters) +#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index]) +#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn) +#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters) +#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index]) +#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn) +#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters) +#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index]) +#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn) +#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters) +#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index]) +#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn) +#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters) +#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index]) +#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn) +#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters) +#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index]) +#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn) +#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters) +#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index]) +#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn) +#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters) +#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index]) +#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn) +#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) +#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) +#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) +#define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) +#define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) +#define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) +#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) +#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) +#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) +#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters) +#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index]) +#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn) +#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters) +#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index]) +#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn) +#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters) +#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index]) +#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn) +#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters) +#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index]) +#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn) +#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters) +#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index]) +#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn) +#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters) +#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index]) +#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn) +#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) +#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) +#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) +#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) +#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) +#define SET_LoadTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], fn) +#define CALL_MultTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], parameters) +#define GET_MultTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]) +#define SET_MultTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], fn) +#define CALL_MultTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], parameters) +#define GET_MultTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index]) +#define SET_MultTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], fn) +#define CALL_SampleCoverageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleCoverageARB_remap_index], parameters) +#define GET_SampleCoverageARB(disp) GET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index]) +#define SET_SampleCoverageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index], fn) +#define CALL_CompressedTexImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage1DARB_remap_index], parameters) +#define GET_CompressedTexImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index]) +#define SET_CompressedTexImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index], fn) +#define CALL_CompressedTexImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage2DARB_remap_index], parameters) +#define GET_CompressedTexImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index]) +#define SET_CompressedTexImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index], fn) +#define CALL_CompressedTexImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage3DARB_remap_index], parameters) +#define GET_CompressedTexImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index]) +#define SET_CompressedTexImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index], fn) +#define CALL_CompressedTexSubImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], parameters) +#define GET_CompressedTexSubImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index]) +#define SET_CompressedTexSubImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], fn) +#define CALL_CompressedTexSubImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], parameters) +#define GET_CompressedTexSubImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index]) +#define SET_CompressedTexSubImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], fn) +#define CALL_CompressedTexSubImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], parameters) +#define GET_CompressedTexSubImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index]) +#define SET_CompressedTexSubImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], fn) +#define CALL_GetCompressedTexImageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLvoid *)), driDispatchRemapTable[GetCompressedTexImageARB_remap_index], parameters) +#define GET_GetCompressedTexImageARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index]) +#define SET_GetCompressedTexImageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index], fn) +#define CALL_DisableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], parameters) +#define GET_DisableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index]) +#define SET_DisableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], fn) +#define CALL_EnableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], parameters) +#define GET_EnableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index]) +#define SET_EnableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], fn) +#define CALL_GetProgramEnvParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], parameters) +#define GET_GetProgramEnvParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index]) +#define SET_GetProgramEnvParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], fn) +#define CALL_GetProgramEnvParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], parameters) +#define GET_GetProgramEnvParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index]) +#define SET_GetProgramEnvParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], fn) +#define CALL_GetProgramLocalParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], parameters) +#define GET_GetProgramLocalParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index]) +#define SET_GetProgramLocalParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], fn) +#define CALL_GetProgramLocalParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], parameters) +#define GET_GetProgramLocalParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index]) +#define SET_GetProgramLocalParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], fn) +#define CALL_GetProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetProgramStringARB_remap_index], parameters) +#define GET_GetProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index]) +#define SET_GetProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index], fn) +#define CALL_GetProgramivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetProgramivARB_remap_index], parameters) +#define GET_GetProgramivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index]) +#define SET_GetProgramivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index], fn) +#define CALL_GetVertexAttribdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvARB_remap_index], parameters) +#define GET_GetVertexAttribdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index]) +#define SET_GetVertexAttribdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index], fn) +#define CALL_GetVertexAttribfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvARB_remap_index], parameters) +#define GET_GetVertexAttribfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index]) +#define SET_GetVertexAttribfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index], fn) +#define CALL_GetVertexAttribivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivARB_remap_index], parameters) +#define GET_GetVertexAttribivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index]) +#define SET_GetVertexAttribivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index], fn) +#define CALL_ProgramEnvParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], parameters) +#define GET_ProgramEnvParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index]) +#define SET_ProgramEnvParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], fn) +#define CALL_ProgramEnvParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], parameters) +#define GET_ProgramEnvParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index]) +#define SET_ProgramEnvParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], fn) +#define CALL_ProgramEnvParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], parameters) +#define GET_ProgramEnvParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index]) +#define SET_ProgramEnvParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], fn) +#define CALL_ProgramEnvParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], parameters) +#define GET_ProgramEnvParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index]) +#define SET_ProgramEnvParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], fn) +#define CALL_ProgramLocalParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], parameters) +#define GET_ProgramLocalParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index]) +#define SET_ProgramLocalParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], fn) +#define CALL_ProgramLocalParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], parameters) +#define GET_ProgramLocalParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index]) +#define SET_ProgramLocalParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], fn) +#define CALL_ProgramLocalParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], parameters) +#define GET_ProgramLocalParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index]) +#define SET_ProgramLocalParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], fn) +#define CALL_ProgramLocalParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], parameters) +#define GET_ProgramLocalParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index]) +#define SET_ProgramLocalParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], fn) +#define CALL_ProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[ProgramStringARB_remap_index], parameters) +#define GET_ProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index]) +#define SET_ProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index], fn) +#define CALL_VertexAttrib1dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dARB_remap_index], parameters) +#define GET_VertexAttrib1dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index]) +#define SET_VertexAttrib1dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index], fn) +#define CALL_VertexAttrib1dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvARB_remap_index], parameters) +#define GET_VertexAttrib1dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index]) +#define SET_VertexAttrib1dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index], fn) +#define CALL_VertexAttrib1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fARB_remap_index], parameters) +#define GET_VertexAttrib1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index]) +#define SET_VertexAttrib1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index], fn) +#define CALL_VertexAttrib1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvARB_remap_index], parameters) +#define GET_VertexAttrib1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index]) +#define SET_VertexAttrib1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index], fn) +#define CALL_VertexAttrib1sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sARB_remap_index], parameters) +#define GET_VertexAttrib1sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index]) +#define SET_VertexAttrib1sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index], fn) +#define CALL_VertexAttrib1svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svARB_remap_index], parameters) +#define GET_VertexAttrib1svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index]) +#define SET_VertexAttrib1svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index], fn) +#define CALL_VertexAttrib2dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dARB_remap_index], parameters) +#define GET_VertexAttrib2dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index]) +#define SET_VertexAttrib2dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index], fn) +#define CALL_VertexAttrib2dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvARB_remap_index], parameters) +#define GET_VertexAttrib2dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index]) +#define SET_VertexAttrib2dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index], fn) +#define CALL_VertexAttrib2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fARB_remap_index], parameters) +#define GET_VertexAttrib2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index]) +#define SET_VertexAttrib2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index], fn) +#define CALL_VertexAttrib2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvARB_remap_index], parameters) +#define GET_VertexAttrib2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index]) +#define SET_VertexAttrib2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index], fn) +#define CALL_VertexAttrib2sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sARB_remap_index], parameters) +#define GET_VertexAttrib2sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index]) +#define SET_VertexAttrib2sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index], fn) +#define CALL_VertexAttrib2svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svARB_remap_index], parameters) +#define GET_VertexAttrib2svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index]) +#define SET_VertexAttrib2svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index], fn) +#define CALL_VertexAttrib3dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dARB_remap_index], parameters) +#define GET_VertexAttrib3dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index]) +#define SET_VertexAttrib3dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index], fn) +#define CALL_VertexAttrib3dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvARB_remap_index], parameters) +#define GET_VertexAttrib3dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index]) +#define SET_VertexAttrib3dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index], fn) +#define CALL_VertexAttrib3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fARB_remap_index], parameters) +#define GET_VertexAttrib3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index]) +#define SET_VertexAttrib3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index], fn) +#define CALL_VertexAttrib3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvARB_remap_index], parameters) +#define GET_VertexAttrib3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index]) +#define SET_VertexAttrib3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index], fn) +#define CALL_VertexAttrib3sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sARB_remap_index], parameters) +#define GET_VertexAttrib3sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index]) +#define SET_VertexAttrib3sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index], fn) +#define CALL_VertexAttrib3svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svARB_remap_index], parameters) +#define GET_VertexAttrib3svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index]) +#define SET_VertexAttrib3svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index], fn) +#define CALL_VertexAttrib4NbvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], parameters) +#define GET_VertexAttrib4NbvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index]) +#define SET_VertexAttrib4NbvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], fn) +#define CALL_VertexAttrib4NivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4NivARB_remap_index], parameters) +#define GET_VertexAttrib4NivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index]) +#define SET_VertexAttrib4NivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index], fn) +#define CALL_VertexAttrib4NsvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], parameters) +#define GET_VertexAttrib4NsvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index]) +#define SET_VertexAttrib4NsvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], fn) +#define CALL_VertexAttrib4NubARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4NubARB_remap_index], parameters) +#define GET_VertexAttrib4NubARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index]) +#define SET_VertexAttrib4NubARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index], fn) +#define CALL_VertexAttrib4NubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], parameters) +#define GET_VertexAttrib4NubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index]) +#define SET_VertexAttrib4NubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], fn) +#define CALL_VertexAttrib4NuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], parameters) +#define GET_VertexAttrib4NuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index]) +#define SET_VertexAttrib4NuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], fn) +#define CALL_VertexAttrib4NusvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], parameters) +#define GET_VertexAttrib4NusvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index]) +#define SET_VertexAttrib4NusvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], fn) +#define CALL_VertexAttrib4bvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4bvARB_remap_index], parameters) +#define GET_VertexAttrib4bvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index]) +#define SET_VertexAttrib4bvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index], fn) +#define CALL_VertexAttrib4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dARB_remap_index], parameters) +#define GET_VertexAttrib4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index]) +#define SET_VertexAttrib4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index], fn) +#define CALL_VertexAttrib4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvARB_remap_index], parameters) +#define GET_VertexAttrib4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index]) +#define SET_VertexAttrib4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index], fn) +#define CALL_VertexAttrib4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fARB_remap_index], parameters) +#define GET_VertexAttrib4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index]) +#define SET_VertexAttrib4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index], fn) +#define CALL_VertexAttrib4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvARB_remap_index], parameters) +#define GET_VertexAttrib4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index]) +#define SET_VertexAttrib4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index], fn) +#define CALL_VertexAttrib4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4ivARB_remap_index], parameters) +#define GET_VertexAttrib4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index]) +#define SET_VertexAttrib4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index], fn) +#define CALL_VertexAttrib4sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sARB_remap_index], parameters) +#define GET_VertexAttrib4sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index]) +#define SET_VertexAttrib4sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index], fn) +#define CALL_VertexAttrib4svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svARB_remap_index], parameters) +#define GET_VertexAttrib4svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index]) +#define SET_VertexAttrib4svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index], fn) +#define CALL_VertexAttrib4ubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], parameters) +#define GET_VertexAttrib4ubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index]) +#define SET_VertexAttrib4ubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], fn) +#define CALL_VertexAttrib4uivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4uivARB_remap_index], parameters) +#define GET_VertexAttrib4uivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index]) +#define SET_VertexAttrib4uivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index], fn) +#define CALL_VertexAttrib4usvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4usvARB_remap_index], parameters) +#define GET_VertexAttrib4usvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index]) +#define SET_VertexAttrib4usvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index], fn) +#define CALL_VertexAttribPointerARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerARB_remap_index], parameters) +#define GET_VertexAttribPointerARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index]) +#define SET_VertexAttribPointerARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index], fn) +#define CALL_BindBufferARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindBufferARB_remap_index], parameters) +#define GET_BindBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index]) +#define SET_BindBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index], fn) +#define CALL_BufferDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)), driDispatchRemapTable[BufferDataARB_remap_index], parameters) +#define GET_BufferDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index]) +#define SET_BufferDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index], fn) +#define CALL_BufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)), driDispatchRemapTable[BufferSubDataARB_remap_index], parameters) +#define GET_BufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index]) +#define SET_BufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index], fn) +#define CALL_DeleteBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteBuffersARB_remap_index], parameters) +#define GET_DeleteBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index]) +#define SET_DeleteBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index], fn) +#define CALL_GenBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenBuffersARB_remap_index], parameters) +#define GET_GenBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index]) +#define SET_GenBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index], fn) +#define CALL_GetBufferParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetBufferParameterivARB_remap_index], parameters) +#define GET_GetBufferParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index]) +#define SET_GetBufferParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index], fn) +#define CALL_GetBufferPointervARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetBufferPointervARB_remap_index], parameters) +#define GET_GetBufferPointervARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index]) +#define SET_GetBufferPointervARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index], fn) +#define CALL_GetBufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)), driDispatchRemapTable[GetBufferSubDataARB_remap_index], parameters) +#define GET_GetBufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index]) +#define SET_GetBufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index], fn) +#define CALL_IsBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsBufferARB_remap_index], parameters) +#define GET_IsBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index]) +#define SET_IsBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index], fn) +#define CALL_MapBufferARB(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[MapBufferARB_remap_index], parameters) +#define GET_MapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index]) +#define SET_MapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index], fn) +#define CALL_UnmapBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[UnmapBufferARB_remap_index], parameters) +#define GET_UnmapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index]) +#define SET_UnmapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index], fn) +#define CALL_BeginQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BeginQueryARB_remap_index], parameters) +#define GET_BeginQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index]) +#define SET_BeginQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index], fn) +#define CALL_DeleteQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteQueriesARB_remap_index], parameters) +#define GET_DeleteQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index]) +#define SET_DeleteQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index], fn) +#define CALL_EndQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[EndQueryARB_remap_index], parameters) +#define GET_EndQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index]) +#define SET_EndQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index], fn) +#define CALL_GenQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenQueriesARB_remap_index], parameters) +#define GET_GenQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index]) +#define SET_GenQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index], fn) +#define CALL_GetQueryObjectivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetQueryObjectivARB_remap_index], parameters) +#define GET_GetQueryObjectivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index]) +#define SET_GetQueryObjectivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index], fn) +#define CALL_GetQueryObjectuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint *)), driDispatchRemapTable[GetQueryObjectuivARB_remap_index], parameters) +#define GET_GetQueryObjectuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index]) +#define SET_GetQueryObjectuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index], fn) +#define CALL_GetQueryivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetQueryivARB_remap_index], parameters) +#define GET_GetQueryivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index]) +#define SET_GetQueryivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index], fn) +#define CALL_IsQueryARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsQueryARB_remap_index], parameters) +#define GET_IsQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index]) +#define SET_IsQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index], fn) +#define CALL_AttachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[AttachObjectARB_remap_index], parameters) +#define GET_AttachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index]) +#define SET_AttachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index], fn) +#define CALL_CompileShaderARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[CompileShaderARB_remap_index], parameters) +#define GET_CompileShaderARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index]) +#define SET_CompileShaderARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index], fn) +#define CALL_CreateProgramObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgramObjectARB_remap_index], parameters) +#define GET_CreateProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index]) +#define SET_CreateProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index], fn) +#define CALL_CreateShaderObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShaderObjectARB_remap_index], parameters) +#define GET_CreateShaderObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index]) +#define SET_CreateShaderObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index], fn) +#define CALL_DeleteObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[DeleteObjectARB_remap_index], parameters) +#define GET_DeleteObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index]) +#define SET_DeleteObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index], fn) +#define CALL_DetachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[DetachObjectARB_remap_index], parameters) +#define GET_DetachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index]) +#define SET_DetachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index], fn) +#define CALL_GetActiveUniformARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveUniformARB_remap_index], parameters) +#define GET_GetActiveUniformARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index]) +#define SET_GetActiveUniformARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index], fn) +#define CALL_GetAttachedObjectsARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *)), driDispatchRemapTable[GetAttachedObjectsARB_remap_index], parameters) +#define GET_GetAttachedObjectsARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index]) +#define SET_GetAttachedObjectsARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index], fn) +#define CALL_GetHandleARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GetHandleARB_remap_index], parameters) +#define GET_GetHandleARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index]) +#define SET_GetHandleARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index], fn) +#define CALL_GetInfoLogARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetInfoLogARB_remap_index], parameters) +#define GET_GetInfoLogARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index]) +#define SET_GetInfoLogARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index], fn) +#define CALL_GetObjectParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLfloat *)), driDispatchRemapTable[GetObjectParameterfvARB_remap_index], parameters) +#define GET_GetObjectParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index]) +#define SET_GetObjectParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index], fn) +#define CALL_GetObjectParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivARB_remap_index], parameters) +#define GET_GetObjectParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index]) +#define SET_GetObjectParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index], fn) +#define CALL_GetShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetShaderSourceARB_remap_index], parameters) +#define GET_GetShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index]) +#define SET_GetShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index], fn) +#define CALL_GetUniformLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetUniformLocationARB_remap_index], parameters) +#define GET_GetUniformLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index]) +#define SET_GetUniformLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index], fn) +#define CALL_GetUniformfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLfloat *)), driDispatchRemapTable[GetUniformfvARB_remap_index], parameters) +#define GET_GetUniformfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index]) +#define SET_GetUniformfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index], fn) +#define CALL_GetUniformivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLint *)), driDispatchRemapTable[GetUniformivARB_remap_index], parameters) +#define GET_GetUniformivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index]) +#define SET_GetUniformivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index], fn) +#define CALL_LinkProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[LinkProgramARB_remap_index], parameters) +#define GET_LinkProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index]) +#define SET_LinkProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index], fn) +#define CALL_ShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)), driDispatchRemapTable[ShaderSourceARB_remap_index], parameters) +#define GET_ShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index]) +#define SET_ShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index], fn) +#define CALL_Uniform1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat)), driDispatchRemapTable[Uniform1fARB_remap_index], parameters) +#define GET_Uniform1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index]) +#define SET_Uniform1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index], fn) +#define CALL_Uniform1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform1fvARB_remap_index], parameters) +#define GET_Uniform1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index]) +#define SET_Uniform1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index], fn) +#define CALL_Uniform1iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[Uniform1iARB_remap_index], parameters) +#define GET_Uniform1iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index]) +#define SET_Uniform1iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index], fn) +#define CALL_Uniform1ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform1ivARB_remap_index], parameters) +#define GET_Uniform1ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index]) +#define SET_Uniform1ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index], fn) +#define CALL_Uniform2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat)), driDispatchRemapTable[Uniform2fARB_remap_index], parameters) +#define GET_Uniform2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index]) +#define SET_Uniform2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index], fn) +#define CALL_Uniform2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform2fvARB_remap_index], parameters) +#define GET_Uniform2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index]) +#define SET_Uniform2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index], fn) +#define CALL_Uniform2iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[Uniform2iARB_remap_index], parameters) +#define GET_Uniform2iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index]) +#define SET_Uniform2iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index], fn) +#define CALL_Uniform2ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform2ivARB_remap_index], parameters) +#define GET_Uniform2ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index]) +#define SET_Uniform2ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index], fn) +#define CALL_Uniform3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform3fARB_remap_index], parameters) +#define GET_Uniform3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index]) +#define SET_Uniform3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index], fn) +#define CALL_Uniform3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform3fvARB_remap_index], parameters) +#define GET_Uniform3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index]) +#define SET_Uniform3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index], fn) +#define CALL_Uniform3iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform3iARB_remap_index], parameters) +#define GET_Uniform3iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index]) +#define SET_Uniform3iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index], fn) +#define CALL_Uniform3ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform3ivARB_remap_index], parameters) +#define GET_Uniform3ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index]) +#define SET_Uniform3ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index], fn) +#define CALL_Uniform4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform4fARB_remap_index], parameters) +#define GET_Uniform4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index]) +#define SET_Uniform4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index], fn) +#define CALL_Uniform4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform4fvARB_remap_index], parameters) +#define GET_Uniform4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index]) +#define SET_Uniform4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index], fn) +#define CALL_Uniform4iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform4iARB_remap_index], parameters) +#define GET_Uniform4iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index]) +#define SET_Uniform4iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index], fn) +#define CALL_Uniform4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform4ivARB_remap_index], parameters) +#define GET_Uniform4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index]) +#define SET_Uniform4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index], fn) +#define CALL_UniformMatrix2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2fvARB_remap_index], parameters) +#define GET_UniformMatrix2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index]) +#define SET_UniformMatrix2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index], fn) +#define CALL_UniformMatrix3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3fvARB_remap_index], parameters) +#define GET_UniformMatrix3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index]) +#define SET_UniformMatrix3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index], fn) +#define CALL_UniformMatrix4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4fvARB_remap_index], parameters) +#define GET_UniformMatrix4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index]) +#define SET_UniformMatrix4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index], fn) +#define CALL_UseProgramObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[UseProgramObjectARB_remap_index], parameters) +#define GET_UseProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index]) +#define SET_UseProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index], fn) +#define CALL_ValidateProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[ValidateProgramARB_remap_index], parameters) +#define GET_ValidateProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index]) +#define SET_ValidateProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index], fn) +#define CALL_BindAttribLocationARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, const GLcharARB *)), driDispatchRemapTable[BindAttribLocationARB_remap_index], parameters) +#define GET_BindAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index]) +#define SET_BindAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index], fn) +#define CALL_GetActiveAttribARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveAttribARB_remap_index], parameters) +#define GET_GetActiveAttribARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index]) +#define SET_GetActiveAttribARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index], fn) +#define CALL_GetAttribLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetAttribLocationARB_remap_index], parameters) +#define GET_GetAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index]) +#define SET_GetAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index], fn) +#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters) +#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index]) +#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn) +#define CALL_RenderbufferStorageMultisample(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], parameters) +#define GET_RenderbufferStorageMultisample(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index]) +#define SET_RenderbufferStorageMultisample(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], fn) +#define CALL_FlushMappedBufferRange(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRange_remap_index], parameters) +#define GET_FlushMappedBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index]) +#define SET_FlushMappedBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index], fn) +#define CALL_MapBufferRange(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr, GLbitfield)), driDispatchRemapTable[MapBufferRange_remap_index], parameters) +#define GET_MapBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index]) +#define SET_MapBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index], fn) +#define CALL_BindVertexArray(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArray_remap_index], parameters) +#define GET_BindVertexArray(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index]) +#define SET_BindVertexArray(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index], fn) +#define CALL_GenVertexArrays(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArrays_remap_index], parameters) +#define GET_GenVertexArrays(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index]) +#define SET_GenVertexArrays(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index], fn) +#define CALL_CopyBufferSubData(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr)), driDispatchRemapTable[CopyBufferSubData_remap_index], parameters) +#define GET_CopyBufferSubData(disp) GET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index]) +#define SET_CopyBufferSubData(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index], fn) +#define CALL_ClientWaitSync(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[ClientWaitSync_remap_index], parameters) +#define GET_ClientWaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index]) +#define SET_ClientWaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index], fn) +#define CALL_DeleteSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[DeleteSync_remap_index], parameters) +#define GET_DeleteSync(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index]) +#define SET_DeleteSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index], fn) +#define CALL_FenceSync(disp, parameters) CALL_by_offset(disp, (GLsync (GLAPIENTRYP)(GLenum, GLbitfield)), driDispatchRemapTable[FenceSync_remap_index], parameters) +#define GET_FenceSync(disp) GET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index]) +#define SET_FenceSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index], fn) +#define CALL_GetInteger64v(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint64 *)), driDispatchRemapTable[GetInteger64v_remap_index], parameters) +#define GET_GetInteger64v(disp) GET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index]) +#define SET_GetInteger64v(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index], fn) +#define CALL_GetSynciv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLenum, GLsizei, GLsizei *, GLint *)), driDispatchRemapTable[GetSynciv_remap_index], parameters) +#define GET_GetSynciv(disp) GET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index]) +#define SET_GetSynciv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index], fn) +#define CALL_IsSync(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[IsSync_remap_index], parameters) +#define GET_IsSync(disp) GET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index]) +#define SET_IsSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index], fn) +#define CALL_WaitSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[WaitSync_remap_index], parameters) +#define GET_WaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index]) +#define SET_WaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index], fn) +#define CALL_DrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawElementsBaseVertex_remap_index], parameters) +#define GET_DrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index]) +#define SET_DrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index], fn) +#define CALL_DrawRangeElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], parameters) +#define GET_DrawRangeElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index]) +#define SET_DrawRangeElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], fn) +#define CALL_MultiDrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei, const GLint *)), driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], parameters) +#define GET_MultiDrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index]) +#define SET_MultiDrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], fn) +#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) +#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) +#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) +#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) +#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) +#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) +#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], parameters) +#define GET_GetPixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]) +#define SET_GetPixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterfSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterfSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]) +#define SET_PixelTexGenParameterfSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]) +#define SET_PixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], fn) +#define CALL_PixelTexGenParameteriSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], parameters) +#define GET_PixelTexGenParameteriSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]) +#define SET_PixelTexGenParameteriSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) +#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) +#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) +#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) +#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) +#define CALL_SamplePatternSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[SamplePatternSGIS_remap_index], parameters) +#define GET_SamplePatternSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index]) +#define SET_SamplePatternSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index], fn) +#define CALL_ColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[ColorPointerEXT_remap_index], parameters) +#define GET_ColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index]) +#define SET_ColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index], fn) +#define CALL_EdgeFlagPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLsizei, const GLboolean *)), driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], parameters) +#define GET_EdgeFlagPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index]) +#define SET_EdgeFlagPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], fn) +#define CALL_IndexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[IndexPointerEXT_remap_index], parameters) +#define GET_IndexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index]) +#define SET_IndexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index], fn) +#define CALL_NormalPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[NormalPointerEXT_remap_index], parameters) +#define GET_NormalPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index]) +#define SET_NormalPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index], fn) +#define CALL_TexCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[TexCoordPointerEXT_remap_index], parameters) +#define GET_TexCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index]) +#define SET_TexCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index], fn) +#define CALL_VertexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexPointerEXT_remap_index], parameters) +#define GET_VertexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index]) +#define SET_VertexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index], fn) +#define CALL_PointParameterfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PointParameterfEXT_remap_index], parameters) +#define GET_PointParameterfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index]) +#define SET_PointParameterfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index], fn) +#define CALL_PointParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PointParameterfvEXT_remap_index], parameters) +#define GET_PointParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index]) +#define SET_PointParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index], fn) +#define CALL_LockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei)), driDispatchRemapTable[LockArraysEXT_remap_index], parameters) +#define GET_LockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index]) +#define SET_LockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index], fn) +#define CALL_UnlockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[UnlockArraysEXT_remap_index], parameters) +#define GET_UnlockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index]) +#define SET_UnlockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index], fn) +#define CALL_CullParameterdvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLdouble *)), driDispatchRemapTable[CullParameterdvEXT_remap_index], parameters) +#define GET_CullParameterdvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index]) +#define SET_CullParameterdvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index], fn) +#define CALL_CullParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[CullParameterfvEXT_remap_index], parameters) +#define GET_CullParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index]) +#define SET_CullParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index], fn) +#define CALL_SecondaryColor3bEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLbyte, GLbyte, GLbyte)), driDispatchRemapTable[SecondaryColor3bEXT_remap_index], parameters) +#define GET_SecondaryColor3bEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index]) +#define SET_SecondaryColor3bEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index], fn) +#define CALL_SecondaryColor3bvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLbyte *)), driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], parameters) +#define GET_SecondaryColor3bvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index]) +#define SET_SecondaryColor3bvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], fn) +#define CALL_SecondaryColor3dEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[SecondaryColor3dEXT_remap_index], parameters) +#define GET_SecondaryColor3dEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index]) +#define SET_SecondaryColor3dEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index], fn) +#define CALL_SecondaryColor3dvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], parameters) +#define GET_SecondaryColor3dvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index]) +#define SET_SecondaryColor3dvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], fn) +#define CALL_SecondaryColor3fEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[SecondaryColor3fEXT_remap_index], parameters) +#define GET_SecondaryColor3fEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index]) +#define SET_SecondaryColor3fEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index], fn) +#define CALL_SecondaryColor3fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], parameters) +#define GET_SecondaryColor3fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index]) +#define SET_SecondaryColor3fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], fn) +#define CALL_SecondaryColor3iEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[SecondaryColor3iEXT_remap_index], parameters) +#define GET_SecondaryColor3iEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index]) +#define SET_SecondaryColor3iEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index], fn) +#define CALL_SecondaryColor3ivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], parameters) +#define GET_SecondaryColor3ivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index]) +#define SET_SecondaryColor3ivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], fn) +#define CALL_SecondaryColor3sEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[SecondaryColor3sEXT_remap_index], parameters) +#define GET_SecondaryColor3sEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index]) +#define SET_SecondaryColor3sEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index], fn) +#define CALL_SecondaryColor3svEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[SecondaryColor3svEXT_remap_index], parameters) +#define GET_SecondaryColor3svEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index]) +#define SET_SecondaryColor3svEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index], fn) +#define CALL_SecondaryColor3ubEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], parameters) +#define GET_SecondaryColor3ubEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index]) +#define SET_SecondaryColor3ubEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], fn) +#define CALL_SecondaryColor3ubvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLubyte *)), driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], parameters) +#define GET_SecondaryColor3ubvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index]) +#define SET_SecondaryColor3ubvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], fn) +#define CALL_SecondaryColor3uiEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLuint)), driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], parameters) +#define GET_SecondaryColor3uiEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index]) +#define SET_SecondaryColor3uiEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], fn) +#define CALL_SecondaryColor3uivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLuint *)), driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], parameters) +#define GET_SecondaryColor3uivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index]) +#define SET_SecondaryColor3uivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], fn) +#define CALL_SecondaryColor3usEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLushort, GLushort, GLushort)), driDispatchRemapTable[SecondaryColor3usEXT_remap_index], parameters) +#define GET_SecondaryColor3usEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index]) +#define SET_SecondaryColor3usEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index], fn) +#define CALL_SecondaryColor3usvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLushort *)), driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], parameters) +#define GET_SecondaryColor3usvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index]) +#define SET_SecondaryColor3usvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], fn) +#define CALL_SecondaryColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], parameters) +#define GET_SecondaryColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index]) +#define SET_SecondaryColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], fn) +#define CALL_MultiDrawArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *, GLsizei *, GLsizei)), driDispatchRemapTable[MultiDrawArraysEXT_remap_index], parameters) +#define GET_MultiDrawArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index]) +#define SET_MultiDrawArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index], fn) +#define CALL_MultiDrawElementsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)), driDispatchRemapTable[MultiDrawElementsEXT_remap_index], parameters) +#define GET_MultiDrawElementsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index]) +#define SET_MultiDrawElementsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index], fn) +#define CALL_FogCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[FogCoordPointerEXT_remap_index], parameters) +#define GET_FogCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index]) +#define SET_FogCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index], fn) +#define CALL_FogCoorddEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble)), driDispatchRemapTable[FogCoorddEXT_remap_index], parameters) +#define GET_FogCoorddEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index]) +#define SET_FogCoorddEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index], fn) +#define CALL_FogCoorddvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[FogCoorddvEXT_remap_index], parameters) +#define GET_FogCoorddvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index]) +#define SET_FogCoorddvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index], fn) +#define CALL_FogCoordfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[FogCoordfEXT_remap_index], parameters) +#define GET_FogCoordfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index]) +#define SET_FogCoordfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index], fn) +#define CALL_FogCoordfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[FogCoordfvEXT_remap_index], parameters) +#define GET_FogCoordfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index]) +#define SET_FogCoordfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index], fn) +#define CALL_PixelTexGenSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[PixelTexGenSGIX_remap_index], parameters) +#define GET_PixelTexGenSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index]) +#define SET_PixelTexGenSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index], fn) +#define CALL_BlendFuncSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], parameters) +#define GET_BlendFuncSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index]) +#define SET_BlendFuncSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], fn) +#define CALL_FlushVertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], parameters) +#define GET_FlushVertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index]) +#define SET_FlushVertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], fn) +#define CALL_VertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLvoid *)), driDispatchRemapTable[VertexArrayRangeNV_remap_index], parameters) +#define GET_VertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index]) +#define SET_VertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index], fn) +#define CALL_CombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[CombinerInputNV_remap_index], parameters) +#define GET_CombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index]) +#define SET_CombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index], fn) +#define CALL_CombinerOutputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean)), driDispatchRemapTable[CombinerOutputNV_remap_index], parameters) +#define GET_CombinerOutputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index]) +#define SET_CombinerOutputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index], fn) +#define CALL_CombinerParameterfNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[CombinerParameterfNV_remap_index], parameters) +#define GET_CombinerParameterfNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index]) +#define SET_CombinerParameterfNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index], fn) +#define CALL_CombinerParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[CombinerParameterfvNV_remap_index], parameters) +#define GET_CombinerParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index]) +#define SET_CombinerParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index], fn) +#define CALL_CombinerParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[CombinerParameteriNV_remap_index], parameters) +#define GET_CombinerParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index]) +#define SET_CombinerParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index], fn) +#define CALL_CombinerParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[CombinerParameterivNV_remap_index], parameters) +#define GET_CombinerParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index]) +#define SET_CombinerParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index], fn) +#define CALL_FinalCombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[FinalCombinerInputNV_remap_index], parameters) +#define GET_FinalCombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index]) +#define SET_FinalCombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index], fn) +#define CALL_GetCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], parameters) +#define GET_GetCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index]) +#define SET_GetCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], fn) +#define CALL_GetCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], parameters) +#define GET_GetCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index]) +#define SET_GetCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], fn) +#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], parameters) +#define GET_GetCombinerOutputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index]) +#define SET_GetCombinerOutputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], fn) +#define CALL_GetCombinerOutputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], parameters) +#define GET_GetCombinerOutputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index]) +#define SET_GetCombinerOutputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], fn) +#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], parameters) +#define GET_GetFinalCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index]) +#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], fn) +#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], parameters) +#define GET_GetFinalCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index]) +#define SET_GetFinalCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], fn) +#define CALL_ResizeBuffersMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[ResizeBuffersMESA_remap_index], parameters) +#define GET_ResizeBuffersMESA(disp) GET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index]) +#define SET_ResizeBuffersMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index], fn) +#define CALL_WindowPos2dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble)), driDispatchRemapTable[WindowPos2dMESA_remap_index], parameters) +#define GET_WindowPos2dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index]) +#define SET_WindowPos2dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index], fn) +#define CALL_WindowPos2dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos2dvMESA_remap_index], parameters) +#define GET_WindowPos2dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index]) +#define SET_WindowPos2dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index], fn) +#define CALL_WindowPos2fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[WindowPos2fMESA_remap_index], parameters) +#define GET_WindowPos2fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index]) +#define SET_WindowPos2fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index], fn) +#define CALL_WindowPos2fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos2fvMESA_remap_index], parameters) +#define GET_WindowPos2fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index]) +#define SET_WindowPos2fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index], fn) +#define CALL_WindowPos2iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[WindowPos2iMESA_remap_index], parameters) +#define GET_WindowPos2iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index]) +#define SET_WindowPos2iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index], fn) +#define CALL_WindowPos2ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos2ivMESA_remap_index], parameters) +#define GET_WindowPos2ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index]) +#define SET_WindowPos2ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index], fn) +#define CALL_WindowPos2sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort)), driDispatchRemapTable[WindowPos2sMESA_remap_index], parameters) +#define GET_WindowPos2sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index]) +#define SET_WindowPos2sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index], fn) +#define CALL_WindowPos2svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos2svMESA_remap_index], parameters) +#define GET_WindowPos2svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index]) +#define SET_WindowPos2svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index], fn) +#define CALL_WindowPos3dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos3dMESA_remap_index], parameters) +#define GET_WindowPos3dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index]) +#define SET_WindowPos3dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index], fn) +#define CALL_WindowPos3dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos3dvMESA_remap_index], parameters) +#define GET_WindowPos3dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index]) +#define SET_WindowPos3dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index], fn) +#define CALL_WindowPos3fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos3fMESA_remap_index], parameters) +#define GET_WindowPos3fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index]) +#define SET_WindowPos3fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index], fn) +#define CALL_WindowPos3fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos3fvMESA_remap_index], parameters) +#define GET_WindowPos3fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index]) +#define SET_WindowPos3fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index], fn) +#define CALL_WindowPos3iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[WindowPos3iMESA_remap_index], parameters) +#define GET_WindowPos3iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index]) +#define SET_WindowPos3iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index], fn) +#define CALL_WindowPos3ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos3ivMESA_remap_index], parameters) +#define GET_WindowPos3ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index]) +#define SET_WindowPos3ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index], fn) +#define CALL_WindowPos3sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos3sMESA_remap_index], parameters) +#define GET_WindowPos3sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index]) +#define SET_WindowPos3sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index], fn) +#define CALL_WindowPos3svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos3svMESA_remap_index], parameters) +#define GET_WindowPos3svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index]) +#define SET_WindowPos3svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index], fn) +#define CALL_WindowPos4dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos4dMESA_remap_index], parameters) +#define GET_WindowPos4dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index]) +#define SET_WindowPos4dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index], fn) +#define CALL_WindowPos4dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos4dvMESA_remap_index], parameters) +#define GET_WindowPos4dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index]) +#define SET_WindowPos4dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index], fn) +#define CALL_WindowPos4fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos4fMESA_remap_index], parameters) +#define GET_WindowPos4fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index]) +#define SET_WindowPos4fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index], fn) +#define CALL_WindowPos4fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos4fvMESA_remap_index], parameters) +#define GET_WindowPos4fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index]) +#define SET_WindowPos4fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index], fn) +#define CALL_WindowPos4iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[WindowPos4iMESA_remap_index], parameters) +#define GET_WindowPos4iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index]) +#define SET_WindowPos4iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index], fn) +#define CALL_WindowPos4ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos4ivMESA_remap_index], parameters) +#define GET_WindowPos4ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index]) +#define SET_WindowPos4ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index], fn) +#define CALL_WindowPos4sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos4sMESA_remap_index], parameters) +#define GET_WindowPos4sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index]) +#define SET_WindowPos4sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index], fn) +#define CALL_WindowPos4svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos4svMESA_remap_index], parameters) +#define GET_WindowPos4svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index]) +#define SET_WindowPos4svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index], fn) +#define CALL_MultiModeDrawArraysIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], parameters) +#define GET_MultiModeDrawArraysIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index]) +#define SET_MultiModeDrawArraysIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], fn) +#define CALL_MultiModeDrawElementsIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], parameters) +#define GET_MultiModeDrawElementsIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index]) +#define SET_MultiModeDrawElementsIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], fn) +#define CALL_DeleteFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFencesNV_remap_index], parameters) +#define GET_DeleteFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index]) +#define SET_DeleteFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index], fn) +#define CALL_FinishFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[FinishFenceNV_remap_index], parameters) +#define GET_FinishFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index]) +#define SET_FinishFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index], fn) +#define CALL_GenFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFencesNV_remap_index], parameters) +#define GET_GenFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index]) +#define SET_GenFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index], fn) +#define CALL_GetFenceivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetFenceivNV_remap_index], parameters) +#define GET_GetFenceivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index]) +#define SET_GetFenceivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index], fn) +#define CALL_IsFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFenceNV_remap_index], parameters) +#define GET_IsFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index]) +#define SET_IsFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index], fn) +#define CALL_SetFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum)), driDispatchRemapTable[SetFenceNV_remap_index], parameters) +#define GET_SetFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index]) +#define SET_SetFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index], fn) +#define CALL_TestFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TestFenceNV_remap_index], parameters) +#define GET_TestFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index]) +#define SET_TestFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index], fn) +#define CALL_AreProgramsResidentNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreProgramsResidentNV_remap_index], parameters) +#define GET_AreProgramsResidentNV(disp) GET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index]) +#define SET_AreProgramsResidentNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index], fn) +#define CALL_BindProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindProgramNV_remap_index], parameters) +#define GET_BindProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index]) +#define SET_BindProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index], fn) +#define CALL_DeleteProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteProgramsNV_remap_index], parameters) +#define GET_DeleteProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index]) +#define SET_DeleteProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index], fn) +#define CALL_ExecuteProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ExecuteProgramNV_remap_index], parameters) +#define GET_ExecuteProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index]) +#define SET_ExecuteProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index], fn) +#define CALL_GenProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenProgramsNV_remap_index], parameters) +#define GET_GenProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index]) +#define SET_GenProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index], fn) +#define CALL_GetProgramParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetProgramParameterdvNV_remap_index], parameters) +#define GET_GetProgramParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index]) +#define SET_GetProgramParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index], fn) +#define CALL_GetProgramParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetProgramParameterfvNV_remap_index], parameters) +#define GET_GetProgramParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index]) +#define SET_GetProgramParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index], fn) +#define CALL_GetProgramStringNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)), driDispatchRemapTable[GetProgramStringNV_remap_index], parameters) +#define GET_GetProgramStringNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index]) +#define SET_GetProgramStringNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index], fn) +#define CALL_GetProgramivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramivNV_remap_index], parameters) +#define GET_GetProgramivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index]) +#define SET_GetProgramivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index], fn) +#define CALL_GetTrackMatrixivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetTrackMatrixivNV_remap_index], parameters) +#define GET_GetTrackMatrixivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index]) +#define SET_GetTrackMatrixivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index], fn) +#define CALL_GetVertexAttribPointervNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLvoid **)), driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], parameters) +#define GET_GetVertexAttribPointervNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index]) +#define SET_GetVertexAttribPointervNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], fn) +#define CALL_GetVertexAttribdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvNV_remap_index], parameters) +#define GET_GetVertexAttribdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index]) +#define SET_GetVertexAttribdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index], fn) +#define CALL_GetVertexAttribfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvNV_remap_index], parameters) +#define GET_GetVertexAttribfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index]) +#define SET_GetVertexAttribfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index], fn) +#define CALL_GetVertexAttribivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivNV_remap_index], parameters) +#define GET_GetVertexAttribivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index]) +#define SET_GetVertexAttribivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index], fn) +#define CALL_IsProgramNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgramNV_remap_index], parameters) +#define GET_IsProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index]) +#define SET_IsProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index], fn) +#define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters) +#define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index]) +#define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn) +#define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters) +#define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index]) +#define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn) +#define CALL_ProgramParameters4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameters4fvNV_remap_index], parameters) +#define GET_ProgramParameters4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index]) +#define SET_ProgramParameters4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index], fn) +#define CALL_RequestResidentProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[RequestResidentProgramsNV_remap_index], parameters) +#define GET_RequestResidentProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index]) +#define SET_RequestResidentProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index], fn) +#define CALL_TrackMatrixNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLenum)), driDispatchRemapTable[TrackMatrixNV_remap_index], parameters) +#define GET_TrackMatrixNV(disp) GET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index]) +#define SET_TrackMatrixNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index], fn) +#define CALL_VertexAttrib1dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dNV_remap_index], parameters) +#define GET_VertexAttrib1dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index]) +#define SET_VertexAttrib1dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index], fn) +#define CALL_VertexAttrib1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvNV_remap_index], parameters) +#define GET_VertexAttrib1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index]) +#define SET_VertexAttrib1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index], fn) +#define CALL_VertexAttrib1fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fNV_remap_index], parameters) +#define GET_VertexAttrib1fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index]) +#define SET_VertexAttrib1fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index], fn) +#define CALL_VertexAttrib1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvNV_remap_index], parameters) +#define GET_VertexAttrib1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index]) +#define SET_VertexAttrib1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index], fn) +#define CALL_VertexAttrib1sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sNV_remap_index], parameters) +#define GET_VertexAttrib1sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index]) +#define SET_VertexAttrib1sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index], fn) +#define CALL_VertexAttrib1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svNV_remap_index], parameters) +#define GET_VertexAttrib1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index]) +#define SET_VertexAttrib1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index], fn) +#define CALL_VertexAttrib2dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dNV_remap_index], parameters) +#define GET_VertexAttrib2dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index]) +#define SET_VertexAttrib2dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index], fn) +#define CALL_VertexAttrib2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvNV_remap_index], parameters) +#define GET_VertexAttrib2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index]) +#define SET_VertexAttrib2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index], fn) +#define CALL_VertexAttrib2fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fNV_remap_index], parameters) +#define GET_VertexAttrib2fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index]) +#define SET_VertexAttrib2fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index], fn) +#define CALL_VertexAttrib2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvNV_remap_index], parameters) +#define GET_VertexAttrib2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index]) +#define SET_VertexAttrib2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index], fn) +#define CALL_VertexAttrib2sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sNV_remap_index], parameters) +#define GET_VertexAttrib2sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index]) +#define SET_VertexAttrib2sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index], fn) +#define CALL_VertexAttrib2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svNV_remap_index], parameters) +#define GET_VertexAttrib2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index]) +#define SET_VertexAttrib2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index], fn) +#define CALL_VertexAttrib3dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dNV_remap_index], parameters) +#define GET_VertexAttrib3dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index]) +#define SET_VertexAttrib3dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index], fn) +#define CALL_VertexAttrib3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvNV_remap_index], parameters) +#define GET_VertexAttrib3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index]) +#define SET_VertexAttrib3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index], fn) +#define CALL_VertexAttrib3fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fNV_remap_index], parameters) +#define GET_VertexAttrib3fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index]) +#define SET_VertexAttrib3fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index], fn) +#define CALL_VertexAttrib3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvNV_remap_index], parameters) +#define GET_VertexAttrib3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index]) +#define SET_VertexAttrib3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index], fn) +#define CALL_VertexAttrib3sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sNV_remap_index], parameters) +#define GET_VertexAttrib3sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index]) +#define SET_VertexAttrib3sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index], fn) +#define CALL_VertexAttrib3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svNV_remap_index], parameters) +#define GET_VertexAttrib3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index]) +#define SET_VertexAttrib3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index], fn) +#define CALL_VertexAttrib4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dNV_remap_index], parameters) +#define GET_VertexAttrib4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index]) +#define SET_VertexAttrib4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index], fn) +#define CALL_VertexAttrib4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvNV_remap_index], parameters) +#define GET_VertexAttrib4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index]) +#define SET_VertexAttrib4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index], fn) +#define CALL_VertexAttrib4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fNV_remap_index], parameters) +#define GET_VertexAttrib4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index]) +#define SET_VertexAttrib4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index], fn) +#define CALL_VertexAttrib4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvNV_remap_index], parameters) +#define GET_VertexAttrib4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index]) +#define SET_VertexAttrib4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index], fn) +#define CALL_VertexAttrib4sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sNV_remap_index], parameters) +#define GET_VertexAttrib4sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index]) +#define SET_VertexAttrib4sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index], fn) +#define CALL_VertexAttrib4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svNV_remap_index], parameters) +#define GET_VertexAttrib4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index]) +#define SET_VertexAttrib4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index], fn) +#define CALL_VertexAttrib4ubNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4ubNV_remap_index], parameters) +#define GET_VertexAttrib4ubNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index]) +#define SET_VertexAttrib4ubNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index], fn) +#define CALL_VertexAttrib4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], parameters) +#define GET_VertexAttrib4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index]) +#define SET_VertexAttrib4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], fn) +#define CALL_VertexAttribPointerNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerNV_remap_index], parameters) +#define GET_VertexAttribPointerNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index]) +#define SET_VertexAttribPointerNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index], fn) +#define CALL_VertexAttribs1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs1dvNV_remap_index], parameters) +#define GET_VertexAttribs1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index]) +#define SET_VertexAttribs1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index], fn) +#define CALL_VertexAttribs1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs1fvNV_remap_index], parameters) +#define GET_VertexAttribs1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index]) +#define SET_VertexAttribs1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index], fn) +#define CALL_VertexAttribs1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs1svNV_remap_index], parameters) +#define GET_VertexAttribs1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index]) +#define SET_VertexAttribs1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index], fn) +#define CALL_VertexAttribs2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs2dvNV_remap_index], parameters) +#define GET_VertexAttribs2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index]) +#define SET_VertexAttribs2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index], fn) +#define CALL_VertexAttribs2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs2fvNV_remap_index], parameters) +#define GET_VertexAttribs2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index]) +#define SET_VertexAttribs2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index], fn) +#define CALL_VertexAttribs2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs2svNV_remap_index], parameters) +#define GET_VertexAttribs2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index]) +#define SET_VertexAttribs2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index], fn) +#define CALL_VertexAttribs3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs3dvNV_remap_index], parameters) +#define GET_VertexAttribs3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index]) +#define SET_VertexAttribs3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index], fn) +#define CALL_VertexAttribs3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs3fvNV_remap_index], parameters) +#define GET_VertexAttribs3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index]) +#define SET_VertexAttribs3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index], fn) +#define CALL_VertexAttribs3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs3svNV_remap_index], parameters) +#define GET_VertexAttribs3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index]) +#define SET_VertexAttribs3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index], fn) +#define CALL_VertexAttribs4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs4dvNV_remap_index], parameters) +#define GET_VertexAttribs4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index]) +#define SET_VertexAttribs4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index], fn) +#define CALL_VertexAttribs4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs4fvNV_remap_index], parameters) +#define GET_VertexAttribs4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index]) +#define SET_VertexAttribs4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index], fn) +#define CALL_VertexAttribs4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs4svNV_remap_index], parameters) +#define GET_VertexAttribs4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index]) +#define SET_VertexAttribs4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index], fn) +#define CALL_VertexAttribs4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], parameters) +#define GET_VertexAttribs4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index]) +#define SET_VertexAttribs4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], fn) +#define CALL_GetTexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], parameters) +#define GET_GetTexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index]) +#define SET_GetTexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], fn) +#define CALL_GetTexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], parameters) +#define GET_GetTexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index]) +#define SET_GetTexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], fn) +#define CALL_TexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[TexBumpParameterfvATI_remap_index], parameters) +#define GET_TexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index]) +#define SET_TexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index], fn) +#define CALL_TexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[TexBumpParameterivATI_remap_index], parameters) +#define GET_TexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index]) +#define SET_TexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index], fn) +#define CALL_AlphaFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], parameters) +#define GET_AlphaFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index]) +#define SET_AlphaFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], fn) +#define CALL_AlphaFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], parameters) +#define GET_AlphaFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index]) +#define SET_AlphaFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], fn) +#define CALL_AlphaFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], parameters) +#define GET_AlphaFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index]) +#define SET_AlphaFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], fn) +#define CALL_BeginFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[BeginFragmentShaderATI_remap_index], parameters) +#define GET_BeginFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index]) +#define SET_BeginFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index], fn) +#define CALL_BindFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindFragmentShaderATI_remap_index], parameters) +#define GET_BindFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index]) +#define SET_BindFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index], fn) +#define CALL_ColorFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], parameters) +#define GET_ColorFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index]) +#define SET_ColorFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], fn) +#define CALL_ColorFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], parameters) +#define GET_ColorFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index]) +#define SET_ColorFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], fn) +#define CALL_ColorFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], parameters) +#define GET_ColorFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index]) +#define SET_ColorFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], fn) +#define CALL_DeleteFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], parameters) +#define GET_DeleteFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index]) +#define SET_DeleteFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], fn) +#define CALL_EndFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[EndFragmentShaderATI_remap_index], parameters) +#define GET_EndFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index]) +#define SET_EndFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index], fn) +#define CALL_GenFragmentShadersATI(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[GenFragmentShadersATI_remap_index], parameters) +#define GET_GenFragmentShadersATI(disp) GET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index]) +#define SET_GenFragmentShadersATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index], fn) +#define CALL_PassTexCoordATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[PassTexCoordATI_remap_index], parameters) +#define GET_PassTexCoordATI(disp) GET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index]) +#define SET_PassTexCoordATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index], fn) +#define CALL_SampleMapATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[SampleMapATI_remap_index], parameters) +#define GET_SampleMapATI(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index]) +#define SET_SampleMapATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index], fn) +#define CALL_SetFragmentShaderConstantATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], parameters) +#define GET_SetFragmentShaderConstantATI(disp) GET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index]) +#define SET_SetFragmentShaderConstantATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], fn) +#define CALL_PointParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PointParameteriNV_remap_index], parameters) +#define GET_PointParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index]) +#define SET_PointParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index], fn) +#define CALL_PointParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PointParameterivNV_remap_index], parameters) +#define GET_PointParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index]) +#define SET_PointParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index], fn) +#define CALL_ActiveStencilFaceEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], parameters) +#define GET_ActiveStencilFaceEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index]) +#define SET_ActiveStencilFaceEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], fn) +#define CALL_BindVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], parameters) +#define GET_BindVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index]) +#define SET_BindVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], fn) +#define CALL_DeleteVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], parameters) +#define GET_DeleteVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index]) +#define SET_DeleteVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], fn) +#define CALL_GenVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], parameters) +#define GET_GenVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index]) +#define SET_GenVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], fn) +#define CALL_IsVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], parameters) +#define GET_IsVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index]) +#define SET_IsVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], fn) +#define CALL_GetProgramNamedParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble *)), driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], parameters) +#define GET_GetProgramNamedParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index]) +#define SET_GetProgramNamedParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], fn) +#define CALL_GetProgramNamedParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat *)), driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], parameters) +#define GET_GetProgramNamedParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index]) +#define SET_GetProgramNamedParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], fn) +#define CALL_ProgramNamedParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], parameters) +#define GET_ProgramNamedParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index]) +#define SET_ProgramNamedParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], fn) +#define CALL_ProgramNamedParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLdouble *)), driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], parameters) +#define GET_ProgramNamedParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index]) +#define SET_ProgramNamedParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], fn) +#define CALL_ProgramNamedParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], parameters) +#define GET_ProgramNamedParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index]) +#define SET_ProgramNamedParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], fn) +#define CALL_ProgramNamedParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLfloat *)), driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], parameters) +#define GET_ProgramNamedParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index]) +#define SET_ProgramNamedParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], fn) +#define CALL_DepthBoundsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampd, GLclampd)), driDispatchRemapTable[DepthBoundsEXT_remap_index], parameters) +#define GET_DepthBoundsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index]) +#define SET_DepthBoundsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index], fn) +#define CALL_BlendEquationSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], parameters) +#define GET_BlendEquationSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index]) +#define SET_BlendEquationSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], fn) +#define CALL_BindFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindFramebufferEXT_remap_index], parameters) +#define GET_BindFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index]) +#define SET_BindFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index], fn) +#define CALL_BindRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindRenderbufferEXT_remap_index], parameters) +#define GET_BindRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index]) +#define SET_BindRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index], fn) +#define CALL_CheckFramebufferStatusEXT(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], parameters) +#define GET_CheckFramebufferStatusEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index]) +#define SET_CheckFramebufferStatusEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], fn) +#define CALL_DeleteFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], parameters) +#define GET_DeleteFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index]) +#define SET_DeleteFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], fn) +#define CALL_DeleteRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], parameters) +#define GET_DeleteRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index]) +#define SET_DeleteRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], fn) +#define CALL_FramebufferRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint)), driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], parameters) +#define GET_FramebufferRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index]) +#define SET_FramebufferRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], fn) +#define CALL_FramebufferTexture1DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], parameters) +#define GET_FramebufferTexture1DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index]) +#define SET_FramebufferTexture1DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], fn) +#define CALL_FramebufferTexture2DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], parameters) +#define GET_FramebufferTexture2DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index]) +#define SET_FramebufferTexture2DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], fn) +#define CALL_FramebufferTexture3DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], parameters) +#define GET_FramebufferTexture3DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index]) +#define SET_FramebufferTexture3DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], fn) +#define CALL_GenFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFramebuffersEXT_remap_index], parameters) +#define GET_GenFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index]) +#define SET_GenFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index], fn) +#define CALL_GenRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenRenderbuffersEXT_remap_index], parameters) +#define GET_GenRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index]) +#define SET_GenRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index], fn) +#define CALL_GenerateMipmapEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GenerateMipmapEXT_remap_index], parameters) +#define GET_GenerateMipmapEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index]) +#define SET_GenerateMipmapEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index], fn) +#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) +#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) +#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) +#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) +#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) +#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) +#define CALL_IsFramebufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFramebufferEXT_remap_index], parameters) +#define GET_IsFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index]) +#define SET_IsFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index], fn) +#define CALL_IsRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsRenderbufferEXT_remap_index], parameters) +#define GET_IsRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index]) +#define SET_IsRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index], fn) +#define CALL_RenderbufferStorageEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageEXT_remap_index], parameters) +#define GET_RenderbufferStorageEXT(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index]) +#define SET_RenderbufferStorageEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index], fn) +#define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters) +#define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index]) +#define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn) +#define CALL_BufferParameteriAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint)), driDispatchRemapTable[BufferParameteriAPPLE_remap_index], parameters) +#define GET_BufferParameteriAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index]) +#define SET_BufferParameteriAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index], fn) +#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], parameters) +#define GET_FlushMappedBufferRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index]) +#define SET_FlushMappedBufferRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], fn) +#define CALL_FramebufferTextureLayerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], parameters) +#define GET_FramebufferTextureLayerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index]) +#define SET_FramebufferTextureLayerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], fn) +#define CALL_ProvokingVertexEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ProvokingVertexEXT_remap_index], parameters) +#define GET_ProvokingVertexEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index]) +#define SET_ProvokingVertexEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index], fn) +#define CALL_GetTexParameterPointervAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], parameters) +#define GET_GetTexParameterPointervAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index]) +#define SET_GetTexParameterPointervAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], fn) +#define CALL_TextureRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLvoid *)), driDispatchRemapTable[TextureRangeAPPLE_remap_index], parameters) +#define GET_TextureRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index]) +#define SET_TextureRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index], fn) +#define CALL_StencilFuncSeparateATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparateATI_remap_index], parameters) +#define GET_StencilFuncSeparateATI(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index]) +#define SET_StencilFuncSeparateATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index], fn) +#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters) +#define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]) +#define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn) +#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters) +#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]) +#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) +#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) +#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) +#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) +#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) + +#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */ + +#endif /* !defined( _GLAPI_DISPATCH_H_ ) */ diff --git a/mesalib/src/mesa/glapi/glapioffsets.h b/mesalib/src/mesa/glapi/glapioffsets.h index 6d4ab09b0..3d10260a0 100644 --- a/mesalib/src/mesa/glapi/glapioffsets.h +++ b/mesalib/src/mesa/glapi/glapioffsets.h @@ -29,6 +29,8 @@ #if !defined( _GLAPI_OFFSETS_H_ ) # define _GLAPI_OFFSETS_H_ +/* this file should not be included directly in mesa */ + #define _gloffset_NewList 0 #define _gloffset_EndList 1 #define _gloffset_CallList 2 @@ -438,7 +440,7 @@ #define _gloffset_MultiTexCoord4sARB 406 #define _gloffset_MultiTexCoord4svARB 407 -#if !defined(IN_DRI_DRIVER) +#if !defined(_GLAPI_USE_REMAP_TABLE) #define _gloffset_AttachShader 408 #define _gloffset_CreateProgram 409 @@ -606,225 +608,228 @@ #define _gloffset_GetSynciv 571 #define _gloffset_IsSync 572 #define _gloffset_WaitSync 573 -#define _gloffset_PolygonOffsetEXT 574 -#define _gloffset_GetPixelTexGenParameterfvSGIS 575 -#define _gloffset_GetPixelTexGenParameterivSGIS 576 -#define _gloffset_PixelTexGenParameterfSGIS 577 -#define _gloffset_PixelTexGenParameterfvSGIS 578 -#define _gloffset_PixelTexGenParameteriSGIS 579 -#define _gloffset_PixelTexGenParameterivSGIS 580 -#define _gloffset_SampleMaskSGIS 581 -#define _gloffset_SamplePatternSGIS 582 -#define _gloffset_ColorPointerEXT 583 -#define _gloffset_EdgeFlagPointerEXT 584 -#define _gloffset_IndexPointerEXT 585 -#define _gloffset_NormalPointerEXT 586 -#define _gloffset_TexCoordPointerEXT 587 -#define _gloffset_VertexPointerEXT 588 -#define _gloffset_PointParameterfEXT 589 -#define _gloffset_PointParameterfvEXT 590 -#define _gloffset_LockArraysEXT 591 -#define _gloffset_UnlockArraysEXT 592 -#define _gloffset_CullParameterdvEXT 593 -#define _gloffset_CullParameterfvEXT 594 -#define _gloffset_SecondaryColor3bEXT 595 -#define _gloffset_SecondaryColor3bvEXT 596 -#define _gloffset_SecondaryColor3dEXT 597 -#define _gloffset_SecondaryColor3dvEXT 598 -#define _gloffset_SecondaryColor3fEXT 599 -#define _gloffset_SecondaryColor3fvEXT 600 -#define _gloffset_SecondaryColor3iEXT 601 -#define _gloffset_SecondaryColor3ivEXT 602 -#define _gloffset_SecondaryColor3sEXT 603 -#define _gloffset_SecondaryColor3svEXT 604 -#define _gloffset_SecondaryColor3ubEXT 605 -#define _gloffset_SecondaryColor3ubvEXT 606 -#define _gloffset_SecondaryColor3uiEXT 607 -#define _gloffset_SecondaryColor3uivEXT 608 -#define _gloffset_SecondaryColor3usEXT 609 -#define _gloffset_SecondaryColor3usvEXT 610 -#define _gloffset_SecondaryColorPointerEXT 611 -#define _gloffset_MultiDrawArraysEXT 612 -#define _gloffset_MultiDrawElementsEXT 613 -#define _gloffset_FogCoordPointerEXT 614 -#define _gloffset_FogCoorddEXT 615 -#define _gloffset_FogCoorddvEXT 616 -#define _gloffset_FogCoordfEXT 617 -#define _gloffset_FogCoordfvEXT 618 -#define _gloffset_PixelTexGenSGIX 619 -#define _gloffset_BlendFuncSeparateEXT 620 -#define _gloffset_FlushVertexArrayRangeNV 621 -#define _gloffset_VertexArrayRangeNV 622 -#define _gloffset_CombinerInputNV 623 -#define _gloffset_CombinerOutputNV 624 -#define _gloffset_CombinerParameterfNV 625 -#define _gloffset_CombinerParameterfvNV 626 -#define _gloffset_CombinerParameteriNV 627 -#define _gloffset_CombinerParameterivNV 628 -#define _gloffset_FinalCombinerInputNV 629 -#define _gloffset_GetCombinerInputParameterfvNV 630 -#define _gloffset_GetCombinerInputParameterivNV 631 -#define _gloffset_GetCombinerOutputParameterfvNV 632 -#define _gloffset_GetCombinerOutputParameterivNV 633 -#define _gloffset_GetFinalCombinerInputParameterfvNV 634 -#define _gloffset_GetFinalCombinerInputParameterivNV 635 -#define _gloffset_ResizeBuffersMESA 636 -#define _gloffset_WindowPos2dMESA 637 -#define _gloffset_WindowPos2dvMESA 638 -#define _gloffset_WindowPos2fMESA 639 -#define _gloffset_WindowPos2fvMESA 640 -#define _gloffset_WindowPos2iMESA 641 -#define _gloffset_WindowPos2ivMESA 642 -#define _gloffset_WindowPos2sMESA 643 -#define _gloffset_WindowPos2svMESA 644 -#define _gloffset_WindowPos3dMESA 645 -#define _gloffset_WindowPos3dvMESA 646 -#define _gloffset_WindowPos3fMESA 647 -#define _gloffset_WindowPos3fvMESA 648 -#define _gloffset_WindowPos3iMESA 649 -#define _gloffset_WindowPos3ivMESA 650 -#define _gloffset_WindowPos3sMESA 651 -#define _gloffset_WindowPos3svMESA 652 -#define _gloffset_WindowPos4dMESA 653 -#define _gloffset_WindowPos4dvMESA 654 -#define _gloffset_WindowPos4fMESA 655 -#define _gloffset_WindowPos4fvMESA 656 -#define _gloffset_WindowPos4iMESA 657 -#define _gloffset_WindowPos4ivMESA 658 -#define _gloffset_WindowPos4sMESA 659 -#define _gloffset_WindowPos4svMESA 660 -#define _gloffset_MultiModeDrawArraysIBM 661 -#define _gloffset_MultiModeDrawElementsIBM 662 -#define _gloffset_DeleteFencesNV 663 -#define _gloffset_FinishFenceNV 664 -#define _gloffset_GenFencesNV 665 -#define _gloffset_GetFenceivNV 666 -#define _gloffset_IsFenceNV 667 -#define _gloffset_SetFenceNV 668 -#define _gloffset_TestFenceNV 669 -#define _gloffset_AreProgramsResidentNV 670 -#define _gloffset_BindProgramNV 671 -#define _gloffset_DeleteProgramsNV 672 -#define _gloffset_ExecuteProgramNV 673 -#define _gloffset_GenProgramsNV 674 -#define _gloffset_GetProgramParameterdvNV 675 -#define _gloffset_GetProgramParameterfvNV 676 -#define _gloffset_GetProgramStringNV 677 -#define _gloffset_GetProgramivNV 678 -#define _gloffset_GetTrackMatrixivNV 679 -#define _gloffset_GetVertexAttribPointervNV 680 -#define _gloffset_GetVertexAttribdvNV 681 -#define _gloffset_GetVertexAttribfvNV 682 -#define _gloffset_GetVertexAttribivNV 683 -#define _gloffset_IsProgramNV 684 -#define _gloffset_LoadProgramNV 685 -#define _gloffset_ProgramParameters4dvNV 686 -#define _gloffset_ProgramParameters4fvNV 687 -#define _gloffset_RequestResidentProgramsNV 688 -#define _gloffset_TrackMatrixNV 689 -#define _gloffset_VertexAttrib1dNV 690 -#define _gloffset_VertexAttrib1dvNV 691 -#define _gloffset_VertexAttrib1fNV 692 -#define _gloffset_VertexAttrib1fvNV 693 -#define _gloffset_VertexAttrib1sNV 694 -#define _gloffset_VertexAttrib1svNV 695 -#define _gloffset_VertexAttrib2dNV 696 -#define _gloffset_VertexAttrib2dvNV 697 -#define _gloffset_VertexAttrib2fNV 698 -#define _gloffset_VertexAttrib2fvNV 699 -#define _gloffset_VertexAttrib2sNV 700 -#define _gloffset_VertexAttrib2svNV 701 -#define _gloffset_VertexAttrib3dNV 702 -#define _gloffset_VertexAttrib3dvNV 703 -#define _gloffset_VertexAttrib3fNV 704 -#define _gloffset_VertexAttrib3fvNV 705 -#define _gloffset_VertexAttrib3sNV 706 -#define _gloffset_VertexAttrib3svNV 707 -#define _gloffset_VertexAttrib4dNV 708 -#define _gloffset_VertexAttrib4dvNV 709 -#define _gloffset_VertexAttrib4fNV 710 -#define _gloffset_VertexAttrib4fvNV 711 -#define _gloffset_VertexAttrib4sNV 712 -#define _gloffset_VertexAttrib4svNV 713 -#define _gloffset_VertexAttrib4ubNV 714 -#define _gloffset_VertexAttrib4ubvNV 715 -#define _gloffset_VertexAttribPointerNV 716 -#define _gloffset_VertexAttribs1dvNV 717 -#define _gloffset_VertexAttribs1fvNV 718 -#define _gloffset_VertexAttribs1svNV 719 -#define _gloffset_VertexAttribs2dvNV 720 -#define _gloffset_VertexAttribs2fvNV 721 -#define _gloffset_VertexAttribs2svNV 722 -#define _gloffset_VertexAttribs3dvNV 723 -#define _gloffset_VertexAttribs3fvNV 724 -#define _gloffset_VertexAttribs3svNV 725 -#define _gloffset_VertexAttribs4dvNV 726 -#define _gloffset_VertexAttribs4fvNV 727 -#define _gloffset_VertexAttribs4svNV 728 -#define _gloffset_VertexAttribs4ubvNV 729 -#define _gloffset_GetTexBumpParameterfvATI 730 -#define _gloffset_GetTexBumpParameterivATI 731 -#define _gloffset_TexBumpParameterfvATI 732 -#define _gloffset_TexBumpParameterivATI 733 -#define _gloffset_AlphaFragmentOp1ATI 734 -#define _gloffset_AlphaFragmentOp2ATI 735 -#define _gloffset_AlphaFragmentOp3ATI 736 -#define _gloffset_BeginFragmentShaderATI 737 -#define _gloffset_BindFragmentShaderATI 738 -#define _gloffset_ColorFragmentOp1ATI 739 -#define _gloffset_ColorFragmentOp2ATI 740 -#define _gloffset_ColorFragmentOp3ATI 741 -#define _gloffset_DeleteFragmentShaderATI 742 -#define _gloffset_EndFragmentShaderATI 743 -#define _gloffset_GenFragmentShadersATI 744 -#define _gloffset_PassTexCoordATI 745 -#define _gloffset_SampleMapATI 746 -#define _gloffset_SetFragmentShaderConstantATI 747 -#define _gloffset_PointParameteriNV 748 -#define _gloffset_PointParameterivNV 749 -#define _gloffset_ActiveStencilFaceEXT 750 -#define _gloffset_BindVertexArrayAPPLE 751 -#define _gloffset_DeleteVertexArraysAPPLE 752 -#define _gloffset_GenVertexArraysAPPLE 753 -#define _gloffset_IsVertexArrayAPPLE 754 -#define _gloffset_GetProgramNamedParameterdvNV 755 -#define _gloffset_GetProgramNamedParameterfvNV 756 -#define _gloffset_ProgramNamedParameter4dNV 757 -#define _gloffset_ProgramNamedParameter4dvNV 758 -#define _gloffset_ProgramNamedParameter4fNV 759 -#define _gloffset_ProgramNamedParameter4fvNV 760 -#define _gloffset_DepthBoundsEXT 761 -#define _gloffset_BlendEquationSeparateEXT 762 -#define _gloffset_BindFramebufferEXT 763 -#define _gloffset_BindRenderbufferEXT 764 -#define _gloffset_CheckFramebufferStatusEXT 765 -#define _gloffset_DeleteFramebuffersEXT 766 -#define _gloffset_DeleteRenderbuffersEXT 767 -#define _gloffset_FramebufferRenderbufferEXT 768 -#define _gloffset_FramebufferTexture1DEXT 769 -#define _gloffset_FramebufferTexture2DEXT 770 -#define _gloffset_FramebufferTexture3DEXT 771 -#define _gloffset_GenFramebuffersEXT 772 -#define _gloffset_GenRenderbuffersEXT 773 -#define _gloffset_GenerateMipmapEXT 774 -#define _gloffset_GetFramebufferAttachmentParameterivEXT 775 -#define _gloffset_GetRenderbufferParameterivEXT 776 -#define _gloffset_IsFramebufferEXT 777 -#define _gloffset_IsRenderbufferEXT 778 -#define _gloffset_RenderbufferStorageEXT 779 -#define _gloffset_BlitFramebufferEXT 780 -#define _gloffset_BufferParameteriAPPLE 781 -#define _gloffset_FlushMappedBufferRangeAPPLE 782 -#define _gloffset_FramebufferTextureLayerEXT 783 -#define _gloffset_ProvokingVertexEXT 784 -#define _gloffset_GetTexParameterPointervAPPLE 785 -#define _gloffset_TextureRangeAPPLE 786 -#define _gloffset_StencilFuncSeparateATI 787 -#define _gloffset_ProgramEnvParameters4fvEXT 788 -#define _gloffset_ProgramLocalParameters4fvEXT 789 -#define _gloffset_GetQueryObjecti64vEXT 790 -#define _gloffset_GetQueryObjectui64vEXT 791 -#define _gloffset_FIRST_DYNAMIC 792 +#define _gloffset_DrawElementsBaseVertex 574 +#define _gloffset_DrawRangeElementsBaseVertex 575 +#define _gloffset_MultiDrawElementsBaseVertex 576 +#define _gloffset_PolygonOffsetEXT 577 +#define _gloffset_GetPixelTexGenParameterfvSGIS 578 +#define _gloffset_GetPixelTexGenParameterivSGIS 579 +#define _gloffset_PixelTexGenParameterfSGIS 580 +#define _gloffset_PixelTexGenParameterfvSGIS 581 +#define _gloffset_PixelTexGenParameteriSGIS 582 +#define _gloffset_PixelTexGenParameterivSGIS 583 +#define _gloffset_SampleMaskSGIS 584 +#define _gloffset_SamplePatternSGIS 585 +#define _gloffset_ColorPointerEXT 586 +#define _gloffset_EdgeFlagPointerEXT 587 +#define _gloffset_IndexPointerEXT 588 +#define _gloffset_NormalPointerEXT 589 +#define _gloffset_TexCoordPointerEXT 590 +#define _gloffset_VertexPointerEXT 591 +#define _gloffset_PointParameterfEXT 592 +#define _gloffset_PointParameterfvEXT 593 +#define _gloffset_LockArraysEXT 594 +#define _gloffset_UnlockArraysEXT 595 +#define _gloffset_CullParameterdvEXT 596 +#define _gloffset_CullParameterfvEXT 597 +#define _gloffset_SecondaryColor3bEXT 598 +#define _gloffset_SecondaryColor3bvEXT 599 +#define _gloffset_SecondaryColor3dEXT 600 +#define _gloffset_SecondaryColor3dvEXT 601 +#define _gloffset_SecondaryColor3fEXT 602 +#define _gloffset_SecondaryColor3fvEXT 603 +#define _gloffset_SecondaryColor3iEXT 604 +#define _gloffset_SecondaryColor3ivEXT 605 +#define _gloffset_SecondaryColor3sEXT 606 +#define _gloffset_SecondaryColor3svEXT 607 +#define _gloffset_SecondaryColor3ubEXT 608 +#define _gloffset_SecondaryColor3ubvEXT 609 +#define _gloffset_SecondaryColor3uiEXT 610 +#define _gloffset_SecondaryColor3uivEXT 611 +#define _gloffset_SecondaryColor3usEXT 612 +#define _gloffset_SecondaryColor3usvEXT 613 +#define _gloffset_SecondaryColorPointerEXT 614 +#define _gloffset_MultiDrawArraysEXT 615 +#define _gloffset_MultiDrawElementsEXT 616 +#define _gloffset_FogCoordPointerEXT 617 +#define _gloffset_FogCoorddEXT 618 +#define _gloffset_FogCoorddvEXT 619 +#define _gloffset_FogCoordfEXT 620 +#define _gloffset_FogCoordfvEXT 621 +#define _gloffset_PixelTexGenSGIX 622 +#define _gloffset_BlendFuncSeparateEXT 623 +#define _gloffset_FlushVertexArrayRangeNV 624 +#define _gloffset_VertexArrayRangeNV 625 +#define _gloffset_CombinerInputNV 626 +#define _gloffset_CombinerOutputNV 627 +#define _gloffset_CombinerParameterfNV 628 +#define _gloffset_CombinerParameterfvNV 629 +#define _gloffset_CombinerParameteriNV 630 +#define _gloffset_CombinerParameterivNV 631 +#define _gloffset_FinalCombinerInputNV 632 +#define _gloffset_GetCombinerInputParameterfvNV 633 +#define _gloffset_GetCombinerInputParameterivNV 634 +#define _gloffset_GetCombinerOutputParameterfvNV 635 +#define _gloffset_GetCombinerOutputParameterivNV 636 +#define _gloffset_GetFinalCombinerInputParameterfvNV 637 +#define _gloffset_GetFinalCombinerInputParameterivNV 638 +#define _gloffset_ResizeBuffersMESA 639 +#define _gloffset_WindowPos2dMESA 640 +#define _gloffset_WindowPos2dvMESA 641 +#define _gloffset_WindowPos2fMESA 642 +#define _gloffset_WindowPos2fvMESA 643 +#define _gloffset_WindowPos2iMESA 644 +#define _gloffset_WindowPos2ivMESA 645 +#define _gloffset_WindowPos2sMESA 646 +#define _gloffset_WindowPos2svMESA 647 +#define _gloffset_WindowPos3dMESA 648 +#define _gloffset_WindowPos3dvMESA 649 +#define _gloffset_WindowPos3fMESA 650 +#define _gloffset_WindowPos3fvMESA 651 +#define _gloffset_WindowPos3iMESA 652 +#define _gloffset_WindowPos3ivMESA 653 +#define _gloffset_WindowPos3sMESA 654 +#define _gloffset_WindowPos3svMESA 655 +#define _gloffset_WindowPos4dMESA 656 +#define _gloffset_WindowPos4dvMESA 657 +#define _gloffset_WindowPos4fMESA 658 +#define _gloffset_WindowPos4fvMESA 659 +#define _gloffset_WindowPos4iMESA 660 +#define _gloffset_WindowPos4ivMESA 661 +#define _gloffset_WindowPos4sMESA 662 +#define _gloffset_WindowPos4svMESA 663 +#define _gloffset_MultiModeDrawArraysIBM 664 +#define _gloffset_MultiModeDrawElementsIBM 665 +#define _gloffset_DeleteFencesNV 666 +#define _gloffset_FinishFenceNV 667 +#define _gloffset_GenFencesNV 668 +#define _gloffset_GetFenceivNV 669 +#define _gloffset_IsFenceNV 670 +#define _gloffset_SetFenceNV 671 +#define _gloffset_TestFenceNV 672 +#define _gloffset_AreProgramsResidentNV 673 +#define _gloffset_BindProgramNV 674 +#define _gloffset_DeleteProgramsNV 675 +#define _gloffset_ExecuteProgramNV 676 +#define _gloffset_GenProgramsNV 677 +#define _gloffset_GetProgramParameterdvNV 678 +#define _gloffset_GetProgramParameterfvNV 679 +#define _gloffset_GetProgramStringNV 680 +#define _gloffset_GetProgramivNV 681 +#define _gloffset_GetTrackMatrixivNV 682 +#define _gloffset_GetVertexAttribPointervNV 683 +#define _gloffset_GetVertexAttribdvNV 684 +#define _gloffset_GetVertexAttribfvNV 685 +#define _gloffset_GetVertexAttribivNV 686 +#define _gloffset_IsProgramNV 687 +#define _gloffset_LoadProgramNV 688 +#define _gloffset_ProgramParameters4dvNV 689 +#define _gloffset_ProgramParameters4fvNV 690 +#define _gloffset_RequestResidentProgramsNV 691 +#define _gloffset_TrackMatrixNV 692 +#define _gloffset_VertexAttrib1dNV 693 +#define _gloffset_VertexAttrib1dvNV 694 +#define _gloffset_VertexAttrib1fNV 695 +#define _gloffset_VertexAttrib1fvNV 696 +#define _gloffset_VertexAttrib1sNV 697 +#define _gloffset_VertexAttrib1svNV 698 +#define _gloffset_VertexAttrib2dNV 699 +#define _gloffset_VertexAttrib2dvNV 700 +#define _gloffset_VertexAttrib2fNV 701 +#define _gloffset_VertexAttrib2fvNV 702 +#define _gloffset_VertexAttrib2sNV 703 +#define _gloffset_VertexAttrib2svNV 704 +#define _gloffset_VertexAttrib3dNV 705 +#define _gloffset_VertexAttrib3dvNV 706 +#define _gloffset_VertexAttrib3fNV 707 +#define _gloffset_VertexAttrib3fvNV 708 +#define _gloffset_VertexAttrib3sNV 709 +#define _gloffset_VertexAttrib3svNV 710 +#define _gloffset_VertexAttrib4dNV 711 +#define _gloffset_VertexAttrib4dvNV 712 +#define _gloffset_VertexAttrib4fNV 713 +#define _gloffset_VertexAttrib4fvNV 714 +#define _gloffset_VertexAttrib4sNV 715 +#define _gloffset_VertexAttrib4svNV 716 +#define _gloffset_VertexAttrib4ubNV 717 +#define _gloffset_VertexAttrib4ubvNV 718 +#define _gloffset_VertexAttribPointerNV 719 +#define _gloffset_VertexAttribs1dvNV 720 +#define _gloffset_VertexAttribs1fvNV 721 +#define _gloffset_VertexAttribs1svNV 722 +#define _gloffset_VertexAttribs2dvNV 723 +#define _gloffset_VertexAttribs2fvNV 724 +#define _gloffset_VertexAttribs2svNV 725 +#define _gloffset_VertexAttribs3dvNV 726 +#define _gloffset_VertexAttribs3fvNV 727 +#define _gloffset_VertexAttribs3svNV 728 +#define _gloffset_VertexAttribs4dvNV 729 +#define _gloffset_VertexAttribs4fvNV 730 +#define _gloffset_VertexAttribs4svNV 731 +#define _gloffset_VertexAttribs4ubvNV 732 +#define _gloffset_GetTexBumpParameterfvATI 733 +#define _gloffset_GetTexBumpParameterivATI 734 +#define _gloffset_TexBumpParameterfvATI 735 +#define _gloffset_TexBumpParameterivATI 736 +#define _gloffset_AlphaFragmentOp1ATI 737 +#define _gloffset_AlphaFragmentOp2ATI 738 +#define _gloffset_AlphaFragmentOp3ATI 739 +#define _gloffset_BeginFragmentShaderATI 740 +#define _gloffset_BindFragmentShaderATI 741 +#define _gloffset_ColorFragmentOp1ATI 742 +#define _gloffset_ColorFragmentOp2ATI 743 +#define _gloffset_ColorFragmentOp3ATI 744 +#define _gloffset_DeleteFragmentShaderATI 745 +#define _gloffset_EndFragmentShaderATI 746 +#define _gloffset_GenFragmentShadersATI 747 +#define _gloffset_PassTexCoordATI 748 +#define _gloffset_SampleMapATI 749 +#define _gloffset_SetFragmentShaderConstantATI 750 +#define _gloffset_PointParameteriNV 751 +#define _gloffset_PointParameterivNV 752 +#define _gloffset_ActiveStencilFaceEXT 753 +#define _gloffset_BindVertexArrayAPPLE 754 +#define _gloffset_DeleteVertexArraysAPPLE 755 +#define _gloffset_GenVertexArraysAPPLE 756 +#define _gloffset_IsVertexArrayAPPLE 757 +#define _gloffset_GetProgramNamedParameterdvNV 758 +#define _gloffset_GetProgramNamedParameterfvNV 759 +#define _gloffset_ProgramNamedParameter4dNV 760 +#define _gloffset_ProgramNamedParameter4dvNV 761 +#define _gloffset_ProgramNamedParameter4fNV 762 +#define _gloffset_ProgramNamedParameter4fvNV 763 +#define _gloffset_DepthBoundsEXT 764 +#define _gloffset_BlendEquationSeparateEXT 765 +#define _gloffset_BindFramebufferEXT 766 +#define _gloffset_BindRenderbufferEXT 767 +#define _gloffset_CheckFramebufferStatusEXT 768 +#define _gloffset_DeleteFramebuffersEXT 769 +#define _gloffset_DeleteRenderbuffersEXT 770 +#define _gloffset_FramebufferRenderbufferEXT 771 +#define _gloffset_FramebufferTexture1DEXT 772 +#define _gloffset_FramebufferTexture2DEXT 773 +#define _gloffset_FramebufferTexture3DEXT 774 +#define _gloffset_GenFramebuffersEXT 775 +#define _gloffset_GenRenderbuffersEXT 776 +#define _gloffset_GenerateMipmapEXT 777 +#define _gloffset_GetFramebufferAttachmentParameterivEXT 778 +#define _gloffset_GetRenderbufferParameterivEXT 779 +#define _gloffset_IsFramebufferEXT 780 +#define _gloffset_IsRenderbufferEXT 781 +#define _gloffset_RenderbufferStorageEXT 782 +#define _gloffset_BlitFramebufferEXT 783 +#define _gloffset_BufferParameteriAPPLE 784 +#define _gloffset_FlushMappedBufferRangeAPPLE 785 +#define _gloffset_FramebufferTextureLayerEXT 786 +#define _gloffset_ProvokingVertexEXT 787 +#define _gloffset_GetTexParameterPointervAPPLE 788 +#define _gloffset_TextureRangeAPPLE 789 +#define _gloffset_StencilFuncSeparateATI 790 +#define _gloffset_ProgramEnvParameters4fvEXT 791 +#define _gloffset_ProgramLocalParameters4fvEXT 792 +#define _gloffset_GetQueryObjecti64vEXT 793 +#define _gloffset_GetQueryObjectui64vEXT 794 +#define _gloffset_FIRST_DYNAMIC 795 #else @@ -994,6 +999,9 @@ #define _gloffset_GetSynciv driDispatchRemapTable[GetSynciv_remap_index] #define _gloffset_IsSync driDispatchRemapTable[IsSync_remap_index] #define _gloffset_WaitSync driDispatchRemapTable[WaitSync_remap_index] +#define _gloffset_DrawElementsBaseVertex driDispatchRemapTable[DrawElementsBaseVertex_remap_index] +#define _gloffset_DrawRangeElementsBaseVertex driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index] +#define _gloffset_MultiDrawElementsBaseVertex driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index] #define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] #define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index] #define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index] @@ -1213,6 +1221,6 @@ #define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] #define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] -#endif /* !defined(IN_DRI_DRIVER) */ +#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */ #endif /* !defined( _GLAPI_OFFSETS_H_ ) */ diff --git a/mesalib/src/mesa/glapi/glapitable.h b/mesalib/src/mesa/glapi/glapitable.h index 855fcaa7f..4f9e53b62 100644 --- a/mesalib/src/mesa/glapi/glapitable.h +++ b/mesalib/src/mesa/glapi/glapitable.h @@ -614,224 +614,227 @@ struct _glapi_table void (GLAPIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values); /* 571 */ GLboolean (GLAPIENTRYP IsSync)(GLsync sync); /* 572 */ void (GLAPIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 573 */ - void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 574 */ - void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 575 */ - void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 576 */ - void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 577 */ - void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 578 */ - void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 579 */ - void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 580 */ - void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 581 */ - void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 582 */ - void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 583 */ - void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 584 */ - void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 585 */ - void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 586 */ - void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 587 */ - void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 588 */ - void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 589 */ - void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 590 */ - void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 591 */ - void (GLAPIENTRYP UnlockArraysEXT)(void); /* 592 */ - void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 593 */ - void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 594 */ - void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 595 */ - void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 596 */ - void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 597 */ - void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 598 */ - void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 599 */ - void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 600 */ - void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 601 */ - void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 602 */ - void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 603 */ - void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 604 */ - void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 605 */ - void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 606 */ - void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 607 */ - void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 608 */ - void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 609 */ - void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 610 */ - void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 611 */ - void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 612 */ - void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 613 */ - void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 614 */ - void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 615 */ - void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 616 */ - void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 617 */ - void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 618 */ - void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 619 */ - void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 620 */ - void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 621 */ - void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 622 */ - void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 623 */ - void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 624 */ - void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 625 */ - void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 626 */ - void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 627 */ - void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 628 */ - void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 629 */ - void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 630 */ - void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 631 */ - void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 632 */ - void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 633 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 634 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 635 */ - void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 636 */ - void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 637 */ - void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 638 */ - void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 639 */ - void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 640 */ - void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 641 */ - void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 642 */ - void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 643 */ - void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 644 */ - void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 645 */ - void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 646 */ - void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 647 */ - void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 648 */ - void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 649 */ - void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 650 */ - void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 651 */ - void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 652 */ - void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 653 */ - void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 654 */ - void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 655 */ - void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 656 */ - void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 657 */ - void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 658 */ - void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 659 */ - void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 660 */ - void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 661 */ - void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 662 */ - void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 663 */ - void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 664 */ - void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 665 */ - void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 666 */ - GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 667 */ - void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 668 */ - GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 669 */ - GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 670 */ - void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 671 */ - void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 672 */ - void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 673 */ - void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 674 */ - void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 675 */ - void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 676 */ - void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 677 */ - void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 678 */ - void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 679 */ - void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 680 */ - void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 681 */ - void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 682 */ - void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 683 */ - GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 684 */ - void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 685 */ - void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 686 */ - void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 687 */ - void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 688 */ - void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 689 */ - void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 690 */ - void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 691 */ - void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 692 */ - void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 693 */ - void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 694 */ - void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 695 */ - void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 696 */ - void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 697 */ - void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 698 */ - void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 699 */ - void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 700 */ - void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 701 */ - void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 702 */ - void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 703 */ - void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 704 */ - void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 705 */ - void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 706 */ - void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 707 */ - void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 708 */ - void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 709 */ - void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 710 */ - void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 711 */ - void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 712 */ - void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 713 */ - void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 714 */ - void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 715 */ - void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 716 */ - void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */ - void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */ - void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */ - void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 720 */ - void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 721 */ - void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 722 */ - void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 723 */ - void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 724 */ - void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 725 */ - void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 726 */ - void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 727 */ - void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 728 */ - void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 729 */ - void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 730 */ - void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 731 */ - void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 732 */ - void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 733 */ - void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 734 */ - void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 735 */ - 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); /* 736 */ - void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 737 */ - void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 738 */ - void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 739 */ - void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 740 */ - 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); /* 741 */ - void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 742 */ - void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 743 */ - GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 744 */ - void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 745 */ - void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 746 */ - void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 747 */ - void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 748 */ - void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 749 */ - void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 750 */ - void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 751 */ - void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 752 */ - void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 753 */ - GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 754 */ - void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 755 */ - void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 756 */ - void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 757 */ - void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 758 */ - void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 759 */ - void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 760 */ - void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 761 */ - void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 762 */ - void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 763 */ - void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 764 */ - GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 765 */ - void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 766 */ - void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 767 */ - void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 768 */ - void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 769 */ - void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 770 */ - void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 771 */ - void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 772 */ - void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 773 */ - void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 774 */ - void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 775 */ - void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 776 */ - GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 777 */ - GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 778 */ - void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 779 */ - void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 780 */ - void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 781 */ - void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 782 */ - void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 783 */ - void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 784 */ - void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 785 */ - void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 786 */ - void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 787 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 788 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 789 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 790 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 791 */ + void (GLAPIENTRYP DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 574 */ + void (GLAPIENTRYP DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 575 */ + void (GLAPIENTRYP MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex); /* 576 */ + void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 577 */ + void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 578 */ + void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 579 */ + void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 580 */ + void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 581 */ + void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 582 */ + void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 583 */ + void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 584 */ + void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 585 */ + void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 586 */ + void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 587 */ + void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 588 */ + void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 589 */ + void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 590 */ + void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 591 */ + void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 592 */ + void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 593 */ + void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 594 */ + void (GLAPIENTRYP UnlockArraysEXT)(void); /* 595 */ + void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 596 */ + void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 597 */ + void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 598 */ + void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 599 */ + void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 600 */ + void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 601 */ + void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 602 */ + void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 603 */ + void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 604 */ + void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 605 */ + void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 606 */ + void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 607 */ + void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 608 */ + void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 609 */ + void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 610 */ + void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 611 */ + void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 612 */ + void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 613 */ + void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 614 */ + void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 615 */ + void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 616 */ + void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 617 */ + void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 618 */ + void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 619 */ + void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 620 */ + void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 621 */ + void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 622 */ + void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 623 */ + void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 624 */ + void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 625 */ + void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 626 */ + void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 627 */ + void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 628 */ + void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 629 */ + void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 630 */ + void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 631 */ + void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 632 */ + void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 633 */ + void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 634 */ + void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 635 */ + void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 636 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 637 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 638 */ + void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 639 */ + void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 640 */ + void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 641 */ + void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 642 */ + void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 643 */ + void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 644 */ + void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 645 */ + void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 646 */ + void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 647 */ + void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 648 */ + void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 649 */ + void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 650 */ + void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 651 */ + void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 652 */ + void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 653 */ + void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 654 */ + void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 655 */ + void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 656 */ + void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 657 */ + void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 658 */ + void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 659 */ + void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 660 */ + void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 661 */ + void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 662 */ + void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 663 */ + void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 664 */ + void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 665 */ + void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 666 */ + void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 667 */ + void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 668 */ + void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 669 */ + GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 670 */ + void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 671 */ + GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 672 */ + GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 673 */ + void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 674 */ + void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 675 */ + void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 676 */ + void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 677 */ + void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 678 */ + void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 679 */ + void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 680 */ + void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 681 */ + void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 682 */ + void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 683 */ + void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 684 */ + void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 685 */ + void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 686 */ + GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 687 */ + void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 688 */ + void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 689 */ + void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 690 */ + void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 691 */ + void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 692 */ + void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 693 */ + void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 694 */ + void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 695 */ + void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 696 */ + void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 697 */ + void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 698 */ + void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 699 */ + void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 700 */ + void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 701 */ + void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 702 */ + void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 703 */ + void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 704 */ + void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 705 */ + void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 706 */ + void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 707 */ + void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 708 */ + void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 709 */ + void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 710 */ + void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 711 */ + void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 712 */ + void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 713 */ + void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 714 */ + void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 715 */ + void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 716 */ + void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 717 */ + void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 718 */ + void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 719 */ + void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 720 */ + void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 721 */ + void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 722 */ + void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 723 */ + void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 724 */ + void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 725 */ + void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 726 */ + void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 727 */ + void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 728 */ + void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 729 */ + void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 730 */ + void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 731 */ + void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 732 */ + void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 733 */ + void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 734 */ + void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 735 */ + void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 736 */ + void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 737 */ + void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 738 */ + 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); /* 739 */ + void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 740 */ + void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 741 */ + void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 742 */ + void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 743 */ + 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); /* 744 */ + void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 745 */ + void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 746 */ + GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 747 */ + void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 748 */ + void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 749 */ + void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 750 */ + void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 751 */ + void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 752 */ + void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 753 */ + void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 754 */ + void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 755 */ + void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 756 */ + GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 757 */ + void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 758 */ + void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 759 */ + void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 760 */ + void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 761 */ + void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 762 */ + void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 763 */ + void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 764 */ + void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 765 */ + void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 766 */ + void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 767 */ + GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 768 */ + void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 769 */ + void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 770 */ + void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 771 */ + void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 772 */ + void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 773 */ + void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 774 */ + void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 775 */ + void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 776 */ + void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 777 */ + void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 778 */ + void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 779 */ + GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 780 */ + GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 781 */ + void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 782 */ + void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 783 */ + void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 784 */ + void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 785 */ + void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 786 */ + void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 787 */ + void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 788 */ + void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 789 */ + void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 790 */ + void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 791 */ + void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 792 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 793 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 794 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/mesalib/src/mesa/glapi/glapitemp.h b/mesalib/src/mesa/glapi/glapitemp.h index e08f9548f..319a4ab55 100644 --- a/mesalib/src/mesa/glapi/glapitemp.h +++ b/mesalib/src/mesa/glapi/glapitemp.h @@ -4011,6 +4011,11 @@ KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisample)(GLenum target, GLsiz 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(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length) { DISPATCH(FlushMappedBufferRange, (target, offset, length), (F, "glFlushMappedBufferRange(0x%x, %d, %d);\n", target, offset, length)); @@ -4071,63 +4076,78 @@ KEYWORD1 void KEYWORD2 NAME(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 ti 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(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) { DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_575)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_575)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(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_576)(GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(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_577)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLfloat param) { DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(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_579)(GLenum pname, GLint param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLint param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(GLenum pname, GLint param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLint param) { DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, const GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_583)(GLenum pname, const GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, const GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_583)(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_581)(GLclampf value, GLboolean invert); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_584)(GLclampf value, GLboolean invert); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLclampf value, GLboolean invert) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_584)(GLclampf value, GLboolean invert) { DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pattern); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_585)(GLenum pattern); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pattern) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_585)(GLenum pattern) { DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); } @@ -4177,9 +4197,9 @@ 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_589)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_592)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_589)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_592)(GLenum pname, GLfloat param) { DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); } @@ -4199,9 +4219,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_590)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_590)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, const GLfloat * params) { DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } @@ -4216,16 +4236,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, GLdouble * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_596)(GLenum pname, GLdouble * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, GLdouble * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_596)(GLenum pname, GLdouble * params) { DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_594)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_597)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_594)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_597)(GLenum pname, GLfloat * params) { DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } @@ -4470,9 +4490,9 @@ 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_619)(GLenum mode); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_622)(GLenum mode); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_619)(GLenum mode) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_622)(GLenum mode) { DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); } @@ -4487,9 +4507,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac 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_620)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_623)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_620)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_623)(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)); } @@ -4854,65 +4874,65 @@ 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_661)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(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_662)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(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_663)(GLsizei n, const GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLsizei n, const GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_663)(GLsizei n, const GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(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_664)(GLuint fence); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(GLuint fence) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence) { DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(GLsizei n, GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLsizei n, GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(GLsizei n, GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLsizei n, GLuint * fences) { DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLuint fence, GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence, GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLuint fence, GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_669)(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_667)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_670)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_670)(GLuint fence) { RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLuint fence, GLenum condition); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_671)(GLuint fence, GLenum condition); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLuint fence, GLenum condition) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_671)(GLuint fence, GLenum condition) { DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_672)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_672)(GLuint fence) { RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); } @@ -5357,16 +5377,16 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_750)(GLenum face); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLenum face); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_750)(GLenum face) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLenum face) { DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_751)(GLuint array); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_754)(GLuint array); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_751)(GLuint array) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_754)(GLuint array) { DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); } @@ -5376,16 +5396,16 @@ 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_752)(GLsizei n, const GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_755)(GLsizei n, const GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_752)(GLsizei n, const GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_755)(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_753)(GLsizei n, GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_756)(GLsizei n, GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLsizei n, GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_756)(GLsizei n, GLuint * arrays) { DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } @@ -5395,9 +5415,9 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsVertexArray)(GLuint array) RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArray(%d);\n", array)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_754)(GLuint array); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_757)(GLuint array); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_754)(GLuint array) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_757)(GLuint array) { RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); } @@ -5432,9 +5452,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLclampd zmin, GLclampd zmax); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLclampd zmin, GLclampd zmax); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLclampd zmin, GLclampd zmax) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLclampd zmin, GLclampd zmax) { DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); } @@ -5444,9 +5464,9 @@ 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_762)(GLenum modeRGB, GLenum modeA); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum modeRGB, GLenum modeA); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_762)(GLenum modeRGB, GLenum modeA) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum modeRGB, GLenum modeA) { DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); } @@ -5626,23 +5646,23 @@ KEYWORD1 void KEYWORD2 NAME(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint src 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_780)(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_783)(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_780)(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_783)(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_781)(GLenum target, GLenum pname, GLint param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_784)(GLenum target, GLenum pname, GLint param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_781)(GLenum target, GLenum pname, GLint param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_784)(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_782)(GLenum target, GLintptr offset, GLsizeiptr size); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLintptr offset, GLsizeiptr size); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_782)(GLenum target, GLintptr offset, GLsizeiptr size) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLintptr offset, GLsizeiptr size) { DISPATCH(FlushMappedBufferRangeAPPLE, (target, offset, size), (F, "glFlushMappedBufferRangeAPPLE(0x%x, %d, %d);\n", target, offset, size)); } @@ -5662,51 +5682,56 @@ KEYWORD1 void KEYWORD2 NAME(ProvokingVertexEXT)(GLenum mode) DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertexEXT(0x%x);\n", mode)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLenum pname, GLvoid ** params); +KEYWORD1 void KEYWORD2 NAME(ProvokingVertex)(GLenum mode) +{ + DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertex(0x%x);\n", mode)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLenum pname, GLvoid ** params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLenum pname, GLvoid ** params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(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_786)(GLenum target, GLsizei length, GLvoid * pointer); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLsizei length, GLvoid * pointer); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_786)(GLenum target, GLsizei length, GLvoid * pointer) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLsizei length, GLvoid * pointer) { DISPATCH(TextureRangeAPPLE, (target, length, pointer), (F, "glTextureRangeAPPLE(0x%x, %d, %p);\n", target, length, (const void *) pointer)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_787)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_787)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(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_788)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(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_789)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_792)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_792)(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_790)(GLuint id, GLenum pname, GLint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_793)(GLuint id, GLenum pname, GLint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(GLuint id, GLenum pname, GLint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_793)(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_791)(GLuint id, GLenum pname, GLuint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_794)(GLuint id, GLenum pname, GLuint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(GLuint id, GLenum pname, GLuint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_794)(GLuint id, GLenum pname, GLuint64EXT * params) { DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } @@ -6299,15 +6324,18 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(GetSynciv), TABLE_ENTRY(IsSync), TABLE_ENTRY(WaitSync), + TABLE_ENTRY(DrawElementsBaseVertex), + TABLE_ENTRY(DrawRangeElementsBaseVertex), + TABLE_ENTRY(MultiDrawElementsBaseVertex), TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_575), - TABLE_ENTRY(_dispatch_stub_576), - TABLE_ENTRY(_dispatch_stub_577), TABLE_ENTRY(_dispatch_stub_578), TABLE_ENTRY(_dispatch_stub_579), TABLE_ENTRY(_dispatch_stub_580), TABLE_ENTRY(_dispatch_stub_581), TABLE_ENTRY(_dispatch_stub_582), + TABLE_ENTRY(_dispatch_stub_583), + TABLE_ENTRY(_dispatch_stub_584), + TABLE_ENTRY(_dispatch_stub_585), TABLE_ENTRY(ColorPointerEXT), TABLE_ENTRY(EdgeFlagPointerEXT), TABLE_ENTRY(IndexPointerEXT), @@ -6318,8 +6346,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(PointParameterfvEXT), TABLE_ENTRY(LockArraysEXT), TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_593), - TABLE_ENTRY(_dispatch_stub_594), + TABLE_ENTRY(_dispatch_stub_596), + TABLE_ENTRY(_dispatch_stub_597), TABLE_ENTRY(SecondaryColor3bEXT), TABLE_ENTRY(SecondaryColor3bvEXT), TABLE_ENTRY(SecondaryColor3dEXT), @@ -6344,7 +6372,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(FogCoorddvEXT), TABLE_ENTRY(FogCoordfEXT), TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_619), + TABLE_ENTRY(_dispatch_stub_622), TABLE_ENTRY(BlendFuncSeparateEXT), TABLE_ENTRY(FlushVertexArrayRangeNV), TABLE_ENTRY(VertexArrayRangeNV), @@ -6386,15 +6414,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(WindowPos4ivMESA), TABLE_ENTRY(WindowPos4sMESA), TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_661), - TABLE_ENTRY(_dispatch_stub_662), - TABLE_ENTRY(_dispatch_stub_663), TABLE_ENTRY(_dispatch_stub_664), TABLE_ENTRY(_dispatch_stub_665), TABLE_ENTRY(_dispatch_stub_666), TABLE_ENTRY(_dispatch_stub_667), TABLE_ENTRY(_dispatch_stub_668), TABLE_ENTRY(_dispatch_stub_669), + TABLE_ENTRY(_dispatch_stub_670), + TABLE_ENTRY(_dispatch_stub_671), + TABLE_ENTRY(_dispatch_stub_672), TABLE_ENTRY(AreProgramsResidentNV), TABLE_ENTRY(BindProgramNV), TABLE_ENTRY(DeleteProgramsNV), @@ -6475,19 +6503,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(SetFragmentShaderConstantATI), TABLE_ENTRY(PointParameteriNV), TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_750), - TABLE_ENTRY(_dispatch_stub_751), - TABLE_ENTRY(_dispatch_stub_752), TABLE_ENTRY(_dispatch_stub_753), TABLE_ENTRY(_dispatch_stub_754), + TABLE_ENTRY(_dispatch_stub_755), + TABLE_ENTRY(_dispatch_stub_756), + TABLE_ENTRY(_dispatch_stub_757), TABLE_ENTRY(GetProgramNamedParameterdvNV), TABLE_ENTRY(GetProgramNamedParameterfvNV), TABLE_ENTRY(ProgramNamedParameter4dNV), TABLE_ENTRY(ProgramNamedParameter4dvNV), TABLE_ENTRY(ProgramNamedParameter4fNV), TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_761), - TABLE_ENTRY(_dispatch_stub_762), + TABLE_ENTRY(_dispatch_stub_764), + TABLE_ENTRY(_dispatch_stub_765), TABLE_ENTRY(BindFramebufferEXT), TABLE_ENTRY(BindRenderbufferEXT), TABLE_ENTRY(CheckFramebufferStatusEXT), @@ -6505,18 +6533,18 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(IsFramebufferEXT), TABLE_ENTRY(IsRenderbufferEXT), TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_780), - TABLE_ENTRY(_dispatch_stub_781), - TABLE_ENTRY(_dispatch_stub_782), + TABLE_ENTRY(_dispatch_stub_783), + TABLE_ENTRY(_dispatch_stub_784), + TABLE_ENTRY(_dispatch_stub_785), TABLE_ENTRY(FramebufferTextureLayerEXT), TABLE_ENTRY(ProvokingVertexEXT), - TABLE_ENTRY(_dispatch_stub_785), - TABLE_ENTRY(_dispatch_stub_786), - TABLE_ENTRY(_dispatch_stub_787), TABLE_ENTRY(_dispatch_stub_788), TABLE_ENTRY(_dispatch_stub_789), TABLE_ENTRY(_dispatch_stub_790), TABLE_ENTRY(_dispatch_stub_791), + TABLE_ENTRY(_dispatch_stub_792), + TABLE_ENTRY(_dispatch_stub_793), + TABLE_ENTRY(_dispatch_stub_794), /* 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. @@ -6814,6 +6842,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(GetAttribLocation), TABLE_ENTRY(DrawBuffers), TABLE_ENTRY(DrawBuffersATI), + TABLE_ENTRY(RenderbufferStorageMultisampleEXT), TABLE_ENTRY(PointParameterf), TABLE_ENTRY(PointParameterfARB), TABLE_ENTRY(PointParameterfv), @@ -6905,6 +6934,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(RenderbufferStorage), TABLE_ENTRY(BlitFramebuffer), TABLE_ENTRY(FramebufferTextureLayer), + TABLE_ENTRY(ProvokingVertex), }; #endif /*UNUSED_TABLE_NAME*/ diff --git a/mesalib/src/mesa/glapi/glprocs.h b/mesalib/src/mesa/glapi/glprocs.h index ae6603262..1ad7e8433 100644 --- a/mesalib/src/mesa/glapi/glprocs.h +++ b/mesalib/src/mesa/glapi/glprocs.h @@ -626,6 +626,9 @@ static const char gl_string_table[] = "glGetSynciv\0" "glIsSync\0" "glWaitSync\0" + "glDrawElementsBaseVertex\0" + "glDrawRangeElementsBaseVertex\0" + "glMultiDrawElementsBaseVertex\0" "glPolygonOffsetEXT\0" "glGetPixelTexGenParameterfvSGIS\0" "glGetPixelTexGenParameterivSGIS\0" @@ -1047,6 +1050,7 @@ static const char gl_string_table[] = "glGetAttribLocation\0" "glDrawBuffers\0" "glDrawBuffersATI\0" + "glRenderbufferStorageMultisampleEXT\0" "glSampleMaskEXT\0" "glSamplePatternEXT\0" "glPointParameterf\0" @@ -1144,6 +1148,7 @@ static const char gl_string_table[] = "glRenderbufferStorage\0" "glBlitFramebuffer\0" "glFramebufferTextureLayer\0" + "glProvokingVertex\0" ; @@ -1161,43 +1166,43 @@ static const char gl_string_table[] = #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_575 mgl_dispatch_stub_575 -#define gl_dispatch_stub_576 mgl_dispatch_stub_576 -#define gl_dispatch_stub_577 mgl_dispatch_stub_577 #define gl_dispatch_stub_578 mgl_dispatch_stub_578 #define gl_dispatch_stub_579 mgl_dispatch_stub_579 #define gl_dispatch_stub_580 mgl_dispatch_stub_580 #define gl_dispatch_stub_581 mgl_dispatch_stub_581 #define gl_dispatch_stub_582 mgl_dispatch_stub_582 -#define gl_dispatch_stub_593 mgl_dispatch_stub_593 -#define gl_dispatch_stub_594 mgl_dispatch_stub_594 -#define gl_dispatch_stub_619 mgl_dispatch_stub_619 -#define gl_dispatch_stub_661 mgl_dispatch_stub_661 -#define gl_dispatch_stub_662 mgl_dispatch_stub_662 -#define gl_dispatch_stub_663 mgl_dispatch_stub_663 +#define gl_dispatch_stub_583 mgl_dispatch_stub_583 +#define gl_dispatch_stub_584 mgl_dispatch_stub_584 +#define gl_dispatch_stub_585 mgl_dispatch_stub_585 +#define gl_dispatch_stub_596 mgl_dispatch_stub_596 +#define gl_dispatch_stub_597 mgl_dispatch_stub_597 +#define gl_dispatch_stub_622 mgl_dispatch_stub_622 #define gl_dispatch_stub_664 mgl_dispatch_stub_664 #define gl_dispatch_stub_665 mgl_dispatch_stub_665 #define gl_dispatch_stub_666 mgl_dispatch_stub_666 #define gl_dispatch_stub_667 mgl_dispatch_stub_667 #define gl_dispatch_stub_668 mgl_dispatch_stub_668 #define gl_dispatch_stub_669 mgl_dispatch_stub_669 -#define gl_dispatch_stub_750 mgl_dispatch_stub_750 -#define gl_dispatch_stub_751 mgl_dispatch_stub_751 -#define gl_dispatch_stub_752 mgl_dispatch_stub_752 +#define gl_dispatch_stub_670 mgl_dispatch_stub_670 +#define gl_dispatch_stub_671 mgl_dispatch_stub_671 +#define gl_dispatch_stub_672 mgl_dispatch_stub_672 #define gl_dispatch_stub_753 mgl_dispatch_stub_753 #define gl_dispatch_stub_754 mgl_dispatch_stub_754 -#define gl_dispatch_stub_761 mgl_dispatch_stub_761 -#define gl_dispatch_stub_762 mgl_dispatch_stub_762 -#define gl_dispatch_stub_780 mgl_dispatch_stub_780 -#define gl_dispatch_stub_781 mgl_dispatch_stub_781 -#define gl_dispatch_stub_782 mgl_dispatch_stub_782 +#define gl_dispatch_stub_755 mgl_dispatch_stub_755 +#define gl_dispatch_stub_756 mgl_dispatch_stub_756 +#define gl_dispatch_stub_757 mgl_dispatch_stub_757 +#define gl_dispatch_stub_764 mgl_dispatch_stub_764 +#define gl_dispatch_stub_765 mgl_dispatch_stub_765 +#define gl_dispatch_stub_783 mgl_dispatch_stub_783 +#define gl_dispatch_stub_784 mgl_dispatch_stub_784 #define gl_dispatch_stub_785 mgl_dispatch_stub_785 -#define gl_dispatch_stub_786 mgl_dispatch_stub_786 -#define gl_dispatch_stub_787 mgl_dispatch_stub_787 #define gl_dispatch_stub_788 mgl_dispatch_stub_788 #define gl_dispatch_stub_789 mgl_dispatch_stub_789 #define gl_dispatch_stub_790 mgl_dispatch_stub_790 #define gl_dispatch_stub_791 mgl_dispatch_stub_791 +#define gl_dispatch_stub_792 mgl_dispatch_stub_792 +#define gl_dispatch_stub_793 mgl_dispatch_stub_793 +#define gl_dispatch_stub_794 mgl_dispatch_stub_794 #endif /* USE_MGL_NAMESPACE */ @@ -1215,43 +1220,43 @@ 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_575(GLenum pname, GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_576(GLenum pname, GLint * params); -void GLAPIENTRY gl_dispatch_stub_577(GLenum pname, GLfloat param); -void GLAPIENTRY gl_dispatch_stub_578(GLenum pname, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_579(GLenum pname, GLint param); -void GLAPIENTRY gl_dispatch_stub_580(GLenum pname, const GLint * params); -void GLAPIENTRY gl_dispatch_stub_581(GLclampf value, GLboolean invert); -void GLAPIENTRY gl_dispatch_stub_582(GLenum pattern); -void GLAPIENTRY gl_dispatch_stub_593(GLenum pname, GLdouble * params); -void GLAPIENTRY gl_dispatch_stub_594(GLenum pname, GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_619(GLenum mode); -void GLAPIENTRY gl_dispatch_stub_661(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -void GLAPIENTRY gl_dispatch_stub_662(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); -void GLAPIENTRY gl_dispatch_stub_663(GLsizei n, const GLuint * fences); -void GLAPIENTRY gl_dispatch_stub_664(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_665(GLsizei n, GLuint * fences); -void GLAPIENTRY gl_dispatch_stub_666(GLuint fence, GLenum pname, GLint * params); -GLboolean GLAPIENTRY gl_dispatch_stub_667(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_668(GLuint fence, GLenum condition); -GLboolean GLAPIENTRY gl_dispatch_stub_669(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_750(GLenum face); -void GLAPIENTRY gl_dispatch_stub_751(GLuint array); -void GLAPIENTRY gl_dispatch_stub_752(GLsizei n, const GLuint * arrays); -void GLAPIENTRY gl_dispatch_stub_753(GLsizei n, GLuint * arrays); -GLboolean GLAPIENTRY gl_dispatch_stub_754(GLuint array); -void GLAPIENTRY gl_dispatch_stub_761(GLclampd zmin, GLclampd zmax); -void GLAPIENTRY gl_dispatch_stub_762(GLenum modeRGB, GLenum modeA); -void GLAPIENTRY gl_dispatch_stub_780(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_781(GLenum target, GLenum pname, GLint param); -void GLAPIENTRY gl_dispatch_stub_782(GLenum target, GLintptr offset, GLsizeiptr size); -void GLAPIENTRY gl_dispatch_stub_785(GLenum target, GLenum pname, GLvoid ** params); -void GLAPIENTRY gl_dispatch_stub_786(GLenum target, GLsizei length, GLvoid * pointer); -void GLAPIENTRY gl_dispatch_stub_787(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -void GLAPIENTRY gl_dispatch_stub_788(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_789(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_790(GLuint id, GLenum pname, GLint64EXT * params); -void GLAPIENTRY gl_dispatch_stub_791(GLuint id, GLenum pname, GLuint64EXT * params); +void GLAPIENTRY gl_dispatch_stub_578(GLenum pname, GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_579(GLenum pname, GLint * params); +void GLAPIENTRY gl_dispatch_stub_580(GLenum pname, GLfloat param); +void GLAPIENTRY gl_dispatch_stub_581(GLenum pname, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_582(GLenum pname, GLint param); +void GLAPIENTRY gl_dispatch_stub_583(GLenum pname, const GLint * params); +void GLAPIENTRY gl_dispatch_stub_584(GLclampf value, GLboolean invert); +void GLAPIENTRY gl_dispatch_stub_585(GLenum pattern); +void GLAPIENTRY gl_dispatch_stub_596(GLenum pname, GLdouble * params); +void GLAPIENTRY gl_dispatch_stub_597(GLenum pname, GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_622(GLenum mode); +void GLAPIENTRY gl_dispatch_stub_664(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +void GLAPIENTRY gl_dispatch_stub_665(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); +void GLAPIENTRY gl_dispatch_stub_666(GLsizei n, const GLuint * fences); +void GLAPIENTRY gl_dispatch_stub_667(GLuint fence); +void GLAPIENTRY gl_dispatch_stub_668(GLsizei n, GLuint * fences); +void GLAPIENTRY gl_dispatch_stub_669(GLuint fence, GLenum pname, GLint * params); +GLboolean GLAPIENTRY gl_dispatch_stub_670(GLuint fence); +void GLAPIENTRY gl_dispatch_stub_671(GLuint fence, GLenum condition); +GLboolean GLAPIENTRY gl_dispatch_stub_672(GLuint fence); +void GLAPIENTRY gl_dispatch_stub_753(GLenum face); +void GLAPIENTRY gl_dispatch_stub_754(GLuint array); +void GLAPIENTRY gl_dispatch_stub_755(GLsizei n, const GLuint * arrays); +void GLAPIENTRY gl_dispatch_stub_756(GLsizei n, GLuint * arrays); +GLboolean GLAPIENTRY gl_dispatch_stub_757(GLuint array); +void GLAPIENTRY gl_dispatch_stub_764(GLclampd zmin, GLclampd zmax); +void GLAPIENTRY gl_dispatch_stub_765(GLenum modeRGB, GLenum modeA); +void GLAPIENTRY gl_dispatch_stub_783(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_784(GLenum target, GLenum pname, GLint param); +void GLAPIENTRY gl_dispatch_stub_785(GLenum target, GLintptr offset, GLsizeiptr size); +void GLAPIENTRY gl_dispatch_stub_788(GLenum target, GLenum pname, GLvoid ** params); +void GLAPIENTRY gl_dispatch_stub_789(GLenum target, GLsizei length, GLvoid * pointer); +void GLAPIENTRY gl_dispatch_stub_790(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +void GLAPIENTRY gl_dispatch_stub_791(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_792(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_793(GLuint id, GLenum pname, GLint64EXT * params); +void GLAPIENTRY gl_dispatch_stub_794(GLuint id, GLenum pname, GLuint64EXT * params); #endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ static const glprocs_table_t static_functions[] = { @@ -1829,524 +1834,529 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET( 9140, glGetSynciv, glGetSynciv, NULL, _gloffset_GetSynciv), NAME_FUNC_OFFSET( 9152, glIsSync, glIsSync, NULL, _gloffset_IsSync), NAME_FUNC_OFFSET( 9161, glWaitSync, glWaitSync, NULL, _gloffset_WaitSync), - NAME_FUNC_OFFSET( 9172, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), - NAME_FUNC_OFFSET( 9191, gl_dispatch_stub_575, gl_dispatch_stub_575, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9223, gl_dispatch_stub_576, gl_dispatch_stub_576, NULL, _gloffset_GetPixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9255, gl_dispatch_stub_577, gl_dispatch_stub_577, NULL, _gloffset_PixelTexGenParameterfSGIS), - NAME_FUNC_OFFSET( 9283, gl_dispatch_stub_578, gl_dispatch_stub_578, NULL, _gloffset_PixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9312, gl_dispatch_stub_579, gl_dispatch_stub_579, NULL, _gloffset_PixelTexGenParameteriSGIS), - NAME_FUNC_OFFSET( 9340, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_PixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9369, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET( 9386, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET( 9406, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), - NAME_FUNC_OFFSET( 9424, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), - NAME_FUNC_OFFSET( 9445, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), - NAME_FUNC_OFFSET( 9463, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), - NAME_FUNC_OFFSET( 9482, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), - NAME_FUNC_OFFSET( 9503, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), - NAME_FUNC_OFFSET( 9522, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET( 9543, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET( 9565, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), - NAME_FUNC_OFFSET( 9581, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), - NAME_FUNC_OFFSET( 9599, gl_dispatch_stub_593, gl_dispatch_stub_593, NULL, _gloffset_CullParameterdvEXT), - NAME_FUNC_OFFSET( 9620, gl_dispatch_stub_594, gl_dispatch_stub_594, NULL, _gloffset_CullParameterfvEXT), - NAME_FUNC_OFFSET( 9641, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET( 9663, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET( 9686, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET( 9708, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET( 9731, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET( 9753, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET( 9776, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET( 9798, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET( 9821, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET( 9843, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET( 9866, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET( 9889, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET( 9913, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET( 9936, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET( 9960, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET( 9983, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(10007, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(10034, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(10055, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(10078, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(10099, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(10114, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(10130, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(10145, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(10161, gl_dispatch_stub_619, gl_dispatch_stub_619, NULL, _gloffset_PixelTexGenSGIX), - NAME_FUNC_OFFSET(10179, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(10202, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), - NAME_FUNC_OFFSET(10228, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), - NAME_FUNC_OFFSET(10249, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), - NAME_FUNC_OFFSET(10267, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), - NAME_FUNC_OFFSET(10286, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), - NAME_FUNC_OFFSET(10309, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), - NAME_FUNC_OFFSET(10333, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), - NAME_FUNC_OFFSET(10356, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), - NAME_FUNC_OFFSET(10380, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), - NAME_FUNC_OFFSET(10403, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10435, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10467, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), - NAME_FUNC_OFFSET(10500, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), - NAME_FUNC_OFFSET(10533, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10570, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10607, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), - NAME_FUNC_OFFSET(10627, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(10645, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(10664, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(10682, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(10701, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(10719, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(10738, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(10756, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(10775, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(10793, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(10812, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(10830, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(10849, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(10867, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(10886, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(10904, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(10923, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), - NAME_FUNC_OFFSET(10941, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), - NAME_FUNC_OFFSET(10960, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), - NAME_FUNC_OFFSET(10978, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), - NAME_FUNC_OFFSET(10997, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), - NAME_FUNC_OFFSET(11015, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), - NAME_FUNC_OFFSET(11034, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), - NAME_FUNC_OFFSET(11052, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), - NAME_FUNC_OFFSET(11071, gl_dispatch_stub_661, gl_dispatch_stub_661, NULL, _gloffset_MultiModeDrawArraysIBM), - NAME_FUNC_OFFSET(11096, gl_dispatch_stub_662, gl_dispatch_stub_662, NULL, _gloffset_MultiModeDrawElementsIBM), - NAME_FUNC_OFFSET(11123, gl_dispatch_stub_663, gl_dispatch_stub_663, NULL, _gloffset_DeleteFencesNV), - NAME_FUNC_OFFSET(11140, gl_dispatch_stub_664, gl_dispatch_stub_664, NULL, _gloffset_FinishFenceNV), - NAME_FUNC_OFFSET(11156, gl_dispatch_stub_665, gl_dispatch_stub_665, NULL, _gloffset_GenFencesNV), - NAME_FUNC_OFFSET(11170, gl_dispatch_stub_666, gl_dispatch_stub_666, NULL, _gloffset_GetFenceivNV), - NAME_FUNC_OFFSET(11185, gl_dispatch_stub_667, gl_dispatch_stub_667, NULL, _gloffset_IsFenceNV), - NAME_FUNC_OFFSET(11197, gl_dispatch_stub_668, gl_dispatch_stub_668, NULL, _gloffset_SetFenceNV), - NAME_FUNC_OFFSET(11210, gl_dispatch_stub_669, gl_dispatch_stub_669, NULL, _gloffset_TestFenceNV), - NAME_FUNC_OFFSET(11224, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), - NAME_FUNC_OFFSET(11248, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(11264, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(11283, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), - NAME_FUNC_OFFSET(11302, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(11318, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), - NAME_FUNC_OFFSET(11344, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), - NAME_FUNC_OFFSET(11370, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), - NAME_FUNC_OFFSET(11391, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), - NAME_FUNC_OFFSET(11408, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), - NAME_FUNC_OFFSET(11429, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(11457, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), - NAME_FUNC_OFFSET(11479, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), - NAME_FUNC_OFFSET(11501, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), - NAME_FUNC_OFFSET(11523, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(11537, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), - NAME_FUNC_OFFSET(11553, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), - NAME_FUNC_OFFSET(11578, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), - NAME_FUNC_OFFSET(11603, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), - NAME_FUNC_OFFSET(11631, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), - NAME_FUNC_OFFSET(11647, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), - NAME_FUNC_OFFSET(11666, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), - NAME_FUNC_OFFSET(11686, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), - NAME_FUNC_OFFSET(11705, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), - NAME_FUNC_OFFSET(11725, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), - NAME_FUNC_OFFSET(11744, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), - NAME_FUNC_OFFSET(11764, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), - NAME_FUNC_OFFSET(11783, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), - NAME_FUNC_OFFSET(11803, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), - NAME_FUNC_OFFSET(11822, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), - NAME_FUNC_OFFSET(11842, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), - NAME_FUNC_OFFSET(11861, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), - NAME_FUNC_OFFSET(11881, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), - NAME_FUNC_OFFSET(11900, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), - NAME_FUNC_OFFSET(11920, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), - NAME_FUNC_OFFSET(11939, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), - NAME_FUNC_OFFSET(11959, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), - NAME_FUNC_OFFSET(11978, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), - NAME_FUNC_OFFSET(11998, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), - NAME_FUNC_OFFSET(12017, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), - NAME_FUNC_OFFSET(12037, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), - NAME_FUNC_OFFSET(12056, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), - NAME_FUNC_OFFSET(12076, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), - NAME_FUNC_OFFSET(12095, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), - NAME_FUNC_OFFSET(12115, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), - NAME_FUNC_OFFSET(12135, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), - NAME_FUNC_OFFSET(12156, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), - NAME_FUNC_OFFSET(12180, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), - NAME_FUNC_OFFSET(12201, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), - NAME_FUNC_OFFSET(12222, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), - NAME_FUNC_OFFSET(12243, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), - NAME_FUNC_OFFSET(12264, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), - NAME_FUNC_OFFSET(12285, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), - NAME_FUNC_OFFSET(12306, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), - NAME_FUNC_OFFSET(12327, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), - NAME_FUNC_OFFSET(12348, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), - NAME_FUNC_OFFSET(12369, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), - NAME_FUNC_OFFSET(12390, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), - NAME_FUNC_OFFSET(12411, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), - NAME_FUNC_OFFSET(12432, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), - NAME_FUNC_OFFSET(12454, glGetTexBumpParameterfvATI, glGetTexBumpParameterfvATI, NULL, _gloffset_GetTexBumpParameterfvATI), - NAME_FUNC_OFFSET(12481, glGetTexBumpParameterivATI, glGetTexBumpParameterivATI, NULL, _gloffset_GetTexBumpParameterivATI), - NAME_FUNC_OFFSET(12508, glTexBumpParameterfvATI, glTexBumpParameterfvATI, NULL, _gloffset_TexBumpParameterfvATI), - NAME_FUNC_OFFSET(12532, glTexBumpParameterivATI, glTexBumpParameterivATI, NULL, _gloffset_TexBumpParameterivATI), - NAME_FUNC_OFFSET(12556, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), - NAME_FUNC_OFFSET(12578, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), - NAME_FUNC_OFFSET(12600, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), - NAME_FUNC_OFFSET(12622, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), - NAME_FUNC_OFFSET(12647, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), - NAME_FUNC_OFFSET(12671, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), - NAME_FUNC_OFFSET(12693, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), - NAME_FUNC_OFFSET(12715, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), - NAME_FUNC_OFFSET(12737, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), - NAME_FUNC_OFFSET(12763, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), - NAME_FUNC_OFFSET(12786, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), - NAME_FUNC_OFFSET(12810, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), - NAME_FUNC_OFFSET(12828, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), - NAME_FUNC_OFFSET(12843, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), - NAME_FUNC_OFFSET(12874, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(12894, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(12915, gl_dispatch_stub_750, gl_dispatch_stub_750, NULL, _gloffset_ActiveStencilFaceEXT), - NAME_FUNC_OFFSET(12938, gl_dispatch_stub_751, gl_dispatch_stub_751, NULL, _gloffset_BindVertexArrayAPPLE), - NAME_FUNC_OFFSET(12961, gl_dispatch_stub_752, gl_dispatch_stub_752, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(12987, gl_dispatch_stub_753, gl_dispatch_stub_753, NULL, _gloffset_GenVertexArraysAPPLE), - NAME_FUNC_OFFSET(13010, gl_dispatch_stub_754, gl_dispatch_stub_754, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(13031, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), - NAME_FUNC_OFFSET(13062, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), - NAME_FUNC_OFFSET(13093, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), - NAME_FUNC_OFFSET(13121, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), - NAME_FUNC_OFFSET(13150, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), - NAME_FUNC_OFFSET(13178, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), - NAME_FUNC_OFFSET(13207, gl_dispatch_stub_761, gl_dispatch_stub_761, NULL, _gloffset_DepthBoundsEXT), - NAME_FUNC_OFFSET(13224, gl_dispatch_stub_762, gl_dispatch_stub_762, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(13251, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(13272, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(13294, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(13322, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(13346, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(13371, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(13400, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(13426, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(13452, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(13478, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(13499, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(13521, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(13541, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(13582, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(13614, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(13633, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(13653, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(13678, gl_dispatch_stub_780, gl_dispatch_stub_780, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(13699, gl_dispatch_stub_781, gl_dispatch_stub_781, NULL, _gloffset_BufferParameteriAPPLE), - NAME_FUNC_OFFSET(13723, gl_dispatch_stub_782, gl_dispatch_stub_782, NULL, _gloffset_FlushMappedBufferRangeAPPLE), - NAME_FUNC_OFFSET(13753, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(13782, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), - NAME_FUNC_OFFSET(13803, gl_dispatch_stub_785, gl_dispatch_stub_785, NULL, _gloffset_GetTexParameterPointervAPPLE), - NAME_FUNC_OFFSET(13834, gl_dispatch_stub_786, gl_dispatch_stub_786, NULL, _gloffset_TextureRangeAPPLE), - NAME_FUNC_OFFSET(13854, gl_dispatch_stub_787, gl_dispatch_stub_787, NULL, _gloffset_StencilFuncSeparateATI), - NAME_FUNC_OFFSET(13879, gl_dispatch_stub_788, gl_dispatch_stub_788, NULL, _gloffset_ProgramEnvParameters4fvEXT), - NAME_FUNC_OFFSET(13908, gl_dispatch_stub_789, gl_dispatch_stub_789, NULL, _gloffset_ProgramLocalParameters4fvEXT), - NAME_FUNC_OFFSET(13939, gl_dispatch_stub_790, gl_dispatch_stub_790, NULL, _gloffset_GetQueryObjecti64vEXT), - NAME_FUNC_OFFSET(13963, gl_dispatch_stub_791, gl_dispatch_stub_791, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(13988, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(14006, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(14023, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(14039, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(14064, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(14084, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(14104, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(14127, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(14150, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(14170, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(14187, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(14204, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(14219, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(14243, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(14262, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(14281, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(14297, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(14316, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(14339, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14355, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14371, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(14398, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(14425, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(14445, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14464, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14483, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14513, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14543, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14573, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14603, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14622, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14645, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(14670, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(14695, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(14722, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(14750, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(14777, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(14805, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(14834, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(14863, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(14889, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(14920, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(14951, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(14975, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(14998, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(15016, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(15045, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(15074, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(15089, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(15115, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(15141, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(15156, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(15168, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(15188, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(15205, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(15221, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(15240, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(15263, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(15279, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(15301, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(15319, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(15338, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(15356, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(15375, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(15393, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(15412, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(15430, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15449, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15467, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15486, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15504, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15523, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15541, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15560, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15578, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15597, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15615, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15634, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15652, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(15671, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(15689, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(15708, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(15726, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(15745, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(15763, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(15782, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(15800, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(15819, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(15837, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(15856, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(15874, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(15893, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET(15916, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(15939, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(15962, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(15985, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(16008, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(16025, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(16048, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(16071, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(16094, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(16120, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(16146, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(16172, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(16196, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16223, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16249, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(16269, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(16289, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(16309, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET(16332, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET(16356, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET(16379, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET(16403, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(16420, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(16438, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(16455, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(16473, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(16490, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(16508, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(16525, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16543, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16560, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16578, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16595, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16613, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16630, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16648, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(16665, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(16683, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(16700, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(16718, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(16737, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(16756, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(16775, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(16794, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(16814, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(16834, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(16854, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET(16872, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(16889, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(16907, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(16924, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(16942, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET(16960, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(16977, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(16995, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET(17014, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET(17033, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET(17052, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(17074, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(17087, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(17100, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(17116, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(17132, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(17145, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(17168, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(17188, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(17207, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(17218, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(17230, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(17244, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(17257, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(17273, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(17284, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(17297, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(17316, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(17336, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(17349, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(17359, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(17375, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(17394, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(17412, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(17433, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(17448, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(17463, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(17477, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(17492, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(17504, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(17517, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(17529, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(17542, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(17554, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(17567, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(17579, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17592, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17604, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17617, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17629, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17642, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17654, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17667, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17679, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17692, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17711, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17730, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(17749, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(17762, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(17780, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(17801, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(17819, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(17839, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17853, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17870, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17886, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17905, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17923, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17944, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17966, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17985, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18007, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18030, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(18049, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(18069, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(18088, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(18108, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(18127, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(18147, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(18166, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(18186, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(18205, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(18225, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(18245, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(18266, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(18286, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(18307, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(18327, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(18348, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(18372, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(18390, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(18410, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(18428, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(18440, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18453, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18465, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18478, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18498, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18522, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18536, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18553, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18568, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18586, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18600, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18617, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18632, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18650, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18664, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18681, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18696, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18714, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18728, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18745, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18760, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18778, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18792, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18809, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18824, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18842, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18856, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18873, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18888, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18906, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18920, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18937, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18952, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18970, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18984, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19001, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19016, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19034, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(19051, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(19071, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(19088, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19114, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19143, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(19158, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(19176, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(19195, gl_dispatch_stub_752, gl_dispatch_stub_752, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(19216, gl_dispatch_stub_754, gl_dispatch_stub_754, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(19232, gl_dispatch_stub_762, gl_dispatch_stub_762, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19256, gl_dispatch_stub_762, gl_dispatch_stub_762, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19283, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(19301, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(19320, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(19345, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(19366, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(19388, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(19414, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(19437, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(19460, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(19483, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(19501, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(19520, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(19537, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(19575, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(19604, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(19620, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(19637, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(19659, gl_dispatch_stub_780, gl_dispatch_stub_780, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(19677, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET( 9172, glDrawElementsBaseVertex, glDrawElementsBaseVertex, NULL, _gloffset_DrawElementsBaseVertex), + NAME_FUNC_OFFSET( 9197, glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertex, NULL, _gloffset_DrawRangeElementsBaseVertex), + NAME_FUNC_OFFSET( 9227, glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertex, NULL, _gloffset_MultiDrawElementsBaseVertex), + NAME_FUNC_OFFSET( 9257, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), + NAME_FUNC_OFFSET( 9276, gl_dispatch_stub_578, gl_dispatch_stub_578, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9308, gl_dispatch_stub_579, gl_dispatch_stub_579, NULL, _gloffset_GetPixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9340, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_PixelTexGenParameterfSGIS), + NAME_FUNC_OFFSET( 9368, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_PixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9397, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_PixelTexGenParameteriSGIS), + NAME_FUNC_OFFSET( 9425, gl_dispatch_stub_583, gl_dispatch_stub_583, NULL, _gloffset_PixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9454, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET( 9471, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET( 9491, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), + NAME_FUNC_OFFSET( 9509, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), + NAME_FUNC_OFFSET( 9530, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), + NAME_FUNC_OFFSET( 9548, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), + NAME_FUNC_OFFSET( 9567, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), + NAME_FUNC_OFFSET( 9588, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), + NAME_FUNC_OFFSET( 9607, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET( 9628, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET( 9650, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), + NAME_FUNC_OFFSET( 9666, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), + NAME_FUNC_OFFSET( 9684, gl_dispatch_stub_596, gl_dispatch_stub_596, NULL, _gloffset_CullParameterdvEXT), + NAME_FUNC_OFFSET( 9705, gl_dispatch_stub_597, gl_dispatch_stub_597, NULL, _gloffset_CullParameterfvEXT), + NAME_FUNC_OFFSET( 9726, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET( 9748, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET( 9771, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET( 9793, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET( 9816, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET( 9838, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET( 9861, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET( 9883, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET( 9906, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET( 9928, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET( 9951, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET( 9974, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET( 9998, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(10021, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(10045, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(10068, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(10092, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(10119, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(10140, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(10163, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(10184, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(10199, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(10215, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(10230, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(10246, gl_dispatch_stub_622, gl_dispatch_stub_622, NULL, _gloffset_PixelTexGenSGIX), + NAME_FUNC_OFFSET(10264, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(10287, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), + NAME_FUNC_OFFSET(10313, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), + NAME_FUNC_OFFSET(10334, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), + NAME_FUNC_OFFSET(10352, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), + NAME_FUNC_OFFSET(10371, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), + NAME_FUNC_OFFSET(10394, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), + NAME_FUNC_OFFSET(10418, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), + NAME_FUNC_OFFSET(10441, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), + NAME_FUNC_OFFSET(10465, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), + NAME_FUNC_OFFSET(10488, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10520, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10552, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), + NAME_FUNC_OFFSET(10585, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), + NAME_FUNC_OFFSET(10618, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10655, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10692, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), + NAME_FUNC_OFFSET(10712, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(10730, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(10749, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(10767, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(10786, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(10804, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(10823, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(10841, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(10860, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(10878, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(10897, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(10915, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(10934, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(10952, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(10971, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(10989, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(11008, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), + NAME_FUNC_OFFSET(11026, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), + NAME_FUNC_OFFSET(11045, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), + NAME_FUNC_OFFSET(11063, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), + NAME_FUNC_OFFSET(11082, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), + NAME_FUNC_OFFSET(11100, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), + NAME_FUNC_OFFSET(11119, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), + NAME_FUNC_OFFSET(11137, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), + NAME_FUNC_OFFSET(11156, gl_dispatch_stub_664, gl_dispatch_stub_664, NULL, _gloffset_MultiModeDrawArraysIBM), + NAME_FUNC_OFFSET(11181, gl_dispatch_stub_665, gl_dispatch_stub_665, NULL, _gloffset_MultiModeDrawElementsIBM), + NAME_FUNC_OFFSET(11208, gl_dispatch_stub_666, gl_dispatch_stub_666, NULL, _gloffset_DeleteFencesNV), + NAME_FUNC_OFFSET(11225, gl_dispatch_stub_667, gl_dispatch_stub_667, NULL, _gloffset_FinishFenceNV), + NAME_FUNC_OFFSET(11241, gl_dispatch_stub_668, gl_dispatch_stub_668, NULL, _gloffset_GenFencesNV), + NAME_FUNC_OFFSET(11255, gl_dispatch_stub_669, gl_dispatch_stub_669, NULL, _gloffset_GetFenceivNV), + NAME_FUNC_OFFSET(11270, gl_dispatch_stub_670, gl_dispatch_stub_670, NULL, _gloffset_IsFenceNV), + NAME_FUNC_OFFSET(11282, gl_dispatch_stub_671, gl_dispatch_stub_671, NULL, _gloffset_SetFenceNV), + NAME_FUNC_OFFSET(11295, gl_dispatch_stub_672, gl_dispatch_stub_672, NULL, _gloffset_TestFenceNV), + NAME_FUNC_OFFSET(11309, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), + NAME_FUNC_OFFSET(11333, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(11349, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(11368, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), + NAME_FUNC_OFFSET(11387, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(11403, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), + NAME_FUNC_OFFSET(11429, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), + NAME_FUNC_OFFSET(11455, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), + NAME_FUNC_OFFSET(11476, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), + NAME_FUNC_OFFSET(11493, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), + NAME_FUNC_OFFSET(11514, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(11542, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), + NAME_FUNC_OFFSET(11564, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), + NAME_FUNC_OFFSET(11586, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), + NAME_FUNC_OFFSET(11608, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(11622, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), + NAME_FUNC_OFFSET(11638, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), + NAME_FUNC_OFFSET(11663, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), + NAME_FUNC_OFFSET(11688, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), + NAME_FUNC_OFFSET(11716, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), + NAME_FUNC_OFFSET(11732, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), + NAME_FUNC_OFFSET(11751, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), + NAME_FUNC_OFFSET(11771, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), + NAME_FUNC_OFFSET(11790, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), + NAME_FUNC_OFFSET(11810, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), + NAME_FUNC_OFFSET(11829, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), + NAME_FUNC_OFFSET(11849, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), + NAME_FUNC_OFFSET(11868, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), + NAME_FUNC_OFFSET(11888, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), + NAME_FUNC_OFFSET(11907, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), + NAME_FUNC_OFFSET(11927, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), + NAME_FUNC_OFFSET(11946, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), + NAME_FUNC_OFFSET(11966, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), + NAME_FUNC_OFFSET(11985, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), + NAME_FUNC_OFFSET(12005, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), + NAME_FUNC_OFFSET(12024, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), + NAME_FUNC_OFFSET(12044, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), + NAME_FUNC_OFFSET(12063, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), + NAME_FUNC_OFFSET(12083, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), + NAME_FUNC_OFFSET(12102, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), + NAME_FUNC_OFFSET(12122, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), + NAME_FUNC_OFFSET(12141, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), + NAME_FUNC_OFFSET(12161, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), + NAME_FUNC_OFFSET(12180, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), + NAME_FUNC_OFFSET(12200, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), + NAME_FUNC_OFFSET(12220, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), + NAME_FUNC_OFFSET(12241, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), + NAME_FUNC_OFFSET(12265, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), + NAME_FUNC_OFFSET(12286, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), + NAME_FUNC_OFFSET(12307, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), + NAME_FUNC_OFFSET(12328, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), + NAME_FUNC_OFFSET(12349, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), + NAME_FUNC_OFFSET(12370, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), + NAME_FUNC_OFFSET(12391, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), + NAME_FUNC_OFFSET(12412, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), + NAME_FUNC_OFFSET(12433, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), + NAME_FUNC_OFFSET(12454, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), + NAME_FUNC_OFFSET(12475, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), + NAME_FUNC_OFFSET(12496, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), + NAME_FUNC_OFFSET(12517, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), + NAME_FUNC_OFFSET(12539, glGetTexBumpParameterfvATI, glGetTexBumpParameterfvATI, NULL, _gloffset_GetTexBumpParameterfvATI), + NAME_FUNC_OFFSET(12566, glGetTexBumpParameterivATI, glGetTexBumpParameterivATI, NULL, _gloffset_GetTexBumpParameterivATI), + NAME_FUNC_OFFSET(12593, glTexBumpParameterfvATI, glTexBumpParameterfvATI, NULL, _gloffset_TexBumpParameterfvATI), + NAME_FUNC_OFFSET(12617, glTexBumpParameterivATI, glTexBumpParameterivATI, NULL, _gloffset_TexBumpParameterivATI), + NAME_FUNC_OFFSET(12641, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), + NAME_FUNC_OFFSET(12663, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), + NAME_FUNC_OFFSET(12685, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), + NAME_FUNC_OFFSET(12707, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), + NAME_FUNC_OFFSET(12732, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), + NAME_FUNC_OFFSET(12756, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), + NAME_FUNC_OFFSET(12778, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), + NAME_FUNC_OFFSET(12800, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), + NAME_FUNC_OFFSET(12822, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), + NAME_FUNC_OFFSET(12848, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), + NAME_FUNC_OFFSET(12871, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), + NAME_FUNC_OFFSET(12895, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), + NAME_FUNC_OFFSET(12913, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), + NAME_FUNC_OFFSET(12928, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), + NAME_FUNC_OFFSET(12959, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(12979, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(13000, gl_dispatch_stub_753, gl_dispatch_stub_753, NULL, _gloffset_ActiveStencilFaceEXT), + NAME_FUNC_OFFSET(13023, gl_dispatch_stub_754, gl_dispatch_stub_754, NULL, _gloffset_BindVertexArrayAPPLE), + NAME_FUNC_OFFSET(13046, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(13072, gl_dispatch_stub_756, gl_dispatch_stub_756, NULL, _gloffset_GenVertexArraysAPPLE), + NAME_FUNC_OFFSET(13095, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(13116, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), + NAME_FUNC_OFFSET(13147, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), + NAME_FUNC_OFFSET(13178, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), + NAME_FUNC_OFFSET(13206, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), + NAME_FUNC_OFFSET(13235, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), + NAME_FUNC_OFFSET(13263, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), + NAME_FUNC_OFFSET(13292, gl_dispatch_stub_764, gl_dispatch_stub_764, NULL, _gloffset_DepthBoundsEXT), + NAME_FUNC_OFFSET(13309, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(13336, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(13357, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(13379, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(13407, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(13431, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(13456, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(13485, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(13511, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(13537, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(13563, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(13584, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(13606, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(13626, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(13667, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(13699, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(13718, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(13738, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(13763, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(13784, gl_dispatch_stub_784, gl_dispatch_stub_784, NULL, _gloffset_BufferParameteriAPPLE), + NAME_FUNC_OFFSET(13808, gl_dispatch_stub_785, gl_dispatch_stub_785, NULL, _gloffset_FlushMappedBufferRangeAPPLE), + NAME_FUNC_OFFSET(13838, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(13867, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), + NAME_FUNC_OFFSET(13888, gl_dispatch_stub_788, gl_dispatch_stub_788, NULL, _gloffset_GetTexParameterPointervAPPLE), + NAME_FUNC_OFFSET(13919, gl_dispatch_stub_789, gl_dispatch_stub_789, NULL, _gloffset_TextureRangeAPPLE), + NAME_FUNC_OFFSET(13939, gl_dispatch_stub_790, gl_dispatch_stub_790, NULL, _gloffset_StencilFuncSeparateATI), + NAME_FUNC_OFFSET(13964, gl_dispatch_stub_791, gl_dispatch_stub_791, NULL, _gloffset_ProgramEnvParameters4fvEXT), + NAME_FUNC_OFFSET(13993, gl_dispatch_stub_792, gl_dispatch_stub_792, NULL, _gloffset_ProgramLocalParameters4fvEXT), + NAME_FUNC_OFFSET(14024, gl_dispatch_stub_793, gl_dispatch_stub_793, NULL, _gloffset_GetQueryObjecti64vEXT), + NAME_FUNC_OFFSET(14048, gl_dispatch_stub_794, gl_dispatch_stub_794, NULL, _gloffset_GetQueryObjectui64vEXT), + NAME_FUNC_OFFSET(14073, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(14091, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(14108, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(14124, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(14149, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(14169, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(14189, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(14212, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(14235, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(14255, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(14272, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(14289, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(14304, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(14328, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(14347, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(14366, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(14382, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(14401, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(14424, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14440, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14456, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(14483, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14510, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14530, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14549, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14568, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14598, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14628, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14658, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14688, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(14707, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(14730, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(14755, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(14780, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(14807, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(14835, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(14862, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(14890, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(14919, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(14948, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(14974, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(15005, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(15036, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(15060, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(15083, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(15101, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(15130, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(15159, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(15174, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(15200, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(15226, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(15241, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(15253, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(15273, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(15290, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(15306, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(15325, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(15348, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(15364, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(15386, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(15404, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(15423, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(15441, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(15460, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(15478, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(15497, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15515, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15534, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15552, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15571, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15589, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15608, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15626, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15645, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15663, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(15682, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(15700, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(15719, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(15737, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(15756, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(15774, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(15793, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(15811, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(15830, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(15848, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(15867, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(15885, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(15904, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(15922, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(15941, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(15959, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(15978, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), + NAME_FUNC_OFFSET(16001, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(16024, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(16047, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(16070, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(16093, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(16110, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(16133, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(16156, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(16179, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(16205, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(16231, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(16257, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(16281, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16308, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16334, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(16354, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(16374, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(16394, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), + NAME_FUNC_OFFSET(16417, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), + NAME_FUNC_OFFSET(16441, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), + NAME_FUNC_OFFSET(16464, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), + NAME_FUNC_OFFSET(16488, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(16505, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(16523, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(16540, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(16558, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(16575, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(16593, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(16610, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16628, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16645, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16663, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(16680, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(16698, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(16715, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(16733, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(16750, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(16768, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(16785, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(16803, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(16822, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(16841, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(16860, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(16879, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(16899, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(16919, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(16939, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET(16957, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(16974, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(16992, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(17009, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(17027, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET(17045, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(17062, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(17080, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET(17099, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET(17118, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET(17137, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(17159, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(17172, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(17185, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(17201, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(17217, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(17230, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(17253, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(17273, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(17292, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(17303, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(17315, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(17329, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(17342, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(17358, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(17369, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(17382, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(17401, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(17421, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(17434, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(17444, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(17460, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(17479, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(17497, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(17518, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(17533, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(17548, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(17562, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(17577, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(17589, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(17602, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(17614, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(17627, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(17639, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(17652, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(17664, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(17677, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(17689, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(17702, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17714, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17727, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17739, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(17752, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(17764, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(17777, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(17796, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(17815, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(17834, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(17847, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(17865, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(17886, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(17904, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(17924, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17938, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17955, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), + NAME_FUNC_OFFSET(17991, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(18007, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(18026, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18044, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18065, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18087, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18106, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18128, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18151, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(18170, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(18190, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(18209, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(18229, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(18248, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(18268, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(18287, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(18307, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(18326, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(18346, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(18366, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(18387, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(18407, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(18428, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(18448, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(18469, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(18493, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(18511, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(18531, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(18549, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(18561, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(18574, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(18586, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(18599, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18619, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18643, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18657, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18674, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18689, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18707, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18721, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18738, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18753, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18771, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18785, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18802, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18817, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18835, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18849, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18866, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18881, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18899, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18913, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18930, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18945, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18963, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18977, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18994, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19009, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19027, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19041, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19058, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19073, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19091, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19105, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19122, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19137, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19155, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(19172, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(19192, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(19209, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19235, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19264, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(19279, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(19297, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(19316, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(19337, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(19353, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19377, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19404, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(19422, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(19441, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(19466, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(19487, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(19509, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(19535, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(19558, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(19581, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(19604, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(19622, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(19641, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(19658, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(19696, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(19725, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(19741, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(19758, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(19780, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(19798, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(19824, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/mesalib/src/mesa/glapi/license.py b/mesalib/src/mesa/glapi/license.py deleted file mode 100644 index 02181648e..000000000 --- a/mesalib/src/mesa/glapi/license.py +++ /dev/null @@ -1,47 +0,0 @@ -# (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 -# 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 - -bsd_license_template = """%s -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 -%s, -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.""" diff --git a/mesalib/src/mesa/glapi/mesadef.py b/mesalib/src/mesa/glapi/mesadef.py deleted file mode 100644 index 0f410fc48..000000000 --- a/mesalib/src/mesa/glapi/mesadef.py +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env python - - -# Mesa 3-D graphics library -# Version: 4.1 -# -# 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. - - -# Generate the mesa.def file for Windows. -# -# Usage: -# mesadef.py >mesa.def -# Then copy to src/mesa/drivers/windows/gdi -# -# Dependencies: -# The apispec file must be in the current directory. - - - -import apiparser -import string - - -def PrintHead(): - print '; DO NOT EDIT - This file generated automatically by mesadef.py script' - print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\'' - print 'VERSION 6.0' - print ';' - print '; Module definition file for Mesa (OPENGL32.DLL)' - print ';' - print '; Note: The OpenGL functions use the STDCALL' - print '; function calling convention. Microsoft\'s' - print '; OPENGL32 uses this convention and so must the' - print '; Mesa OPENGL32 so that the Mesa DLL can be used' - print '; as a drop-in replacement.' - print ';' - print '; The linker exports STDCALL entry points with' - print '; \'decorated\' names; e.g., _glBegin@0, where the' - print '; trailing number is the number of bytes of ' - print '; parameter data pushed onto the stack. The' - print '; callee is responsible for popping this data' - print '; off the stack, usually via a RETF n instruction.' - print ';' - print '; However, the Microsoft OPENGL32.DLL does not export' - print '; the decorated names, even though the calling convention' - print '; is STDCALL. So, this module definition file is' - print '; needed to force the Mesa OPENGL32.DLL to export the' - print '; symbols in the same manner as the Microsoft DLL.' - print '; Were it not for this problem, this file would not' - print '; be needed (for the gl* functions) since the entry' - print '; points are compiled with dllexport declspec.' - print ';' - print '; However, this file is still needed to export "internal"' - print '; Mesa symbols for the benefit of the OSMESA32.DLL.' - print ';' - print 'EXPORTS' - return -#enddef - - -def PrintTail(): - print ';' - print '; WGL API' - print '\twglChoosePixelFormat' - print '\twglCopyContext' - print '\twglCreateContext' - print '\twglCreateLayerContext' - print '\twglDeleteContext' - print '\twglDescribeLayerPlane' - print '\twglDescribePixelFormat' - print '\twglGetCurrentContext' - print '\twglGetCurrentDC' - print '\twglGetExtensionsStringARB' - print '\twglGetLayerPaletteEntries' - print '\twglGetPixelFormat' - print '\twglGetProcAddress' - print '\twglMakeCurrent' - print '\twglRealizeLayerPalette' - print '\twglSetLayerPaletteEntries' - print '\twglSetPixelFormat' - print '\twglShareLists' - print '\twglSwapBuffers' - print '\twglSwapLayerBuffers' - print '\twglUseFontBitmapsA' - print '\twglUseFontBitmapsW' - print '\twglUseFontOutlinesA' - print '\twglUseFontOutlinesW' - print ';' - print '; Mesa internals - mostly for OSMESA' - print '\t_ac_CreateContext' - print '\t_ac_DestroyContext' - print '\t_ac_InvalidateState' - print '\t_glapi_get_context' - print '\t_glapi_get_proc_address' - print '\t_mesa_buffer_data' - print '\t_mesa_buffer_map' - print '\t_mesa_buffer_subdata' - print '\t_mesa_bzero' - print '\t_mesa_calloc' - print '\t_mesa_choose_tex_format' - print '\t_mesa_compressed_texture_size' - print '\t_mesa_create_framebuffer' - print '\t_mesa_create_visual' - print '\t_mesa_delete_buffer_object' - print '\t_mesa_delete_texture_object' - print '\t_mesa_destroy_framebuffer' - print '\t_mesa_destroy_visual' - print '\t_mesa_enable_1_3_extensions' - print '\t_mesa_enable_1_4_extensions' - print '\t_mesa_enable_1_5_extensions' - print '\t_mesa_enable_sw_extensions' - print '\t_mesa_error' - print '\t_mesa_free' - print '\t_mesa_free_context_data' - print '\t_mesa_get_current_context' - print '\t_mesa_init_default_imports' - print '\t_mesa_initialize_context' - print '\t_mesa_make_current' - print '\t_mesa_memcpy' - print '\t_mesa_memset' - print '\t_mesa_new_buffer_object' - print '\t_mesa_new_texture_object' - print '\t_mesa_problem' - print '\t_mesa_ResizeBuffersMESA' - print '\t_mesa_store_compressed_teximage1d' - print '\t_mesa_store_compressed_teximage2d' - print '\t_mesa_store_compressed_teximage3d' - print '\t_mesa_store_compressed_texsubimage1d' - print '\t_mesa_store_compressed_texsubimage2d' - print '\t_mesa_store_compressed_texsubimage3d' - print '\t_mesa_store_teximage1d' - print '\t_mesa_store_teximage2d' - print '\t_mesa_store_teximage3d' - print '\t_mesa_store_texsubimage1d' - print '\t_mesa_store_texsubimage2d' - print '\t_mesa_store_texsubimage3d' - print '\t_mesa_strcmp' - print '\t_mesa_test_proxy_teximage' - print '\t_mesa_Viewport' - print '\t_swrast_Accum' - print '\t_swrast_alloc_buffers' - print '\t_swrast_Bitmap' - print '\t_swrast_CopyPixels' - print '\t_swrast_DrawPixels' - print '\t_swrast_GetDeviceDriverReference' - print '\t_swrast_Clear' - print '\t_swrast_choose_line' - print '\t_swrast_choose_triangle' - print '\t_swrast_CopyColorSubTable' - print '\t_swrast_CopyColorTable' - print '\t_swrast_CopyConvolutionFilter1D' - print '\t_swrast_CopyConvolutionFilter2D' - print '\t_swrast_copy_teximage1d' - print '\t_swrast_copy_teximage2d' - print '\t_swrast_copy_texsubimage1d' - print '\t_swrast_copy_texsubimage2d' - print '\t_swrast_copy_texsubimage3d' - print '\t_swrast_CreateContext' - print '\t_swrast_DestroyContext' - print '\t_swrast_InvalidateState' - print '\t_swrast_ReadPixels' - print '\t_swrast_zbuffer_address' - print '\t_swsetup_Wakeup' - print '\t_swsetup_CreateContext' - print '\t_swsetup_DestroyContext' - print '\t_swsetup_InvalidateState' - print '\t_tnl_CreateContext' - print '\t_tnl_DestroyContext' - print '\t_tnl_InvalidateState' - print '\t_tnl_MakeCurrent' - print '\t_tnl_run_pipeline' -#enddef - - -records = [] - -def FindOffset(funcName): - for (name, alias, offset) in records: - if name == funcName: - return offset - #endif - #endfor - return -1 -#enddef - - -def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset): - if alias == '': - dispatchName = name - else: - dispatchName = alias - if offset < 0: - offset = FindOffset(dispatchName) - if offset >= 0 and string.find(name, "unused") == -1: - print '\tgl%s' % (name) - # save this info in case we need to look up an alias later - records.append((name, dispatchName, offset)) - -#enddef - - -PrintHead() -apiparser.ProcessSpecFile("APIspec", EmitEntry) -PrintTail() diff --git a/mesalib/src/mesa/glapi/next_available_offset.sh b/mesalib/src/mesa/glapi/next_available_offset.sh deleted file mode 100644 index e7d6c2f4a..000000000 --- a/mesalib/src/mesa/glapi/next_available_offset.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# -# (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 -# 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 - -# Trivial shell script to search the API definition file and print out the -# next numerically available API entry-point offset. This could probably -# be made smarter, but it would be better to use the existin Python -# framework to do that. This is just a quick-and-dirty hack. - -num=$(grep 'offset="' gl_API.xml |\ - sed 's/.\+ offset="//g;s/".*$//g' |\ - grep -v '?' |\ - sort -rn |\ - head -1) - -echo $((num + 1)) diff --git a/mesalib/src/mesa/glapi/typeexpr.py b/mesalib/src/mesa/glapi/typeexpr.py deleted file mode 100644 index 8ba7de486..000000000 --- a/mesalib/src/mesa/glapi/typeexpr.py +++ /dev/null @@ -1,292 +0,0 @@ -#!/usr/bin/env python - -# (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 -# 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 - -import string, copy - -class type_node: - def __init__(self): - self.pointer = 0 # bool - self.const = 0 # bool - self.signed = 1 # bool - self.integer = 1 # bool - - # If elements is set to non-zero, then field is an array. - self.elements = 0 - - self.name = None - self.size = 0 # type's size in bytes - return - - - def string(self): - """Return string representation of this type_node.""" - s = "" - - if self.pointer: - s = "* " - - if self.const: - s += "const " - - if not self.pointer: - if self.integer: - if self.signed: - s += "signed " - else: - s += "unsigned " - - if self.name: - s += "%s " % (self.name) - - return s - - -class type_table: - def __init__(self): - self.types_by_name = {} - return - - - def add_type(self, type_expr): - self.types_by_name[ type_expr.get_base_name() ] = type_expr - return - - - def find_type(self, name): - if name in self.types_by_name: - return self.types_by_name[ name ] - else: - return None - - -def create_initial_types(): - tt = type_table() - - basic_types = [ - ("char", 1, 1), - ("short", 2, 1), - ("int", 4, 1), - ("long", 4, 1), - ("float", 4, 0), - ("double", 8, 0), - ("enum", 4, 1) - ] - - for (type_name, type_size, integer) in basic_types: - te = type_expression(None) - tn = type_node() - tn.name = type_name - tn.size = type_size - tn.integer = integer - te.expr.append(tn) - tt.add_type( te ) - - type_expression.built_in_types = tt - return - - -class type_expression: - built_in_types = None - - def __init__(self, type_string, extra_types = None): - self.expr = [] - - if not type_string: - return - - self.original_string = type_string - - if not type_expression.built_in_types: - raise RuntimeError("create_initial_types must be called before creating type_expression objects.") - - # Replace '*' with ' * ' in type_string. Then, split the string - # into tokens, separated by spaces. - tokens = string.split( string.replace( type_string, "*", " * " ) ) - - const = 0 - t = None - signed = 0 - unsigned = 0 - - for i in tokens: - if i == "const": - if t and t.pointer: - t.const = 1 - else: - const = 1 - elif i == "signed": - signed = 1 - elif i == "unsigned": - unsigned = 1 - elif i == "*": - # This is a quirky special-case because of the - # way the C works for types. If 'unsigned' is - # specified all by itself, it is treated the - # same as "unsigned int". - - if unsigned: - self.set_base_type( "int", signed, unsigned, const, extra_types ) - const = 0 - signed = 0 - unsigned = 0 - - if not self.expr: - raise RuntimeError("Invalid type expression (dangling pointer)") - - if signed: - raise RuntimeError("Invalid type expression (signed / unsigned applied to pointer)") - - t = type_node() - t.pointer = 1 - self.expr.append( t ) - else: - if self.expr: - raise RuntimeError('Invalid type expression (garbage after pointer qualifier -> "%s")' % (self.original_string)) - - self.set_base_type( i, signed, unsigned, const, extra_types ) - const = 0 - signed = 0 - unsigned = 0 - - if signed and unsigned: - raise RuntimeError("Invalid type expression (both signed and unsigned specified)") - - - if const: - raise RuntimeError("Invalid type expression (dangling const)") - - if unsigned: - raise RuntimeError("Invalid type expression (dangling signed)") - - if signed: - raise RuntimeError("Invalid type expression (dangling unsigned)") - - return - - - def set_base_type(self, type_name, signed, unsigned, const, extra_types): - te = type_expression.built_in_types.find_type( type_name ) - if not te: - te = extra_types.find_type( type_name ) - - if not te: - raise RuntimeError('Unknown base type "%s".' % (type_name)) - - self.expr = copy.deepcopy(te.expr) - - t = self.expr[ len(self.expr) - 1 ] - t.const = const - if signed: - t.signed = 1 - elif unsigned: - t.signed = 0 - - - def set_base_type_node(self, tn): - self.expr = [tn] - return - - - def set_elements(self, count): - tn = self.expr[0] - - tn.elements = count - return - - - def string(self): - s = "" - for t in self.expr: - s += t.string() - - return s - - - def get_base_type_node(self): - return self.expr[0] - - - def get_base_name(self): - if len(self.expr): - return self.expr[0].name - else: - return None - - - def get_element_size(self): - tn = self.expr[0] - - if tn.elements: - return tn.elements * tn.size - else: - return tn.size - - - def get_element_count(self): - tn = self.expr[0] - return tn.elements - - - def get_stack_size(self): - tn = self.expr[ len(self.expr) - 1 ] - - if tn.elements or tn.pointer: - return 4 - elif not tn.integer: - return tn.size - else: - return 4 - - - def is_pointer(self): - tn = self.expr[ len(self.expr) - 1 ] - return tn.pointer - - - def format_string(self): - tn = self.expr[ len(self.expr) - 1 ] - if tn.pointer: - return "%p" - elif not tn.integer: - return "%f" - else: - return "%d" - - - -if __name__ == '__main__': - - types_to_try = [ "int", "int *", "const int *", "int * const", "const int * const", \ - "unsigned * const *", \ - "float", "const double", "double * const"] - - create_initial_types() - - for t in types_to_try: - print 'Trying "%s"...' % (t) - te = type_expression( t ) - print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size()) diff --git a/mesalib/src/mesa/main/Makefile.ugl b/mesalib/src/mesa/main/Makefile.ugl deleted file mode 100644 index b440e1364..000000000 --- a/mesalib/src/mesa/main/Makefile.ugl +++ /dev/null @@ -1,364 +0,0 @@ -# Mesa 3-D graphics library -# Version: 4.1 -# -# Copyright (C) 2001 Wind River Systems, Inc - -# The MIT License -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to 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 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. - -# Makefile for core library - -# This makefile can moved all objects files in MESA_OBJ for use with -# ld in windShell or create a library from objects files in their -# associated .c folder. -# -# For an easy inclusion of lib$(CPU)$(TOOL)GL.a in vxworks image, this -# makefile collects together all .o in an only file -# (obj$(CPU)$(TOOL)GL.o). This operation is unnecessary for -# lib$(CPU)$(TOOL)OSMesa.a and lib$(CPU)$(TOOL)UglMesa.a because they -# already contain only one file. -# -##### MACROS ##### -MESA_MAJOR=4 -MESA_MINOR=1 -MESA_TINY=0 -VERSION=$(MESA_MAJOR).$(MESA_MINOR) - -GL_MAJOR = 1 -GL_MINOR = 2 -GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) - -##### RULES ##### - -include ..\rules.windml - -#### GL ##### - -GL_SOURCES = \ - api_arrayelt.c \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - arbprogram.c \ - attrib.c \ - blend.c \ - bufferobj.c \ - buffers.c \ - clip.c \ - colortab.c \ - context.c \ - convolve.c \ - debug.c \ - depth.c \ - dispatch.c \ - dlist.c \ - drawpix.c \ - enable.c \ - enums.c \ - eval.c \ - extensions.c \ - feedback.c \ - fog.c \ - get.c \ - glapi.c \ - glthread.c \ - hash.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - matrix.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - texcompress.c \ - texformat.c \ - teximage.c \ - texobj.c \ - texstate.c \ - texstore.c \ - texutil.c \ - varray.c \ - vtxfmt.c \ - X86/x86.c \ - X86/common_x86.c \ - X86/3dnow.c \ - X86/sse.c \ - math/m_debug_clip.c \ - math/m_debug_norm.c \ - math/m_debug_vertex.c \ - math/m_debug_xform.c \ - math/m_eval.c \ - math/m_matrix.c \ - math/m_translate.c \ - math/m_vector.c \ - math/m_vertices.c \ - math/m_xform.c \ - array_cache/ac_context.c \ - array_cache/ac_import.c \ - swrast/s_aaline.c \ - swrast/s_aatriangle.c \ - swrast/s_accum.c \ - swrast/s_alpha.c \ - swrast/s_alphabuf.c \ - swrast/s_bitmap.c \ - swrast/s_blend.c \ - swrast/s_buffers.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_imaging.c \ - swrast/s_lines.c \ - swrast/s_logic.c \ - swrast/s_masking.c \ - swrast/s_pixeltex.c \ - swrast/s_points.c \ - swrast/s_readpix.c \ - swrast/s_span.c \ - swrast/s_stencil.c \ - swrast/s_texture.c \ - swrast/s_texstore.c \ - swrast/s_triangle.c \ - swrast/s_zoom.c \ - swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c \ - swrast_setup/ss_vb.c \ - tnl/t_array_api.c \ - tnl/t_array_import.c \ - tnl/t_context.c \ - tnl/t_eval_api.c \ - tnl/t_imm_alloc.c \ - tnl/t_imm_api.c \ - tnl/t_imm_debug.c \ - tnl/t_imm_dlist.c \ - tnl/t_imm_elt.c \ - tnl/t_imm_eval.c \ - tnl/t_imm_exec.c \ - tnl/t_imm_fixup.c \ - tnl/t_pipeline.c \ - tnl/t_vb_fog.c \ - tnl/t_vb_light.c \ - tnl/t_vb_normals.c \ - tnl/t_vb_points.c \ - tnl/t_vb_render.c \ - tnl/t_vb_texgen.c \ - tnl/t_vb_texmat.c \ - tnl/t_vb_vertex.c - -GL_OBJECTS = $(GL_SOURCES:.c=.o) -GL_OBJNAME = $(MESA_LIBDIR)/objMesaGL.o - -#### X86 ##### - -x86_files = \ - X86/common_x86_asm.S \ - X86/glapi_x86.S \ - X86/x86_cliptest.S \ - X86/x86_vertex.S \ - X86/x86_xform2.S \ - X86/x86_xform3.S \ - X86/x86_xform4.S \ - -x3dnow_files = \ - X86/3dnow_normal.S \ - X86/3dnow_vertex.S \ - X86/3dnow_xform1.S \ - X86/3dnow_xform2.S \ - X86/3dnow_xform3.S \ - X86/3dnow_xform4.S - -sse_files = \ - X86/sse_normal.S \ - X86/sse_vertex.S \ - X86/sse_xform1.S \ - X86/sse_xform2.S \ - X86/sse_xform3.S \ - X86/sse_xform4.S - -mmx_files = X86/mmx_blend.S - -X86_OBJNAME = $(MESA_LIBDIR)/objMesaX86.o - -##### UGL ##### - -UGL_SOURCES = \ - windml/ugl_api.c \ - windml/ugl_dd.c \ - windml/ugl_span.c \ - windml/ugl_line.c \ - windml/ugl_tri.c \ - windml/tornado/torMesaUGLInit.c - -UGL_OBJECTS = $(UGL_SOURCES:.c=.o) -UGL_OBJNAME = $(MESA_LIBDIR)/objMesaUGL.o - -##### OS ##### - -OS_SOURCES = OSmesa/osmesa.c windml/tornado/torMesaOSInit.c -OS_OBJECTS = $(OS_SOURCES:.c=.o) -OS_OBJNAME = $(MESA_LIBDIR)/objMesaOS.o - -##### GLUTSHAPES ##### - -GLUTSHAPES_SOURCES = \ - windml/ugl_glutshapes.c \ - windml/tornado/torGLUTShapesInit.c - -GLUTSHAPES_OBJECTS = $(GLUTSHAPES_SOURCES:.c=.o) -GLUTSHAPES_OBJNAME = $(MESA_LIBDIR)/objGLUTShapes.o - -SOURCES = $(GL_SOURCES) $(UGL_SOURCES) $(OS_SOURCES) \ - $(GLUTSHAPES_SOURCES) - -##### TARGETS ##### - -all: depend.$(CPU)$(TOOL) cfgX86 $(X86_OBJNAME) $(GL_OBJNAME)\ -$(UGL_OBJNAME) $(OS_OBJNAME) $(GLUTSHAPES_OBJNAME) - -#histogram.o: -# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< - -#image.o: -# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< - -cfgX86: -ifdef HAVE_3DNOW -x3dnow_sources = $(x3dnow_files) -CFLAGS_3DNOW = -DUSE_3DNOW_ASM -HAVE_X86 = 1 -endif -ifdef HAVE_SSE -sse_sources = $(sse_files) -CFLAGS_SSE = -DUSE_SSE_ASM -HAVE_X86 = 1 -endif -ifdef HAVE_MMX -mmx_sources = $(mmx_files) -CFLAGS_MMX = -DUSE_MMX_ASM -HAVE_X86 = 1 -endif -ifdef HAVE_X86 -x86_sources = $(x86_files) -CFLAGS_X86 = -DUSE_X86_ASM -endif -X86_SOURCES = $(x86_sources) $(mmx_sources) \ - $(x3dnow_sources) $(sse_sources) -X86_OBJECTS = $(X86_SOURCES:.S=.o) -CFLAGS_USE_X86 = $(CFLAGS_3DNOW) $(CFLAGS_SSE) $(CFLAGS_MMX) $(CFLAGS_X86) - -#X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c -# $(CC) -I ./ X86/gen_matypes.c -o X86/gen_matypes -# ./X86/gen_matypes > X86/matypes.h -# $(RM) X86/gen_matypes -# $(RM) X86/gen_matypes.o - -# Make the Mesax86 library -$(X86_OBJNAME): $(X86_OBJECTS) -ifdef HAVE_X86 -# $(LD) -r $(X86_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(X86_OBJECTS) -o $(X86_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(X86_OBJNAME) -# $(RM) $(X86_OBJNAME) -endif - -# Make the GL library -$(GL_OBJNAME): $(GL_OBJECTS) -# $(LD) -r $(GL_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(GL_OBJECTS) -o $(GL_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(GL_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(GL_OBJNAME) -# $(RM) $(GL_OBJNAME) - -# Make the UGLMesa library -$(UGL_OBJNAME): $(UGL_OBJECTS) -# $(LD) -r $(UGL_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(UGL_OBJECTS) -o $(UGL_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(UGL_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(UGL_OBJNAME) -# $(RM) $(UGL_OBJNAME) - -# Make the OSMesa library -$(OS_OBJNAME): $(OS_OBJECTS) -# $(LD) -r $(OS_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(OS_OBJECTS) -o $(OS_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(OS_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(OS_OBJNAME) -# $(RM) $(OS_OBJNAME) - -# Make the GLUT Shapes library -$(GLUTSHAPES_OBJNAME): $(GLUTSHAPES_OBJECTS) -# $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(GLUTSHAPES_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) -# $(RM) $(GLUTSHAPES_OBJNAME) - -depend.$(CPU)$(TOOL): -ifeq ($(WIND_HOST_TYPE),x86-win32) - @ $(RM) $@ - @ $(ECHO) Creating depend.$(CPU)$(TOOL) -ifneq ($(SOURCES),) - @ for %f in ($(SOURCES)) do \ - $(CC) -MM $(CFLAGS) %f >>$@ -endif -else -Makefile - @ $(RM) $@ - @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" -ifneq ($(SOURCES),) - @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ - do \ - $(CC) -MM $(CFLAGS) $$FILE \ - | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ - done -endif -endif - -.PHONY = clean - -clean: -# $(AR) d $(MESA_LIBNAME) $(GL_OBJNAME) -# $(AR) d $(MESA_LIBNAME) $(UGL_OBJNAME) -# $(AR) d $(MESA_LIBNAME) $(OS_OBJNAME) -# $(AR) d $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(GL_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(UGL_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(OS_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) - $(RM) $(GL_OBJECTS) - $(RM) $(UGL_OBJECTS) - $(RM) $(OS_OBJECTS) - $(RM) $(GLUTSHAPES_OBJECTS) - $(RM) $(GL_OBJNAME) - $(RM) $(UGL_OBJNAME) - $(RM) $(OS_OBJNAME) - $(RM) $(GLUTSHAPES_OBJNAME) - $(RM) depend.$(CPU)$(TOOL) - -include depend.$(CPU)$(TOOL) - diff --git a/mesalib/src/mesa/main/Makefile.win b/mesalib/src/mesa/main/Makefile.win deleted file mode 100644 index a27f44c11..000000000 --- a/mesalib/src/mesa/main/Makefile.win +++ /dev/null @@ -1,208 +0,0 @@ -# Makefile for Win32 -# -# NOTE: the install target may overwrite important files in the system dirs -# Check first, before making the install target. -# -# This builds both the osmesa and Windows drivers. -# - -!include - -TOP = .. -SUBDIRS = osmesa.dir - -CORE_SRCS = \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - arbprogram.c \ - attrib.c \ - blend.c \ - bufferobj.c \ - buffers.c \ - clip.c \ - colortab.c \ - context.c \ - convolve.c \ - debug.c \ - depth.c \ - dispatch.c \ - dlist.c \ - drawpix.c \ - enable.c \ - enums.c \ - eval.c \ - extensions.c \ - feedback.c \ - fog.c \ - get.c \ - glapi.c \ - glthread.c \ - hash.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - matrix.c \ - nvprogram.c \ - nvfragparse.c \ - nvvertexec.c \ - nvvertparse.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - texcompress.c \ - texcompress_fxt1.c \ - texcompress_s3tc.c \ - teximage.c \ - texformat.c \ - texobj.c \ - texstate.c \ - texstore.c \ - varray.c \ - vtxfmt.c \ -# X86\x86.c \ -# X86\common_x86.c \ -# X86\3dnow.c \ -# X86\sse.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 \ - array_cache\ac_context.c \ - array_cache\ac_import.c \ - swrast\s_aaline.c \ - swrast\s_aatriangle.c \ - swrast\s_accum.c \ - swrast\s_alpha.c \ - swrast\s_alphabuf.c \ - swrast\s_bitmap.c \ - swrast\s_blend.c \ - swrast\s_buffers.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_imaging.c \ - swrast\s_lines.c \ - swrast\s_logic.c \ - swrast\s_masking.c \ - swrast\s_nvfragprog.c \ - swrast\s_pixeltex.c \ - swrast\s_points.c \ - swrast\s_readpix.c \ - swrast\s_span.c \ - swrast\s_stencil.c \ - swrast\s_texstore.c \ - swrast\s_texture.c \ - swrast\s_triangle.c \ - swrast\s_zoom.c \ - swrast_setup\ss_context.c \ - swrast_setup\ss_triangle.c \ - swrast_setup\ss_vb.c \ - tnl\t_array_api.c \ - tnl\t_array_import.c \ - tnl\t_context.c \ - tnl\t_eval_api.c \ - tnl\t_imm_alloc.c \ - tnl\t_imm_api.c \ - tnl\t_imm_debug.c \ - tnl\t_imm_dlist.c \ - tnl\t_imm_elt.c \ - tnl\t_imm_eval.c \ - tnl\t_imm_exec.c \ - tnl\t_imm_fixup.c \ - tnl\t_pipeline.c \ - tnl\t_vb_fog.c \ - tnl\t_vb_light.c \ - tnl\t_vb_normals.c \ - tnl\t_vb_points.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 - -DRIVER_SRCS = \ - Trace\tr_context.c \ - Trace\tr_control.c \ - Trace\tr_error.c \ - Trace\tr_support.c \ - Trace\tr_wrapper.c \ - Trace\tr_write.c \ - Windows\wgl.c \ - Windows\wmesa.c - -ASM_SRCS = - -SRCS = $(CORE_SRCS) $(DRIVER_SRCS) - -all : mesadll $(SUBDIRS) - -!include "$(TOP)/mesawin32.mak" - -mesadll : $(MESADLL) - -CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO -!IFNDEF NODEBUG -CFLAGS = $(CFLAGS) -DMESA_DEBUG -!ENDIF -LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS) - -OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) -LIBS = winmm.lib $(guilibsdll) - -$(MESADLL) : $(OBJS) mesa.def - $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) - @echo "copying Mesa dynamic link library to lib directory..." - -copy $(MESADLL) ..\lib - @echo "copying Mesa import library to lib directory..." - -copy $(MESALIB) ..\lib - -$(SUBDIRS) : - @echo. - @echo Making in $* directory - @cd $* - @nmake -f Makefile.win -nologo - @cd .. - -install : $(MESADLL) - @echo. - @echo "copying Mesa dynamic link library to system directory..." - -copy $(MESADLL) $(DLLINSTALL) - @echo "copying Mesa header files to include directory..." - -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) - -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) - @echo "copying Mesa import library to library directory..." - -copy $(MESALIB) $(LIBINSTALL) - -clean :: - @del /f tnl\*.obj - @del /f swrast_setup\*.obj - @del /f math\*.obj - @del /f array_cache\*.obj - @del /f swrast\*.obj - @del /f Trace\*.obj - @del /f osmesa\*.obj - @del /f Windows\*.obj - -clobber :: - @del /f OSmesa\*.lib - @del /f OSmesa\*.exp - @del /f OSmesa\*.dll - -# override default inference rule with one that writes the object to -# the same subdir that the c file is in. -.c.obj : - $(cc) $(CFLAGS) -I. $< /Fo$*.obj diff --git a/mesalib/src/mesa/main/accum.c b/mesalib/src/mesa/main/accum.c index 2345695f3..032e13b96 100644 --- a/mesalib/src/mesa/main/accum.c +++ b/mesalib/src/mesa/main/accum.c @@ -29,6 +29,10 @@ #include "macros.h" #include "state.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_accum void GLAPIENTRY @@ -51,7 +55,7 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Accum( GLenum op, GLfloat value ) { GET_CURRENT_CONTEXT(ctx); @@ -99,6 +103,16 @@ _mesa_Accum( GLenum op, GLfloat value ) } +void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ + SET_Accum(disp, _mesa_Accum); + SET_ClearAccum(disp, _mesa_ClearAccum); +} + + +#endif /* FEATURE_accum */ + void _mesa_init_accum( GLcontext *ctx ) diff --git a/mesalib/src/mesa/main/accum.h b/mesalib/src/mesa/main/accum.h index ce92688a5..63740f07e 100644 --- a/mesalib/src/mesa/main/accum.h +++ b/mesalib/src/mesa/main/accum.h @@ -38,25 +38,40 @@ #define ACCUM_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ); +#if FEATURE_accum +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) \ + do { \ + (driver)->Accum = impl ## Accum; \ + } while (0) extern void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern void -_mesa_init_accum( GLcontext *ctx ); +extern void +_mesa_init_accum_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_accum */ -#else +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) do { } while (0) -/** No-op */ -#define _mesa_init_accum( c ) ((void)0) +static INLINE void +_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +{ + /* this is used in _mesa_PopAttrib */ + ASSERT_NO_FEATURE(); +} -#endif +static INLINE void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_accum */ + +extern void +_mesa_init_accum( GLcontext *ctx ); -#endif +#endif /* ACCUM_H */ diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index 2462a1b00..469b4529f 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -32,7 +32,6 @@ #include "context.h" #include "imports.h" #include "macros.h" -#include "glapi/glapioffsets.h" #include "glapi/dispatch.h" typedef void (GLAPIENTRY *array_func)( const void * ); @@ -71,6 +70,10 @@ typedef struct { */ #define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) + +#if FEATURE_arrayelt + + static const int ColorFuncs[2][8] = { { _gloffset_Color3bv, @@ -1160,7 +1163,7 @@ static void _ae_update_state( GLcontext *ctx ) 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_loopback_array_elt() to + * change from one execution of _ae_ArrayElement() to * the next. Doing so caused UT to break. */ if (ctx->VertexProgram._Enabled @@ -1254,7 +1257,7 @@ void _ae_unmap_vbos( GLcontext *ctx ) * for all enabled vertex arrays (for elt-th element). * Note: this may be called during display list construction. */ -void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) +void GLAPIENTRY _ae_ArrayElement( GLint elt ) { GET_CURRENT_CONTEXT(ctx); const AEcontext *actx = AE_CONTEXT(ctx); @@ -1317,3 +1320,13 @@ void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) 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_arrayelt.h b/mesalib/src/mesa/main/api_arrayelt.h index e621724fb..d18c0792c 100644 --- a/mesalib/src/mesa/main/api_arrayelt.h +++ b/mesalib/src/mesa/main/api_arrayelt.h @@ -27,16 +27,57 @@ #ifndef API_ARRAYELT_H #define API_ARRAYELT_H -#include "mtypes.h" + +#include "main/mtypes.h" + +#if FEATURE_arrayelt + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->ArrayElement = impl ## ArrayElement; \ + } while (0) extern GLboolean _ae_create_context( GLcontext *ctx ); extern void _ae_destroy_context( GLcontext *ctx ); extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ); -extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt ); +extern void GLAPIENTRY _ae_ArrayElement( GLint elt ); /* May optionally be called before a batch of element calls: */ extern void _ae_map_vbos( GLcontext *ctx ); extern void _ae_unmap_vbos( GLcontext *ctx ); -#endif +extern void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +#else /* FEATURE_arrayelt */ + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0) + +static INLINE GLboolean +_ae_create_context( GLcontext *ctx ) +{ + return GL_TRUE; +} + +static INLINE void +_ae_destroy_context( GLcontext *ctx ) +{ +} + +static INLINE void +_ae_invalidate_state( GLcontext *ctx, GLuint new_state ) +{ +} + +static INLINE void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} + +#endif /* FEATURE_arrayelt */ + + +#endif /* API_ARRAYELT_H */ diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index 02550ae10..1559984f4 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -30,9 +30,7 @@ #include "mfeatures.h" -#if FEATURE_accum #include "accum.h" -#endif #include "api_loopback.h" #include "api_exec.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program @@ -41,9 +39,7 @@ #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif -#if FEATURE_attrib_stack #include "attrib.h" -#endif #include "blend.h" #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" @@ -54,29 +50,17 @@ #endif #include "clear.h" #include "clip.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "depth.h" -#if FEATURE_dlist #include "dlist.h" -#endif -#if FEATURE_drawpix #include "drawpix.h" #include "rastpos.h" -#endif #include "enable.h" -#if FEATURE_evaluators #include "eval.h" -#endif #include "get.h" -#if FEATURE_feedback #include "feedback.h" -#endif #include "fog.h" #if FEATURE_EXT_framebuffer_object #include "fbobject.h" @@ -84,24 +68,18 @@ #include "ffvertex_prog.h" #include "framebuffer.h" #include "hint.h" -#if FEATURE_histogram #include "histogram.h" -#endif #include "imports.h" #include "light.h" #include "lines.h" #include "macros.h" #include "matrix.h" #include "multisample.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query #include "queryobj.h" -#endif #include "readpix.h" #include "scissor.h" #include "state.h" @@ -109,9 +87,7 @@ #include "texenv.h" #include "texgetimage.h" #include "teximage.h" -#if FEATURE_texgen #include "texgen.h" -#endif #include "texobj.h" #include "texparam.h" #include "texstate.h" @@ -199,20 +175,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexParameteri(exec, _mesa_TexParameteri); SET_Translatef(exec, _mesa_Translatef); SET_Viewport(exec, _mesa_Viewport); -#if FEATURE_accum - SET_Accum(exec, _mesa_Accum); - SET_ClearAccum(exec, _mesa_ClearAccum); -#endif -#if FEATURE_dlist - SET_CallList(exec, _mesa_CallList); - SET_CallLists(exec, _mesa_CallLists); - SET_DeleteLists(exec, _mesa_DeleteLists); - SET_EndList(exec, _mesa_EndList); - SET_GenLists(exec, _mesa_GenLists); - SET_IsList(exec, _mesa_IsList); - SET_ListBase(exec, _mesa_ListBase); - SET_NewList(exec, _mesa_NewList); -#endif + + _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); @@ -222,21 +188,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_DepthFunc(exec, _mesa_DepthFunc); SET_DepthMask(exec, _mesa_DepthMask); SET_DepthRange(exec, _mesa_DepthRange); -#if FEATURE_drawpix - SET_Bitmap(exec, _mesa_Bitmap); - SET_CopyPixels(exec, _mesa_CopyPixels); - SET_DrawPixels(exec, _mesa_DrawPixels); -#endif -#if FEATURE_feedback - SET_InitNames(exec, _mesa_InitNames); - SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); - SET_LoadName(exec, _mesa_LoadName); - SET_PassThrough(exec, _mesa_PassThrough); - SET_PopName(exec, _mesa_PopName); - SET_PushName(exec, _mesa_PushName); - SET_SelectBuffer(exec, _mesa_SelectBuffer); - SET_RenderMode(exec, _mesa_RenderMode); -#endif + + _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); @@ -270,68 +225,22 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Lighti(exec, _mesa_Lighti); SET_Lightiv(exec, _mesa_Lightiv); SET_LoadMatrixd(exec, _mesa_LoadMatrixd); -#if FEATURE_evaluators - SET_GetMapdv(exec, _mesa_GetMapdv); - SET_GetMapfv(exec, _mesa_GetMapfv); - SET_GetMapiv(exec, _mesa_GetMapiv); - SET_Map1d(exec, _mesa_Map1d); - SET_Map1f(exec, _mesa_Map1f); - SET_Map2d(exec, _mesa_Map2d); - SET_Map2f(exec, _mesa_Map2f); - SET_MapGrid1d(exec, _mesa_MapGrid1d); - SET_MapGrid1f(exec, _mesa_MapGrid1f); - SET_MapGrid2d(exec, _mesa_MapGrid2d); - SET_MapGrid2f(exec, _mesa_MapGrid2f); -#endif + + _mesa_init_eval_dispatch(exec); + SET_MultMatrixd(exec, _mesa_MultMatrixd); -#if FEATURE_pixel_transfer - SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); - SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); - SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); - SET_PixelMapfv(exec, _mesa_PixelMapfv); - SET_PixelMapuiv(exec, _mesa_PixelMapuiv); - SET_PixelMapusv(exec, _mesa_PixelMapusv); - SET_PixelTransferf(exec, _mesa_PixelTransferf); - SET_PixelTransferi(exec, _mesa_PixelTransferi); - SET_PixelZoom(exec, _mesa_PixelZoom); -#endif + + _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); -#if FEATURE_attrib_stack - SET_PopAttrib(exec, _mesa_PopAttrib); - SET_PushAttrib(exec, _mesa_PushAttrib); - SET_PopClientAttrib(exec, _mesa_PopClientAttrib); - SET_PushClientAttrib(exec, _mesa_PushClientAttrib); -#endif -#if FEATURE_drawpix - SET_RasterPos2f(exec, _mesa_RasterPos2f); - SET_RasterPos2fv(exec, _mesa_RasterPos2fv); - SET_RasterPos2i(exec, _mesa_RasterPos2i); - SET_RasterPos2iv(exec, _mesa_RasterPos2iv); - SET_RasterPos2d(exec, _mesa_RasterPos2d); - SET_RasterPos2dv(exec, _mesa_RasterPos2dv); - SET_RasterPos2s(exec, _mesa_RasterPos2s); - SET_RasterPos2sv(exec, _mesa_RasterPos2sv); - SET_RasterPos3d(exec, _mesa_RasterPos3d); - SET_RasterPos3dv(exec, _mesa_RasterPos3dv); - SET_RasterPos3f(exec, _mesa_RasterPos3f); - SET_RasterPos3fv(exec, _mesa_RasterPos3fv); - SET_RasterPos3i(exec, _mesa_RasterPos3i); - SET_RasterPos3iv(exec, _mesa_RasterPos3iv); - SET_RasterPos3s(exec, _mesa_RasterPos3s); - SET_RasterPos3sv(exec, _mesa_RasterPos3sv); - SET_RasterPos4d(exec, _mesa_RasterPos4d); - SET_RasterPos4dv(exec, _mesa_RasterPos4dv); - SET_RasterPos4f(exec, _mesa_RasterPos4f); - SET_RasterPos4fv(exec, _mesa_RasterPos4fv); - SET_RasterPos4i(exec, _mesa_RasterPos4i); - SET_RasterPos4iv(exec, _mesa_RasterPos4iv); - SET_RasterPos4s(exec, _mesa_RasterPos4s); - SET_RasterPos4sv(exec, _mesa_RasterPos4sv); -#endif + + _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); @@ -339,17 +248,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexEnvf(exec, _mesa_TexEnvf); SET_TexEnviv(exec, _mesa_TexEnviv); -#if FEATURE_texgen - SET_GetTexGendv(exec, _mesa_GetTexGendv); - SET_GetTexGenfv(exec, _mesa_GetTexGenfv); - SET_GetTexGeniv(exec, _mesa_GetTexGeniv); - SET_TexGend(exec, _mesa_TexGend); - SET_TexGendv(exec, _mesa_TexGendv); - SET_TexGenf(exec, _mesa_TexGenf); - SET_TexGenfv(exec, _mesa_TexGenfv); - SET_TexGeni(exec, _mesa_TexGeni); - SET_TexGeniv(exec, _mesa_TexGeniv); -#endif + _mesa_init_texgen_dispatch(exec); SET_TexImage1D(exec, _mesa_TexImage1D); SET_TexParameterf(exec, _mesa_TexParameterf); @@ -395,45 +294,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_BlendEquation(exec, _mesa_BlendEquation); SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); -#if FEATURE_colortable - SET_ColorSubTable(exec, _mesa_ColorSubTable); - SET_ColorTable(exec, _mesa_ColorTable); - SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); -#endif - -#if FEATURE_convolve - SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); -#endif -#if FEATURE_histogram - SET_GetHistogram(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); - SET_Histogram(exec, _mesa_Histogram); - SET_Minmax(exec, _mesa_Minmax); - SET_ResetHistogram(exec, _mesa_ResetHistogram); - SET_ResetMinmax(exec, _mesa_ResetMinmax); -#endif + _mesa_init_colortable_dispatch(exec); + _mesa_init_convolve_dispatch(exec); + _mesa_init_histogram_dispatch(exec); /* OpenGL 2.0 */ SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); @@ -545,32 +408,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* 197. GL_MESA_window_pos */ -#if FEATURE_drawpix - SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); - SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); - SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); - SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); - SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); - SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); - SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); - SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); - SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); - SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); - SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); - SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); - SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); - SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); - SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); - SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); - SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); - SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); - SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); - SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); - SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); - SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); - SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); - SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); -#endif + /* part of _mesa_init_rastpos_dispatch(exec); */ /* 200. GL_IBM_multimode_draw_arrays */ #if _HAVE_FULL_GL @@ -762,16 +600,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - SET_GenQueriesARB(exec, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); - SET_IsQueryARB(exec, _mesa_IsQueryARB); - SET_BeginQueryARB(exec, _mesa_BeginQueryARB); - SET_EndQueryARB(exec, _mesa_EndQueryARB); - SET_GetQueryivARB(exec, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); -#endif + _mesa_init_queryobj_dispatch(exec); /* ARB 37. GL_ARB_draw_buffers */ #if FEATURE_draw_read_buffer @@ -881,11 +710,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); #endif -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - #if FEATURE_EXT_framebuffer_blit SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); #endif diff --git a/mesalib/src/mesa/main/api_loopback.c b/mesalib/src/mesa/main/api_loopback.c index 0e3f5ff95..3d466ac44 100644 --- a/mesalib/src/mesa/main/api_loopback.c +++ b/mesalib/src/mesa/main/api_loopback.c @@ -77,6 +77,10 @@ #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) #define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) + +#if FEATURE_beginend + + static void GLAPIENTRY loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) { @@ -1655,3 +1659,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); } + + +#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/main/api_loopback.h b/mesalib/src/mesa/main/api_loopback.h index 6f85bbc1d..3140eb515 100644 --- a/mesalib/src/mesa/main/api_loopback.h +++ b/mesalib/src/mesa/main/api_loopback.h @@ -27,11 +27,19 @@ #ifndef API_LOOPBACK_H #define API_LOOPBACK_H -#include "glheader.h" +#include "main/mtypes.h" - -struct _glapi_table; +#if FEATURE_beginend extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_loopback_init_api_table( struct _glapi_table *dest ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* API_LOOPBACK_H */ diff --git a/mesalib/src/mesa/main/api_noop.c b/mesalib/src/mesa/main/api_noop.c index 09ba7e506..f72f95730 100644 --- a/mesalib/src/mesa/main/api_noop.c +++ b/mesalib/src/mesa/main/api_noop.c @@ -30,9 +30,8 @@ #include "context.h" #include "light.h" #include "macros.h" -#if FEATURE_dlist #include "dlist.h" -#endif +#include "eval.h" #include "glapi/dispatch.h" @@ -44,6 +43,9 @@ */ +#if FEATURE_beginend + + static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b ) { GET_CURRENT_CONTEXT(ctx); @@ -731,7 +733,7 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, GET_CURRENT_CONTEXT(ctx); GLint i; - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; CALL_Begin(GET_DISPATCH(), (mode)); @@ -757,6 +759,43 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, CALL_End(GET_DISPATCH(), ()); } +static void GLAPIENTRY +_mesa_noop_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, + basevertex )) + return; + + CALL_Begin(GET_DISPATCH(), (mode)); + + switch (type) { + case GL_UNSIGNED_BYTE: + for (i = 0 ; i < count ; i++) + CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] + + basevertex)); + break; + case GL_UNSIGNED_SHORT: + for (i = 0 ; i < count ; i++) + CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] + + basevertex )); + break; + case GL_UNSIGNED_INT: + for (i = 0 ; i < count ; i++) + CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] + + basevertex )); + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElementsBaseVertex(type)" ); + break; + } + + CALL_End(GET_DISPATCH(), ()); +} + static void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode, @@ -768,7 +807,7 @@ _mesa_noop_DrawRangeElements(GLenum mode, if (_mesa_validate_DrawRangeElements( ctx, mode, start, end, - count, type, indices )) + count, type, indices, 0 )) CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices)); } @@ -786,6 +825,40 @@ _mesa_noop_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, } } +static void GLAPIENTRY +_mesa_noop_DrawRangeElementsBaseVertex(GLenum mode, + GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + + if (_mesa_validate_DrawRangeElements( ctx, mode, + start, end, + count, type, indices, basevertex )) + CALL_DrawElementsBaseVertex(GET_DISPATCH(), (mode, count, type, indices, + basevertex)); +} + +/* GL_EXT_multi_draw_arrays */ +void GLAPIENTRY +_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex) +{ + GLsizei i; + + for (i = 0; i < primcount; i++) { + if (count[i] > 0) { + CALL_DrawElementsBaseVertex(GET_DISPATCH(), (mode, count[i], type, + indices[i], + basevertex[i])); + } + } +} + /* * Eval Mesh */ @@ -921,26 +994,21 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _mesa_noop_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif + + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + vfmt->Color3f = _mesa_noop_Color3f; vfmt->Color3fv = _mesa_noop_Color3fv; vfmt->Color4f = _mesa_noop_Color4f; vfmt->Color4fv = _mesa_noop_Color4fv; vfmt->EdgeFlag = _mesa_noop_EdgeFlag; vfmt->End = _mesa_noop_End; -#if FEATURE_evaluators - vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; - vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; - vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; - vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; - vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; - vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; -#endif + + _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_); + vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; vfmt->Indexf = _mesa_noop_Indexf; @@ -995,6 +1063,10 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) vfmt->DrawElements = _mesa_noop_DrawElements; vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; + vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; + vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; + vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; } + + +#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/main/api_noop.h b/mesalib/src/mesa/main/api_noop.h index a7956d00b..e7fd49baf 100644 --- a/mesalib/src/mesa/main/api_noop.h +++ b/mesalib/src/mesa/main/api_noop.h @@ -25,8 +25,9 @@ #ifndef _API_NOOP_H #define _API_NOOP_H -#include "mtypes.h" -#include "context.h" +#include "main/mtypes.h" + +#if FEATURE_beginend extern void GLAPIENTRY _mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); @@ -44,7 +45,16 @@ extern void GLAPIENTRY _mesa_noop_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +extern void GLAPIENTRY +_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex); + extern void _mesa_noop_vtxfmt_init(GLvertexformat *vfmt); -#endif +#endif /* FEATURE_beginend */ + +#endif /* _API_NOOP_H */ diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index 507e21fe8..e71e5a6ce 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -29,7 +29,7 @@ #include "imports.h" #include "mtypes.h" #include "state.h" - +#include "vbo/vbo.h" /** @@ -124,6 +124,40 @@ check_valid_to_render(GLcontext *ctx, const char *function) return GL_TRUE; } +static GLboolean +check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + struct _mesa_prim prim; + struct _mesa_index_buffer ib; + GLuint min, max; + + /* Only the X Server needs to do this -- otherwise, accessing outside + * array/BO bounds allows application termination. + */ + if (!ctx->Const.CheckArrayBounds) + return GL_TRUE; + + memset(&prim, 0, sizeof(prim)); + prim.count = count; + + memset(&ib, 0, sizeof(ib)); + ib.type = type; + ib.ptr = indices; + ib.obj = ctx->Array.ElementArrayBufferObj; + + vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); + + if (min + basevertex < 0 || + max + basevertex > ctx->Array.ArrayObj->_MaxElement) { + /* the max element is out of bounds of one or more enabled arrays */ + _mesa_warning(ctx, "glDrawElements() index=%u is " + "out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement); + return GL_FALSE; + } + + return GL_TRUE; +} /** * Error checking for glDrawElements(). Includes parameter checking @@ -133,7 +167,7 @@ check_valid_to_render(GLcontext *ctx, const char *function) GLboolean _mesa_validate_DrawElements(GLcontext *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) + const GLvoid *indices, GLint basevertex) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -177,17 +211,8 @@ _mesa_validate_DrawElements(GLcontext *ctx, return GL_FALSE; } - if (ctx->Const.CheckArrayBounds) { - /* find max array index */ - GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array.ArrayObj->_MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, "glDrawElements() index=%u is " - "out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement); - return GL_FALSE; - } - } + if (!check_index_bounds(ctx, count, type, indices, basevertex)) + return GL_FALSE; return GL_TRUE; } @@ -202,7 +227,7 @@ GLboolean _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices) + const GLvoid *indices, GLint basevertex) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -250,14 +275,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, return GL_FALSE; } - if (ctx->Const.CheckArrayBounds) { - GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array.ArrayObj->_MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - return GL_FALSE; - } - } + if (!check_index_bounds(ctx, count, type, indices, basevertex)) + return GL_FALSE; return GL_TRUE; } diff --git a/mesalib/src/mesa/main/api_validate.h b/mesalib/src/mesa/main/api_validate.h index ff82a2966..6064d15fe 100644 --- a/mesalib/src/mesa/main/api_validate.h +++ b/mesalib/src/mesa/main/api_validate.h @@ -43,13 +43,13 @@ _mesa_validate_DrawArrays(GLcontext *ctx, extern GLboolean _mesa_validate_DrawElements(GLcontext *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices); + const GLvoid *indices, GLint basevertex); extern GLboolean _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices); + const GLvoid *indices, GLint basevertex); #endif diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index ab99ca1c6..246c5521b 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -57,6 +57,7 @@ #include "varray.h" #include "viewport.h" #include "mtypes.h" +#include "glapi/dispatch.h" /** @@ -74,6 +75,7 @@ struct gl_enable_attrib GLboolean Convolution2D; GLboolean Separable2D; GLboolean CullFace; + GLboolean DepthClamp; GLboolean DepthTest; GLboolean Dither; GLboolean Fog; @@ -173,6 +175,9 @@ struct texture_state }; +#if FEATURE_attrib_stack + + /** * Allocate new attribute node of given type/kind. Attach payload data. * Insert it into the linked list named by 'head'. @@ -265,6 +270,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Convolution2D = ctx->Pixel.Convolution2DEnabled; attr->Separable2D = ctx->Pixel.Separable2DEnabled; 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; @@ -514,6 +520,8 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) enable->ColorTable[COLORTABLE_POSTCOLORMATRIX], GL_POST_COLOR_MATRIX_COLOR_TABLE); 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->Pixel.Convolution1DEnabled, enable->Convolution1D, @@ -1221,6 +1229,9 @@ _mesa_PopAttrib(void) 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: @@ -1457,6 +1468,19 @@ _mesa_PopClientAttrib(void) } +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. */ diff --git a/mesalib/src/mesa/main/attrib.h b/mesalib/src/mesa/main/attrib.h index 2cf8fe693..6b48a1766 100644 --- a/mesalib/src/mesa/main/attrib.h +++ b/mesalib/src/mesa/main/attrib.h @@ -26,10 +26,10 @@ #define ATTRIB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_attrib_stack extern void GLAPIENTRY _mesa_PushAttrib( GLbitfield mask ); @@ -43,18 +43,34 @@ _mesa_PushClientAttrib( GLbitfield mask ); extern void GLAPIENTRY _mesa_PopClientAttrib( void ); +extern void +_mesa_init_attrib_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_attrib_stack */ + +static INLINE void +_mesa_PushClientAttrib( GLbitfield mask ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_PopClientAttrib( void ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_attrib_stack */ + extern void _mesa_init_attrib( GLcontext *ctx ); extern void _mesa_free_attrib_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_attrib( c ) ((void)0) -#define _mesa_free_attrib_data( c ) ((void)0) - -#endif - -#endif +#endif /* ATTRIB_H */ diff --git a/mesalib/src/mesa/main/blend.c b/mesalib/src/mesa/main/blend.c index 39cf6153e..830e3b2e5 100644 --- a/mesalib/src/mesa/main/blend.c +++ b/mesalib/src/mesa/main/blend.c @@ -72,7 +72,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n", _mesa_lookup_enum_by_nr(sfactorRGB), _mesa_lookup_enum_by_nr(dfactorRGB), @@ -250,7 +250,7 @@ _mesa_BlendEquation( GLenum mode ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glBlendEquation %s\n", _mesa_lookup_enum_by_nr(mode)); @@ -278,7 +278,7 @@ _mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glBlendEquationSeparateEXT %s %s\n", _mesa_lookup_enum_by_nr(modeRGB), _mesa_lookup_enum_by_nr(modeA)); diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index 189b5e165..52c4995b0 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -52,51 +52,55 @@ /** - * Get the buffer object bound to the specified target in a GL context. - * - * \param ctx GL context - * \param target Buffer object target to be retrieved. Currently this must - * be either \c GL_ARRAY_BUFFER or \c GL_ELEMENT_ARRAY_BUFFER. - * \return A pointer to the buffer object bound to \c target in the + * Return pointer to address of a buffer object target. + * \param ctx the GL context + * \param target the buffer object target to be retrieved. + * \return pointer to pointer to the buffer object bound to \c target in the * specified context or \c NULL if \c target is invalid. */ -static INLINE struct gl_buffer_object * -get_buffer(GLcontext *ctx, GLenum target) +static INLINE struct gl_buffer_object ** +get_buffer_target(GLcontext *ctx, GLenum target) { - struct gl_buffer_object * bufObj = NULL; - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bufObj = ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bufObj = ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bufObj = ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bufObj = ctx->Unpack.BufferObj; - break; - case GL_COPY_READ_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bufObj = ctx->CopyReadBuffer; - } - break; - case GL_COPY_WRITE_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bufObj = ctx->CopyWriteBuffer; - } - break; - default: - /* error must be recorded by caller */ - return NULL; + case GL_ARRAY_BUFFER_ARB: + return &ctx->Array.ArrayBufferObj; + case GL_ELEMENT_ARRAY_BUFFER_ARB: + return &ctx->Array.ElementArrayBufferObj; + case GL_PIXEL_PACK_BUFFER_EXT: + return &ctx->Pack.BufferObj; + case GL_PIXEL_UNPACK_BUFFER_EXT: + return &ctx->Unpack.BufferObj; + case GL_COPY_READ_BUFFER: + if (ctx->Extensions.ARB_copy_buffer) { + return &ctx->CopyReadBuffer; + } + break; + case GL_COPY_WRITE_BUFFER: + if (ctx->Extensions.ARB_copy_buffer) { + return &ctx->CopyWriteBuffer; + } + break; + default: + return NULL; } + return NULL; +} - /* bufObj should point to NullBufferObj or a user-created buffer object */ - ASSERT(bufObj); - return bufObj; +/** + * Get the buffer object bound to the specified target in a GL context. + * \param ctx the GL context + * \param target the buffer object target to be retrieved. + * \return pointer to the buffer object bound to \c target in the + * specified context or \c NULL if \c target is invalid. + */ +static INLINE struct gl_buffer_object * +get_buffer(GLcontext *ctx, GLenum target) +{ + struct gl_buffer_object **bufObj = get_buffer_target(ctx, target); + if (bufObj) + return *bufObj; + return NULL; } @@ -552,6 +556,7 @@ _mesa_init_buffer_objects( GLcontext *ctx ) /** * Bind the specified target to buffer for the specified context. + * Called by glBindBuffer() and other functions. */ static void bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) @@ -560,40 +565,14 @@ bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) struct gl_buffer_object *newBufObj = NULL; struct gl_buffer_object **bindTarget = NULL; - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bindTarget = &ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bindTarget = &ctx->Unpack.BufferObj; - break; - case GL_COPY_READ_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bindTarget = &ctx->CopyReadBuffer; - } - break; - case GL_COPY_WRITE_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bindTarget = &ctx->CopyWriteBuffer; - } - break; - default: - ; /* no-op / we'll hit the follow error test next */ - } - + bindTarget = get_buffer_target(ctx, target); if (!bindTarget) { _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target 0x%x)"); return; } /* Get pointer to old buffer object (to be unbound) */ - oldBufObj = get_buffer(ctx, target); + oldBufObj = *bindTarget; if (oldBufObj && oldBufObj->Name == buffer) return; /* rebinding the same buffer object- no change */ diff --git a/mesalib/src/mesa/main/buffers.c b/mesalib/src/mesa/main/buffers.c index d8b5f3b1f..97f065975 100644 --- a/mesalib/src/mesa/main/buffers.c +++ b/mesalib/src/mesa/main/buffers.c @@ -338,13 +338,13 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) if (ctx->Driver.DrawBuffers) ctx->Driver.DrawBuffers(ctx, n, buffers); else if (ctx->Driver.DrawBuffer) - ctx->Driver.DrawBuffer(ctx, n>0? buffers[0]:GL_NONE); + ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE); } /** * Helper function to set the GL_DRAW_BUFFER state in the context and - * current FBO. + * current FBO. Called via glDrawBuffer(), glDrawBuffersARB() * * All error checking will have been done prior to calling this function * so nothing should go wrong at this point. @@ -362,6 +362,7 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, { struct gl_framebuffer *fb = ctx->DrawBuffer; GLbitfield mask[MAX_DRAW_BUFFERS]; + GLboolean newState = GL_FALSE; if (!destMask) { /* compute destMask values now */ @@ -375,34 +376,54 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, destMask = mask; } + /* + * If n==1, destMask[0] may have up to four bits set. + * Otherwise, destMask[x] can only have one bit set. + */ if (n == 1) { - GLuint buf, count = 0; - /* init to -1 to help catch errors */ - fb->_ColorDrawBufferIndexes[0] = -1; - for (buf = 0; buf < BUFFER_COUNT; buf++) { - if (destMask[0] & (1 << buf)) { - fb->_ColorDrawBufferIndexes[count] = buf; - count++; + GLuint count = 0, destMask0 = destMask[0]; + while (destMask0) { + GLint bufIndex = _mesa_ffs(destMask0) - 1; + if (fb->_ColorDrawBufferIndexes[count] != bufIndex) { + fb->_ColorDrawBufferIndexes[count] = bufIndex; + newState = GL_TRUE; } + count++; + destMask0 &= ~(1 << bufIndex); } fb->ColorDrawBuffer[0] = buffers[0]; - fb->_NumColorDrawBuffers = count; + if (fb->_NumColorDrawBuffers != count) { + fb->_NumColorDrawBuffers = count; + newState = GL_TRUE; + } } else { GLuint buf, count = 0; for (buf = 0; buf < n; buf++ ) { if (destMask[buf]) { - fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1; + GLint bufIndex = _mesa_ffs(destMask[buf]) - 1; + /* only one bit should be set in the destMask[buf] field */ + ASSERT(_mesa_bitcount(destMask[buf]) == 1); + if (fb->_ColorDrawBufferIndexes[buf] != bufIndex) { + fb->_ColorDrawBufferIndexes[buf] = bufIndex; + newState = GL_TRUE; + } fb->ColorDrawBuffer[buf] = buffers[buf]; count = buf + 1; } else { - fb->_ColorDrawBufferIndexes[buf] = -1; + if (fb->_ColorDrawBufferIndexes[buf] != -1) { + fb->_ColorDrawBufferIndexes[buf] = -1; + newState = GL_TRUE; + } } } /* set remaining outputs to -1 (GL_NONE) */ while (buf < ctx->Const.MaxDrawBuffers) { - fb->_ColorDrawBufferIndexes[buf] = -1; + if (fb->_ColorDrawBufferIndexes[buf] != -1) { + fb->_ColorDrawBufferIndexes[buf] = -1; + newState = GL_TRUE; + } fb->ColorDrawBuffer[buf] = GL_NONE; buf++; } @@ -413,11 +434,15 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, /* also set context drawbuffer state */ GLuint buf; for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { - ctx->Color.DrawBuffer[buf] = fb->ColorDrawBuffer[buf]; + if (ctx->Color.DrawBuffer[buf] != fb->ColorDrawBuffer[buf]) { + ctx->Color.DrawBuffer[buf] = fb->ColorDrawBuffer[buf]; + newState = GL_TRUE; + } } } - ctx->NewState |= _NEW_BUFFERS; + if (newState) + FLUSH_VERTICES(ctx, _NEW_BUFFERS); } diff --git a/mesalib/src/mesa/main/colormac.h b/mesalib/src/mesa/main/colormac.h index 815624ee5..905f4e228 100644 --- a/mesalib/src/mesa/main/colormac.h +++ b/mesalib/src/mesa/main/colormac.h @@ -140,9 +140,9 @@ */ #define UNCLAMPED_FLOAT_TO_RGB_CHAN(dst, f) \ do { \ - UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \ } while (0) @@ -156,10 +156,10 @@ do { \ */ #define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f) \ do { \ - UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[3], f[3]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[3], (f)[3]); \ } while (0) @@ -210,6 +210,12 @@ do { \ #define PACK_COLOR_88_REV( L, A ) \ (((A) << 8) | (L)) +#define PACK_COLOR_1616( L, A ) \ + (((L) << 16) | (A)) + +#define PACK_COLOR_1616_REV( L, A ) \ + (((A) << 16) | (L)) + #define PACK_COLOR_332( R, G, B ) \ (((R) & 0xe0) | (((G) & 0xe0) >> 3) | (((B) & 0xc0) >> 6)) diff --git a/mesalib/src/mesa/main/colortab.c b/mesalib/src/mesa/main/colortab.c index 5a7de5f20..5ede76c1f 100644 --- a/mesalib/src/mesa/main/colortab.c +++ b/mesalib/src/mesa/main/colortab.c @@ -31,6 +31,11 @@ #include "macros.h" #include "state.h" #include "teximage.h" +#include "texstate.h" +#include "glapi/dispatch.h" + + +#if FEATURE_colortable /** @@ -278,7 +283,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, 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 = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + 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; @@ -443,7 +448,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, 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 = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + 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; @@ -535,37 +540,44 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, -void GLAPIENTRY +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); - /* Select buffer to read from */ + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width ); } -void GLAPIENTRY +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 ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; GLfloat rgba[MAX_COLOR_TABLE_SIZE][4]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -694,7 +706,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GLfloat *scale, *bias; @@ -739,7 +751,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparams[4]; @@ -762,11 +774,11 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -889,11 +901,11 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1044,6 +1056,25 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) } } + +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); +} + + +#endif /* FEATURE_colortable */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/mesalib/src/mesa/main/colortab.h b/mesalib/src/mesa/main/colortab.h index b6ff737a6..652fb5824 100644 --- a/mesalib/src/mesa/main/colortab.h +++ b/mesalib/src/mesa/main/colortab.h @@ -27,9 +27,16 @@ #define COLORTAB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_colortable + +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyColorTable = impl ## CopyColorTable; \ + (driver)->CopyColorSubTable = impl ## CopyColorSubTable; \ + (driver)->UpdateTexturePalette = impl ## UpdateTexturePalette; \ + } while (0) extern void GLAPIENTRY _mesa_ColorTable( GLenum target, GLenum internalformat, @@ -41,32 +48,35 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table ); -extern void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_init_colortable_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); +#else /* FEATURE_colortable */ -extern void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); +static INLINE void GLAPIENTRY +_mesa_ColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); +static INLINE void GLAPIENTRY +_mesa_ColorSubTable( GLenum target, GLsizei start, + GLsizei count, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); +static INLINE void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_colortable */ extern void @@ -81,20 +91,5 @@ _mesa_init_colortables( GLcontext *ctx ); extern void _mesa_free_colortables_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_colortable( p ) ((void) 0) - -/** No-op */ -#define _mesa_free_colortable_data( p ) ((void) 0) - -/** No-op */ -#define _mesa_init_colortables( p ) ((void)0) - -/** No-op */ -#define _mesa_free_colortables_data( p ) ((void)0) - -#endif -#endif +#endif /* COLORTAB_H */ diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h index 9319505a7..4eb249b4a 100644 --- a/mesalib/src/mesa/main/compiler.h +++ b/mesalib/src/mesa/main/compiler.h @@ -107,8 +107,7 @@ extern "C" { /** * finite macro. */ -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) -# define __WIN32__ +#if defined(_MSC_VER) # define finite _finite #elif defined(__WATCOMC__) # define finite _finite @@ -235,7 +234,12 @@ extern "C" { #elif defined(__APPLE__) #include #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) -#else /*__linux__ __APPLE__*/ +#elif (defined(_AIX) || defined(__blrts)) +#define CPU_TO_LE32( x ) x = ((x & 0x000000ff) << 24) | \ + ((x & 0x0000ff00) << 8) | \ + ((x & 0x00ff0000) >> 8) | \ + ((x & 0xff000000) >> 24); +#else /*__linux__ */ #include #define CPU_TO_LE32( x ) bswap32( x ) #endif /*__linux__*/ diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h index 8a09efdb5..c5048970c 100644 --- a/mesalib/src/mesa/main/config.h +++ b/mesalib/src/mesa/main/config.h @@ -205,7 +205,7 @@ #define MAX_VARYING 16 /**< number of float[4] vectors */ #define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS #define MAX_PROGRAM_INPUTS 32 -#define MAX_PROGRAM_OUTPUTS 32 +#define MAX_PROGRAM_OUTPUTS 64 /*@}*/ /** For GL_ARB_vertex_program */ diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index e844a7432..87eae9663 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -79,42 +79,28 @@ #include "glheader.h" #include "mfeatures.h" #include "imports.h" -#if FEATURE_accum #include "accum.h" -#endif #include "api_exec.h" #include "arrayobj.h" -#if FEATURE_attrib_stack #include "attrib.h" -#endif #include "blend.h" #include "buffers.h" #include "bufferobj.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "cpuinfo.h" #include "debug.h" #include "depth.h" -#if FEATURE_dlist #include "dlist.h" -#endif -#if FEATURE_evaluators #include "eval.h" -#endif #include "enums.h" #include "extensions.h" #include "fbobject.h" -#if FEATURE_feedback #include "feedback.h" -#endif #include "fog.h" #include "framebuffer.h" #include "get.h" -#if FEATURE_histogram #include "histogram.h" -#endif #include "hint.h" #include "hash.h" #include "light.h" @@ -126,21 +112,18 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query #include "queryobj.h" -#endif #if FEATURE_ARB_sync #include "syncobj.h" #endif -#if FEATURE_drawpix #include "rastpos.h" -#endif +#include "remap.h" #include "scissor.h" #include "shared.h" #include "simple_list.h" #include "state.h" #include "stencil.h" -#include "texcompress.h" +#include "texcompress_s3tc.h" #include "teximage.h" #include "texobj.h" #include "texstate.h" @@ -150,7 +133,6 @@ #include "viewport.h" #include "vtxfmt.h" #include "glapi/glthread.h" -#include "glapi/glapioffsets.h" #include "glapi/glapitable.h" #include "shader/program.h" #include "shader/prog_print.h" @@ -191,6 +173,8 @@ GLfloat _mesa_ubyte_to_float_color_tab[256]; void _mesa_notifySwapBuffers(__GLcontext *ctx) { + if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS) + _mesa_debug(ctx, "SwapBuffers\n"); FLUSH_CURRENT( ctx, 0 ); if (ctx->Driver.Flush) { ctx->Driver.Flush(ctx); @@ -423,6 +407,8 @@ one_time_init( GLcontext *ctx ) _mesa_get_cpu_features(); + _mesa_init_remap_table(); + _mesa_init_sqrt_table(); for (i = 0; i < 256; i++) { @@ -578,10 +564,6 @@ _mesa_init_constants(GLcontext *ctx) /* GL_ARB_draw_buffers */ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; - /* GL_OES_read_format */ - ctx->Const.ColorReadFormat = GL_RGBA; - ctx->Const.ColorReadType = GL_UNSIGNED_BYTE; - #if FEATURE_EXT_framebuffer_object ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxRenderbufferSize = MAX_WIDTH; @@ -615,9 +597,11 @@ _mesa_init_constants(GLcontext *ctx) ASSERT(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX); ASSERT(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX); - /* check that we don't exceed various 32-bit bitfields */ - ASSERT(VERT_RESULT_MAX <= 32); - ASSERT(FRAG_ATTRIB_MAX <= 32); + /* 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))); } @@ -678,36 +662,20 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_extensions( ctx ); /* Attribute Groups */ -#if FEATURE_accum _mesa_init_accum( ctx ); -#endif -#if FEATURE_attrib_stack _mesa_init_attrib( ctx ); -#endif _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); -#if FEATURE_colortable _mesa_init_colortables( ctx ); -#endif _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); -#if FEATURE_dlist _mesa_init_display_list( ctx ); -#endif -#if FEATURE_evaluators _mesa_init_eval( ctx ); -#endif _mesa_init_fbobjects( ctx ); -#if FEATURE_feedback _mesa_init_feedback( ctx ); -#else - ctx->RenderMode = GL_RENDER; -#endif _mesa_init_fog( ctx ); -#if FEATURE_histogram _mesa_init_histogram( ctx ); -#endif _mesa_init_hint( ctx ); _mesa_init_line( ctx ); _mesa_init_lighting( ctx ); @@ -718,15 +686,11 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); -#if FEATURE_ARB_occlusion_query - _mesa_init_query( ctx ); -#endif + _mesa_init_queryobj( ctx ); #if FEATURE_ARB_sync _mesa_init_sync( ctx ); #endif -#if FEATURE_drawpix _mesa_init_rastpos( ctx ); -#endif _mesa_init_scissor( ctx ); _mesa_init_shader_state( ctx ); _mesa_init_stencil( ctx ); @@ -737,12 +701,7 @@ init_attrib_groups(GLcontext *ctx) if (!_mesa_init_texture( ctx )) return GL_FALSE; -#if FEATURE_texture_s3tc _mesa_init_texture_s3tc( ctx ); -#endif -#if FEATURE_texture_fxt1 - _mesa_init_texture_fxt1( ctx ); -#endif /* Miscellaneous */ ctx->NewState = _NEW_ALL; @@ -904,10 +863,12 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_init_exec_table(ctx->Exec); #endif ctx->CurrentDispatch = ctx->Exec; + #if FEATURE_dlist - _mesa_init_dlist_table(ctx->Save); + _mesa_init_save_table(ctx->Save); _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); #endif + /* Neutral tnl module stuff */ _mesa_init_exec_vtxfmt( ctx ); ctx->TnlModule.Current = NULL; @@ -1006,24 +967,16 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); -#if FEATURE_attrib_stack _mesa_free_attrib_data(ctx); -#endif _mesa_free_lighting_data( ctx ); -#if FEATURE_evaluators _mesa_free_eval_data( ctx ); -#endif _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); -#if FEATURE_colortable _mesa_free_colortables_data( ctx ); -#endif _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); -#if FEATURE_ARB_occlusion_query - _mesa_free_query_data(ctx); -#endif + _mesa_free_queryobj_data(ctx); #if FEATURE_ARB_sync _mesa_free_sync_data(ctx); #endif @@ -1055,6 +1008,9 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_shared_state( ctx, ctx->Shared ); } + /* needs to be after freeing shared state */ + _mesa_free_display_list_data(ctx); + if (ctx->Extensions.String) _mesa_free((void *) ctx->Extensions.String); diff --git a/mesalib/src/mesa/main/convolve.c b/mesalib/src/mesa/main/convolve.c index 70951112a..8db3e79d3 100644 --- a/mesalib/src/mesa/main/convolve.c +++ b/mesalib/src/mesa/main/convolve.c @@ -40,6 +40,10 @@ #include "mtypes.h" #include "pixel.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_convolve /* @@ -256,7 +260,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); @@ -299,7 +303,7 @@ _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -351,7 +355,7 @@ _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); @@ -394,7 +398,7 @@ _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -459,7 +463,7 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { GLint baseFormat; @@ -482,12 +486,16 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi return; } + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyConvolutionFilter1D( ctx, target, internalFormat, x, y, width); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { GLint baseFormat; @@ -514,12 +522,16 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi return; } + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, width, height ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) { @@ -578,7 +590,7 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -639,7 +651,7 @@ _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -709,7 +721,7 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) { @@ -776,7 +788,7 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) { const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; @@ -1425,3 +1437,25 @@ _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); } } + + +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); +} + + +#endif /* FEATURE_convolve */ diff --git a/mesalib/src/mesa/main/convolve.h b/mesalib/src/mesa/main/convolve.h index 4505cdae0..59492bc7c 100644 --- a/mesalib/src/mesa/main/convolve.h +++ b/mesalib/src/mesa/main/convolve.h @@ -28,10 +28,17 @@ #define CONVOLVE_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_convolve + +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyConvolutionFilter1D = impl ## CopyConvolutionFilter1D; \ + (driver)->CopyConvolutionFilter2D = impl ## CopyConvolutionFilter2D; \ + } while (0) + extern void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); @@ -41,74 +48,79 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -extern void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params); - -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLsizei height); +extern void +_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image); +extern void +_mesa_convolve_sep_image(const GLcontext *ctx, + GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params); +extern void +_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, + GLsizei *width, GLsizei *height); -extern void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params); +extern void +_mesa_init_convolve_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span); +#else /* FEATURE_convolve */ -extern void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *row, const GLvoid *column); +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) do { } while (0) +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, + GLenum format, GLenum type, const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_sep_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height); + GLsizei *width, GLsizei *height) +{ +} + +static INLINE void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ +} -#else -#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) -#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) -#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) -#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) -#endif +#endif /* FEATURE_convolve */ -#endif +#endif /* CONVOLVE_H */ diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index 4a700b5cb..27ed92176 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -184,8 +184,8 @@ struct dd_function_table { * functions. The driver should examine \p internalFormat and return a * pointer to an appropriate gl_texture_format. */ - const struct gl_texture_format *(*ChooseTextureFormat)( GLcontext *ctx, - GLint internalFormat, GLenum srcFormat, GLenum srcType ); + GLuint (*ChooseTextureFormat)( GLcontext *ctx, GLint internalFormat, + GLenum srcFormat, GLenum srcType ); /** * Called by glTexImage1D(). @@ -475,13 +475,6 @@ struct dd_function_table { struct gl_texture_object *texObj, struct gl_texture_image *texImage); - /** - * Called to query number of bytes of storage needed to store the - * specified compressed texture. - */ - GLuint (*CompressedTextureSize)( GLcontext *ctx, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format ); /*@}*/ /** @@ -544,12 +537,6 @@ struct dd_function_table { GLboolean (*IsTextureResident)( GLcontext *ctx, struct gl_texture_object *t ); - /** - * Called by glPrioritizeTextures(). - */ - void (*PrioritizeTexture)( GLcontext *ctx, struct gl_texture_object *t, - GLclampf priority ); - /** * Called by glActiveTextureARB() to set current texture unit. */ @@ -717,40 +704,11 @@ struct dd_function_table { void (*TexParameter)(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params); - void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat); /** Set the viewport */ void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); /*@}*/ - /** - * \name Vertex array functions - * - * Called by the corresponding OpenGL functions. - */ - /*@{*/ - void (*VertexPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*NormalPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*ColorPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*FogCoordPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*IndexPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*SecondaryColorPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*TexCoordPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr); - void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size, - GLenum type, GLsizei stride, const GLvoid *ptr); - void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count ); - void (*UnlockArraysEXT)( GLcontext *ctx ); - /*@}*/ - - /** * \name State-query functions * @@ -1172,7 +1130,22 @@ typedef struct { 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); + /*@}*/ /** * \name Eval diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c index 8492c8561..a42113edc 100644 --- a/mesalib/src/mesa/main/debug.c +++ b/mesalib/src/mesa/main/debug.c @@ -27,6 +27,8 @@ #include "attrib.h" #include "colormac.h" #include "context.h" +#include "enums.h" +#include "formats.h" #include "hash.h" #include "imports.h" #include "debug.h" @@ -35,7 +37,6 @@ #include "readpix.h" #include "texgetimage.h" #include "texobj.h" -#include "texformat.h" /** @@ -57,6 +58,31 @@ const char *_mesa_prim_name[GL_POLYGON+4] = { "unknown state" }; + +static const char * +tex_target_name(GLenum tgt) +{ + static const struct { + GLenum target; + const char *name; + } tex_targets[] = { + { GL_TEXTURE_1D, "GL_TEXTURE_1D" }, + { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, + { GL_TEXTURE_3D, "GL_TEXTURE_3D" }, + { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" }, + { GL_TEXTURE_RECTANGLE, "GL_TEXTURE_RECTANGLE" }, + { GL_TEXTURE_1D_ARRAY_EXT, "GL_TEXTURE_1D_ARRAY" }, + { GL_TEXTURE_2D_ARRAY_EXT, "GL_TEXTURE_2D_ARRAY" } + }; + GLuint i; + for (i = 0; i < Elements(tex_targets); i++) { + if (tex_targets[i].target == tgt) + return tex_targets[i].name; + } + return "UNKNOWN TEX TARGET"; +} + + void _mesa_print_state( const char *msg, GLuint state ) { @@ -167,14 +193,16 @@ static void add_debug_flags( const char *debug ) static const struct debug_option debug_opt[] = { { "varray", VERBOSE_VARRAY }, { "tex", VERBOSE_TEXTURE }, - { "imm", VERBOSE_IMMEDIATE }, + { "mat", VERBOSE_MATERIAL }, { "pipe", VERBOSE_PIPELINE }, { "driver", VERBOSE_DRIVER }, { "state", VERBOSE_STATE }, { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM } + { "disassem", VERBOSE_DISASSEM }, + { "draw", VERBOSE_DRAW }, + { "swap", VERBOSE_SWAPBUFFERS } }; GLuint i; @@ -262,10 +290,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height, /** - * Write level[0] image to a ppm file. + * Write a texture image to a ppm file. + * \param face cube face in [0,5] + * \param level mipmap level */ static void -write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) +write_texture_image(struct gl_texture_object *texObj, + GLuint face, GLuint level) { struct gl_texture_image *img = texObj->Image[face][level]; if (img) { @@ -285,7 +316,7 @@ write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) buffer, texObj, img); /* make filename */ - _mesa_sprintf(s, "/tmp/teximage%u.ppm", texObj->Name); + _mesa_sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); _mesa_printf(" Writing image level %u to %s\n", level, s); write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); @@ -297,48 +328,153 @@ write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) } -static GLboolean DumpImages; +/** + * Write renderbuffer image to a ppm file. + */ +static void +write_renderbuffer_image(const struct gl_renderbuffer *rb) +{ + GET_CURRENT_CONTEXT(ctx); + GLubyte *buffer; + char s[100]; + GLenum format, type; + + if (rb->_BaseFormat == GL_RGB || + rb->_BaseFormat == GL_RGBA) { + format = GL_RGBA; + type = GL_UNSIGNED_BYTE; + } + else if (rb->_BaseFormat == GL_DEPTH_STENCIL) { + format = GL_DEPTH_STENCIL; + type = GL_UNSIGNED_INT_24_8; + } + else { + return; + } + + buffer = (GLubyte *) _mesa_malloc(rb->Width * rb->Height * 4); + + ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, + format, type, &ctx->DefaultPacking, buffer); + + /* make filename */ + _mesa_sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); + + _mesa_printf(" Writing renderbuffer image to %s\n", s); + write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); + + _mesa_free(buffer); +} + + +/** How many texture images (mipmap levels, faces) to write to files */ +#define WRITE_NONE 0 +#define WRITE_ONE 1 +#define WRITE_ALL 2 + +static GLuint WriteImages; static void -dump_texture_cb(GLuint id, void *data, void *userData) +dump_texture(struct gl_texture_object *texObj, GLuint writeImages) { - struct gl_texture_object *texObj = (struct gl_texture_object *) data; - int i; + const GLuint numFaces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1; GLboolean written = GL_FALSE; - (void) userData; + GLuint i, j; _mesa_printf("Texture %u\n", texObj->Name); - _mesa_printf(" Target 0x%x\n", texObj->Target); + _mesa_printf(" Target %s\n", tex_target_name(texObj->Target)); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { - struct gl_texture_image *texImg = texObj->Image[0][i]; - if (texImg) { - _mesa_printf(" Image %u: %d x %d x %d, format %u at %p\n", i, - texImg->Width, texImg->Height, texImg->Depth, - texImg->TexFormat->MesaFormat, texImg->Data); - if (DumpImages && !written) { - GLuint face = 0; - write_texture_image(texObj, face, i); - written = GL_TRUE; + for (j = 0; j < numFaces; j++) { + struct gl_texture_image *texImg = texObj->Image[j][i]; + if (texImg) { + _mesa_printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", + j, i, + texImg->Width, texImg->Height, texImg->Depth, + _mesa_get_format_name(texImg->TexFormat), + texImg->Data); + if (writeImages == WRITE_ALL || + (writeImages == WRITE_ONE && !written)) { + write_texture_image(texObj, j, i); + written = GL_TRUE; + } } } } } +/** + * Dump a single texture. + */ +void +_mesa_dump_texture(GLuint texture, GLuint writeImages) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture); + if (texObj) { + dump_texture(texObj, writeImages); + } +} + + +static void +dump_texture_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + (void) userData; + dump_texture(texObj, WriteImages); +} + + /** * Print basic info about all texture objext to stdout. * If dumpImages is true, write PPM of level[0] image to a file. */ void -_mesa_dump_textures(GLboolean dumpImages) +_mesa_dump_textures(GLuint writeImages) { GET_CURRENT_CONTEXT(ctx); - DumpImages = dumpImages; + WriteImages = writeImages; _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx); } +static void +dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) +{ + _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n", + rb->Name, rb->Width, rb->Height, + _mesa_lookup_enum_by_nr(rb->InternalFormat)); + if (writeImage) { + write_renderbuffer_image(rb); + } +} + + +static void +dump_renderbuffer_cb(GLuint id, void *data, void *userData) +{ + const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; + (void) userData; + dump_renderbuffer(rb, WriteImages); +} + + +/** + * Print basic info about all renderbuffers to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_renderbuffers(GLboolean writeImages) +{ + GET_CURRENT_CONTEXT(ctx); + WriteImages = writeImages; + _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx); +} + + + void _mesa_dump_color_buffer(const char *filename) { @@ -438,3 +574,64 @@ _mesa_dump_stencil_buffer(const char *filename) _mesa_free(buf); _mesa_free(buf2); } + + +/** + * Quick and dirty function to "print" a texture to stdout. + */ +void +_mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img) +{ +#if CHAN_TYPE != GL_UNSIGNED_BYTE + _mesa_problem(NULL, "PrintTexture not supported"); +#else + GLuint i, j, c; + const GLubyte *data = (const GLubyte *) img->Data; + + if (!data) { + _mesa_printf("No texture data\n"); + return; + } + + /* XXX add more formats or make into a new format utility function */ + switch (img->TexFormat) { + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: + c = 1; + break; + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + c = 2; + break; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: + c = 3; + break; + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_ARGB8888: + c = 4; + break; + default: + _mesa_problem(NULL, "error in PrintTexture\n"); + return; + } + + for (i = 0; i < img->Height; i++) { + for (j = 0; j < img->Width; j++) { + if (c==1) + _mesa_printf("%02x ", data[0]); + else if (c==2) + _mesa_printf("%02x%02x ", data[0], data[1]); + else if (c==3) + _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); + else if (c==4) + _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); + data += (img->RowStride - img->Width) * c; + } + /* XXX use img->ImageStride here */ + _mesa_printf("\n"); + } +#endif +} diff --git a/mesalib/src/mesa/main/debug.h b/mesalib/src/mesa/main/debug.h index bb384c432..0449cb179 100644 --- a/mesalib/src/mesa/main/debug.h +++ b/mesalib/src/mesa/main/debug.h @@ -58,7 +58,13 @@ extern void _mesa_init_debug( GLcontext *ctx ); #endif extern void -_mesa_dump_textures(GLboolean dumpImages); +_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); @@ -69,4 +75,7 @@ _mesa_dump_depth_buffer(const char *filename); extern void _mesa_dump_stencil_buffer(const char *filename); +extern void +_mesa_print_texture(GLcontext *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 91c036ef9..f187205b9 100644 --- a/mesalib/src/mesa/main/depth.c +++ b/mesalib/src/mesa/main/depth.c @@ -63,7 +63,7 @@ _mesa_DepthFunc( GLenum func ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func)); switch (func) { @@ -99,7 +99,7 @@ _mesa_DepthMask( GLboolean flag ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glDepthMask %d\n", flag); /* diff --git a/mesalib/src/mesa/main/depthstencil.c b/mesalib/src/mesa/main/depthstencil.c index 7be2aacaf..193c7f825 100644 --- a/mesalib/src/mesa/main/depthstencil.c +++ b/mesalib/src/mesa/main/depthstencil.c @@ -26,6 +26,7 @@ #include "imports.h" #include "context.h" #include "fbobject.h" +#include "formats.h" #include "mtypes.h" #include "depthstencil.h" #include "renderbuffer.h" @@ -40,8 +41,8 @@ * a combined Z+stencil buffer! That implies we need three different sets * of Get/Put functions. * - * We solve this by wrapping the Z24_S8 renderbuffer with depth and stencil - * adaptors, each with the right kind of depth/stencil 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. */ @@ -62,8 +63,8 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) static void delete_wrapper(struct gl_renderbuffer *rb) { - ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 || - rb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(rb->Format == MESA_FORMAT_Z24_S8 || + rb->Format == MESA_FORMAT_S8_Z24); _mesa_reference_renderbuffer(&rb->Wrapped, NULL); _mesa_free(rb); } @@ -82,7 +83,8 @@ alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb, (void) internalFormat; - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 || + dsrb->Format == MESA_FORMAT_S8_Z24); retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height); if (retVal) { @@ -108,14 +110,21 @@ get_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, GLuint *dst = (GLuint *) values; const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (!src) { dsrb->GetRow(ctx, dsrb, count, x, y, temp); src = temp; } - for (i = 0; i < count; i++) { - dst[i] = src[i] >> 8; + 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; + } } } @@ -127,13 +136,20 @@ get_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, GLuint temp[MAX_WIDTH], i; GLuint *dst = (GLuint *) values; ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); 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); - for (i = 0; i < count; i++) { - dst[i] = temp[i] >> 8; + 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; + } } } @@ -145,14 +161,23 @@ put_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, const GLuint *src = (const GLuint *) values; GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (src[i] << 8) | (dst[i] & 0xff); + 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); + } } } } @@ -160,9 +185,19 @@ put_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (src[i] << 8) | (temp[i] & 0xff); + 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); @@ -174,17 +209,27 @@ put_mono_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, GLint x, GLint y, const void *value, const GLubyte *mask) { struct gl_renderbuffer *dsrb = z24rb->Wrapped; - const GLuint shiftedVal = *((GLuint *) value) << 8; GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = shiftedVal | (dst[i] & 0xff); + 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); + } } } } @@ -192,9 +237,21 @@ put_mono_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); + 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); @@ -209,15 +266,25 @@ put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, struct gl_renderbuffer *dsrb = z24rb->Wrapped; const GLuint *src = (const GLuint *) values; ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dsrb->GetPointer(ctx, dsrb, 0, 0)) { /* direct access */ GLuint i; - 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); + 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); + } } } } @@ -225,9 +292,19 @@ put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (src[i] << 8) | (temp[i] & 0xff); + 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); @@ -241,12 +318,23 @@ put_mono_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, { struct gl_renderbuffer *dsrb = z24rb->Wrapped; GLuint temp[MAX_WIDTH], i; - const GLuint shiftedVal = *((GLuint *) value) << 8; /* get, modify, put */ dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); + 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); @@ -264,7 +352,8 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, { struct gl_renderbuffer *z24rb; - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 || + dsrb->Format == MESA_FORMAT_S8_Z24); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); z24rb = _mesa_new_renderbuffer(ctx, 0); @@ -277,10 +366,9 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, z24rb->Width = dsrb->Width; z24rb->Height = dsrb->Height; z24rb->InternalFormat = GL_DEPTH_COMPONENT24; - z24rb->_ActualFormat = GL_DEPTH_COMPONENT24; + z24rb->Format = MESA_FORMAT_X8_Z24; z24rb->_BaseFormat = GL_DEPTH_COMPONENT; z24rb->DataType = GL_UNSIGNED_INT; - z24rb->DepthBits = 24; z24rb->Data = NULL; z24rb->Delete = delete_wrapper; z24rb->AllocStorage = alloc_wrapper_storage; @@ -310,14 +398,21 @@ get_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, GLubyte *dst = (GLubyte *) values; const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (!src) { dsrb->GetRow(ctx, dsrb, count, x, y, temp); src = temp; } - for (i = 0; i < count; i++) { - dst[i] = src[i] & 0xff; + 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; + } } } @@ -329,13 +424,20 @@ get_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, GLuint temp[MAX_WIDTH], i; GLubyte *dst = (GLubyte *) values; ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); 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); - for (i = 0; i < count; i++) { - dst[i] = temp[i] & 0xff; + 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; + } } } @@ -347,14 +449,23 @@ put_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, const GLubyte *src = (const GLubyte *) values; GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | src[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); + } } } } @@ -362,9 +473,19 @@ put_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | src[i]; + 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); @@ -379,14 +500,23 @@ put_mono_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, const GLubyte val = *((GLubyte *) value); GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | val; + 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); + } } } } @@ -394,9 +524,19 @@ put_mono_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | val; + 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); @@ -411,15 +551,25 @@ put_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, struct gl_renderbuffer *dsrb = s8rb->Wrapped; const GLubyte *src = (const GLubyte *) values; ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dsrb->GetPointer(ctx, dsrb, 0, 0)) { /* direct access */ GLuint i; - 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]; + 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); + } } } } @@ -427,9 +577,19 @@ put_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | src[i]; + 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); @@ -446,9 +606,19 @@ put_mono_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, const GLubyte val = *((GLubyte *) value); /* get, modify, put */ dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff) | val; + 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); @@ -465,7 +635,8 @@ _mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb) { struct gl_renderbuffer *s8rb; - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 || + dsrb->Format == MESA_FORMAT_S8_Z24); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); s8rb = _mesa_new_renderbuffer(ctx, 0); @@ -478,10 +649,9 @@ _mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb) s8rb->Width = dsrb->Width; s8rb->Height = dsrb->Height; s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT; - s8rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; + s8rb->Format = MESA_FORMAT_S8; s8rb->_BaseFormat = GL_STENCIL_INDEX; s8rb->DataType = GL_UNSIGNED_BYTE; - s8rb->StencilBits = 8; s8rb->Data = NULL; s8rb->Delete = delete_wrapper; s8rb->AllocStorage = alloc_wrapper_storage; @@ -528,10 +698,10 @@ _mesa_extract_stencil(GLcontext *ctx, ASSERT(dsRb); ASSERT(stencilRb); - ASSERT(dsRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8); ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT || - stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 || + stencilRb->Format == MESA_FORMAT_S8); ASSERT(dsRb->Width == stencilRb->Width); ASSERT(dsRb->Height == stencilRb->Height); @@ -541,7 +711,7 @@ _mesa_extract_stencil(GLcontext *ctx, for (row = 0; row < height; row++) { GLuint depthStencil[MAX_WIDTH]; dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil); - if (stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { + if (stencilRb->Format == MESA_FORMAT_S8) { /* 8bpp stencil */ GLubyte stencil[MAX_WIDTH]; GLuint i; @@ -553,7 +723,7 @@ _mesa_extract_stencil(GLcontext *ctx, else { /* 32bpp stencil */ /* the 24 depth bits will be ignored */ - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + 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); } @@ -577,10 +747,10 @@ _mesa_insert_stencil(GLcontext *ctx, ASSERT(dsRb); ASSERT(stencilRb); - ASSERT(dsRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8); ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT || - stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 || + stencilRb->Format == MESA_FORMAT_S8); ASSERT(dsRb->Width == stencilRb->Width); ASSERT(dsRb->Height == stencilRb->Height); @@ -593,7 +763,7 @@ _mesa_insert_stencil(GLcontext *ctx, dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil); - if (stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { + if (stencilRb->Format == MESA_FORMAT_S8) { /* 8bpp stencil */ GLubyte stencil[MAX_WIDTH]; GLuint i; @@ -605,7 +775,7 @@ _mesa_insert_stencil(GLcontext *ctx, else { /* 32bpp stencil buffer */ GLuint stencil[MAX_WIDTH], i; - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + 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++) { @@ -631,7 +801,7 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) GLubyte *data; GLint i, j, k; - ASSERT(stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_S8); ASSERT(stencilRb->Data); data = (GLubyte *) stencilRb->Data; @@ -650,6 +820,4 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL); } _mesa_free(data); - - stencilRb->_BaseFormat = GL_DEPTH_STENCIL_EXT; } diff --git a/mesalib/src/mesa/main/dispatch.c b/mesalib/src/mesa/main/dispatch.c index bf1a01378..97d213e8e 100644 --- a/mesalib/src/mesa/main/dispatch.c +++ b/mesalib/src/mesa/main/dispatch.c @@ -43,6 +43,7 @@ #include "main/compiler.h" #include "glapi/glapi.h" #include "glapi/glapitable.h" +#include "glapi/glapidispatch.h" #include "glapi/glthread.h" @@ -88,7 +89,6 @@ #define GLAPIENTRY #endif -#include "glapi/dispatch.h" #include "glapi/glapitemp.h" #endif /* USE_X86_ASM */ diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index 41a5b6140..b692c335a 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.7 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * 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"), @@ -73,6 +74,7 @@ #include "texstate.h" #include "mtypes.h" #include "varray.h" +#include "vtxfmt.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program #include "shader/arbprogram.h" #include "shader/program.h" @@ -90,6 +92,33 @@ #include "glapi/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)( GLcontext *ctx, void *data ); + void (*Destroy)( GLcontext *ctx, void *data ); + void (*Print)( GLcontext *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. * @@ -438,6 +467,10 @@ typedef union gl_dlist_node Node; */ static GLuint InstSize[OPCODE_END_OF_LIST + 1]; + +#if FEATURE_dlist + + void mesa_print_display_list(GLuint list); @@ -472,6 +505,49 @@ lookup_list(GLcontext *ctx, GLuint 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(GLcontext *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(GLcontext *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(GLcontext *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. @@ -487,16 +563,14 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) done = block ? GL_FALSE : GL_TRUE; while (!done) { + const OpCode opcode = n[0].opcode; /* check for extension opcodes first */ - - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_destroy(ctx, n); } else { - switch (n[0].opcode) { + switch (opcode) { /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: _mesa_free(n[6].data); @@ -784,14 +858,13 @@ unpack_image(GLcontext *ctx, GLuint dimensions, /** - * Allocate space for a display list instruction. + * Allocate space for a display list instruction (opcode + payload space). * \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). + * \param bytes instruction payload size (not counting opcode) + * \return pointer to allocated memory (the opcode space) */ -void * -_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) +static Node * +dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes) { const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node); Node *n; @@ -825,9 +898,30 @@ _mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; ctx->ListState.CurrentPos += numNodes; - n[0].opcode = (OpCode) opcode; + n[0].opcode = opcode; - return (void *) (n + 1); /* return ptr to node following 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(GLcontext *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; } @@ -842,35 +936,39 @@ _mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) * \return the new opcode number or -1 if error */ GLint -_mesa_alloc_opcode(GLcontext *ctx, - GLuint size, - void (*execute) (GLcontext *, void *), - void (*destroy) (GLcontext *, void *), - void (*print) (GLcontext *, void *)) -{ - if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) { - const GLuint i = ctx->ListExt.NumOpcodes++; - ctx->ListExt.Opcode[i].Size = +_mesa_dlist_alloc_opcode(GLcontext *ctx, + GLuint size, + void (*execute) (GLcontext *, void *), + void (*destroy) (GLcontext *, void *), + void (*print) (GLcontext *, 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; + 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 display list instruction. Returns Node ptr to where the opcode - * is stored. - * - nParams is the number of function parameters - * - return value a pointer to sizeof(Node) before the actual - * usable data area. + * 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 */ -#define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \ - ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1) +static INLINE Node * +alloc_instruction(GLcontext *ctx, OpCode opcode, GLuint nparams) +{ + return dlist_alloc(ctx, opcode, nparams * sizeof(Node)); +} @@ -883,7 +981,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ACCUM, 2); if (n) { n[1].e = op; n[2].f = value; @@ -900,7 +998,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2); if (n) { n[1].e = func; n[2].f = (GLfloat) ref; @@ -917,7 +1015,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2); if (n) { n[1].e = target; n[2].ui = texture; @@ -936,7 +1034,7 @@ save_Bitmap(GLsizei width, GLsizei height, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BITMAP, 7); + n = alloc_instruction(ctx, OPCODE_BITMAP, 7); if (n) { n[1].i = (GLint) width; n[2].i = (GLint) height; @@ -959,7 +1057,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1); if (n) { n[1].e = mode; } @@ -975,7 +1073,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); if (n) { n[1].e = modeRGB; n[2].e = modeA; @@ -993,7 +1091,7 @@ save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); if (n) { n[1].e = sfactorRGB; n[2].e = dfactorRGB; @@ -1020,7 +1118,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1047,14 +1145,14 @@ static void invalidate_saved_current_state( GLcontext *ctx ) ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; } -void GLAPIENTRY -_mesa_save_CallList(GLuint list) +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); + n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1); if (n) { n[1].ui = list; } @@ -1070,8 +1168,8 @@ _mesa_save_CallList(GLuint list) } -void GLAPIENTRY -_mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) +static void GLAPIENTRY +save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) { GET_CURRENT_CONTEXT(ctx); GLint i; @@ -1098,7 +1196,7 @@ _mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) for (i = 0; i < num; i++) { GLint list = translate_id(i, type, lists); - Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2); + Node *n = alloc_instruction(ctx, OPCODE_CALL_LIST_OFFSET, 2); if (n) { n[1].i = list; n[2].b = typeErrorFlag; @@ -1122,7 +1220,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLEAR, 1); if (n) { n[1].bf = mask; } @@ -1138,7 +1236,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1157,7 +1255,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1176,7 +1274,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1); if (n) { n[1].f = (GLfloat) depth; } @@ -1192,7 +1290,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1); if (n) { n[1].f = c; } @@ -1208,7 +1306,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1); if (n) { n[1].i = s; } @@ -1224,7 +1322,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5); if (n) { n[1].e = plane; n[2].f = (GLfloat) equ[0]; @@ -1246,7 +1344,7 @@ save_ColorMask(GLboolean red, GLboolean green, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MASK, 4); + n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4); if (n) { n[1].b = red; n[2].b = green; @@ -1266,7 +1364,7 @@ save_ColorMaterial(GLenum face, GLenum mode) Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MATERIAL, 2); + n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2); if (n) { n[1].e = face; n[2].e = mode; @@ -1291,7 +1389,7 @@ save_ColorTable(GLenum target, GLenum internalFormat, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1319,7 +1417,7 @@ save_ColorTableParameterfv(GLenum target, GLenum pname, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1348,7 +1446,7 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1377,7 +1475,7 @@ save_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_SUB_TABLE, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6); if (n) { n[1].e = target; n[2].i = start; @@ -1402,7 +1500,7 @@ save_CopyColorSubTable(GLenum target, GLsizei start, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); + n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); if (n) { n[1].e = target; n[2].i = start; @@ -1424,7 +1522,7 @@ save_CopyColorTable(GLenum target, GLenum internalformat, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_TABLE, 5); + n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5); if (n) { n[1].e = target; n[2].e = internalformat; @@ -1447,7 +1545,7 @@ save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1474,7 +1572,7 @@ save_ConvolutionFilter2D(GLenum target, GLenum internalFormat, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1499,7 +1597,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); if (n) { n[1].e = target; n[2].e = pname; @@ -1517,7 +1615,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1545,7 +1643,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); if (n) { n[1].e = target; n[2].e = pname; @@ -1564,7 +1662,7 @@ save_ConvolutionParameterfv(GLenum target, GLenum pname, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1592,7 +1690,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5); if (n) { n[1].i = x; n[2].i = y; @@ -1614,7 +1712,7 @@ save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -1640,7 +1738,7 @@ save_CopyTexImage2D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -1666,7 +1764,7 @@ save_CopyTexSubImage1D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); if (n) { n[1].e = target; n[2].i = level; @@ -1690,7 +1788,7 @@ save_CopyTexSubImage2D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -1716,7 +1814,7 @@ save_CopyTexSubImage3D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -1742,7 +1840,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1); if (n) { n[1].e = mode; } @@ -1758,7 +1856,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1); if (n) { n[1].e = func; } @@ -1774,7 +1872,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1); if (n) { n[1].b = mask; } @@ -1790,7 +1888,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2); if (n) { n[1].f = (GLfloat) nearval; n[2].f = (GLfloat) farval; @@ -1807,7 +1905,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DISABLE, 1); if (n) { n[1].e = cap; } @@ -1823,7 +1921,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1); if (n) { n[1].e = mode; } @@ -1842,7 +1940,7 @@ save_DrawPixels(GLsizei width, GLsizei height, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_PIXELS, 5); + n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5); if (n) { n[1].i = width; n[2].i = height; @@ -1864,7 +1962,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ENABLE, 1); if (n) { n[1].e = cap; } @@ -1876,12 +1974,12 @@ save_Enable(GLenum cap) static void GLAPIENTRY -_mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) +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); + n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3); if (n) { n[1].e = mode; n[2].i = i1; @@ -1894,12 +1992,12 @@ _mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) static void GLAPIENTRY -_mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +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); + n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5); if (n) { n[1].e = mode; n[2].i = i1; @@ -1921,7 +2019,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_FOG, 5); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -1990,7 +2088,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1); if (n) { n[1].e = mode; } @@ -2007,7 +2105,7 @@ save_Frustum(GLdouble left, GLdouble right, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRUSTUM, 6); + n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6); if (n) { n[1].f = (GLfloat) left; n[2].f = (GLfloat) right; @@ -2028,7 +2126,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_HINT, 2); if (n) { n[1].e = target; n[2].e = mode; @@ -2047,7 +2145,7 @@ save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HISTOGRAM, 4); + n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4); if (n) { n[1].e = target; n[2].i = width; @@ -2066,7 +2164,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1); if (n) { n[1].ui = mask; } @@ -2081,7 +2179,7 @@ save_InitNames(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_INIT_NAMES, 0); + (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0); if (ctx->ExecuteFlag) { CALL_InitNames(ctx->Exec, ()); } @@ -2094,7 +2192,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LIGHT, 6); if (n) { GLint i, nParams; n[1].e = light; @@ -2208,7 +2306,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -2275,7 +2373,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2); if (n) { n[1].i = factor; n[2].us = pattern; @@ -2292,7 +2390,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1); if (n) { n[1].f = width; } @@ -2308,7 +2406,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1); if (n) { n[1].ui = base; } @@ -2323,7 +2421,7 @@ save_LoadIdentity(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0); + (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0); if (ctx->ExecuteFlag) { CALL_LoadIdentity(ctx->Exec, ()); } @@ -2336,7 +2434,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16); if (n) { GLuint i; for (i = 0; i < 16; i++) { @@ -2367,7 +2465,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1); if (n) { n[1].ui = name; } @@ -2383,7 +2481,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1); if (n) { n[1].e = opcode; } @@ -2400,7 +2498,7 @@ save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 6); if (n) { GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points); n[1].e = target; @@ -2422,7 +2520,7 @@ save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 6); if (n) { GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points); n[1].e = target; @@ -2447,7 +2545,7 @@ save_Map2d(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 10); if (n) { GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder, vstride, vorder, points); @@ -2480,7 +2578,7 @@ save_Map2f(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 10); if (n) { GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder, vstride, vorder, points); @@ -2509,7 +2607,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3); if (n) { n[1].i = un; n[2].f = u1; @@ -2535,7 +2633,7 @@ save_MapGrid2f(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_MAPGRID2, 6); + n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6); if (n) { n[1].i = un; n[2].f = u1; @@ -2566,7 +2664,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1); if (n) { n[1].e = mode; } @@ -2583,7 +2681,7 @@ save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3); + n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -2601,7 +2699,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16); if (n) { GLuint i; for (i = 0; i < 16; i++) { @@ -2645,7 +2743,7 @@ save_Ortho(GLdouble left, GLdouble right, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6); + n = alloc_instruction(ctx, OPCODE_ORTHO, 6); if (n) { n[1].f = (GLfloat) left; n[2].f = (GLfloat) right; @@ -2666,7 +2764,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3); if (n) { n[1].e = map; n[2].i = mapsize; @@ -2723,7 +2821,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2); if (n) { n[1].e = pname; n[2].f = param; @@ -2747,7 +2845,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2); if (n) { n[1].f = xfactor; n[2].f = yfactor; @@ -2764,7 +2862,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -2811,7 +2909,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1); if (n) { n[1].f = size; } @@ -2827,7 +2925,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2); if (n) { n[1].e = face; n[2].e = mode; @@ -2846,7 +2944,7 @@ save_PolygonStipple(const GLubyte * pattern) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1); + 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); @@ -2863,7 +2961,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2); if (n) { n[1].f = factor; n[2].f = units; @@ -2888,7 +2986,7 @@ save_PopAttrib(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_ATTRIB, 0); + (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0); if (ctx->ExecuteFlag) { CALL_PopAttrib(ctx->Exec, ()); } @@ -2900,7 +2998,7 @@ save_PopMatrix(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_MATRIX, 0); + (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0); if (ctx->ExecuteFlag) { CALL_PopMatrix(ctx->Exec, ()); } @@ -2912,7 +3010,7 @@ save_PopName(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_NAME, 0); + (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0); if (ctx->ExecuteFlag) { CALL_PopName(ctx->Exec, ()); } @@ -2929,7 +3027,7 @@ save_PrioritizeTextures(GLsizei num, const GLuint * textures, for (i = 0; i < num; i++) { Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); + n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); if (n) { n[1].ui = textures[i]; n[2].f = priorities[i]; @@ -2947,7 +3045,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1); if (n) { n[1].bf = mask; } @@ -2962,7 +3060,7 @@ save_PushMatrix(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_MATRIX, 0); + (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0); if (ctx->ExecuteFlag) { CALL_PushMatrix(ctx->Exec, ()); } @@ -2975,7 +3073,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1); if (n) { n[1].ui = name; } @@ -2991,7 +3089,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4); if (n) { n[1].f = x; n[2].f = y; @@ -3150,7 +3248,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1); if (n) { n[1].f = token; } @@ -3166,7 +3264,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1); if (n) { n[1].e = mode; } @@ -3182,7 +3280,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1); if (n) { n[1].e = target; } @@ -3198,7 +3296,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1); if (n) { n[1].e = target; } @@ -3214,7 +3312,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ROTATE, 4); if (n) { n[1].f = angle; n[2].f = x; @@ -3240,7 +3338,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_SCALE, 3); if (n) { n[1].f = x; n[2].f = y; @@ -3265,7 +3363,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_SCISSOR, 4); if (n) { n[1].i = x; n[2].i = y; @@ -3299,7 +3397,7 @@ save_ShadeModel(GLenum mode) if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) ctx->ListState.Current.ShadeModel = mode; - n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1); + n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1); if (n) { n[1].e = mode; } @@ -3312,7 +3410,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3); if (n) { n[1].e = func; n[2].i = ref; @@ -3330,7 +3428,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1); if (n) { n[1].ui = mask; } @@ -3346,7 +3444,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3); if (n) { n[1].e = fail; n[2].e = zfail; @@ -3364,7 +3462,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = face; n[2].e = func; @@ -3385,7 +3483,7 @@ save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* GL_FRONT */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = GL_FRONT; n[2].e = frontfunc; @@ -3393,7 +3491,7 @@ save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, n[4].ui = mask; } /* GL_BACK */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = GL_BACK; n[2].e = backfunc; @@ -3413,7 +3511,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); if (n) { n[1].e = face; n[2].ui = mask; @@ -3430,7 +3528,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); if (n) { n[1].e = face; n[2].e = fail; @@ -3449,7 +3547,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_TEXENV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -3514,7 +3612,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_TEXGEN, 6); if (n) { n[1].e = coord; n[2].e = pname; @@ -3589,7 +3687,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -3649,7 +3747,7 @@ save_TexImage1D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE1D, 8); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -3684,7 +3782,7 @@ save_TexImage2D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -3722,7 +3820,7 @@ save_TexImage3D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE3D, 10); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10); if (n) { n[1].e = target; n[2].i = level; @@ -3755,7 +3853,7 @@ save_TexSubImage1D(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -3784,7 +3882,7 @@ save_TexSubImage2D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -3815,7 +3913,7 @@ save_TexSubImage3D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); if (n) { n[1].e = target; n[2].i = level; @@ -3845,7 +3943,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3); if (n) { n[1].f = x; n[2].f = y; @@ -3871,7 +3969,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4); if (n) { n[1].i = x; n[2].i = y; @@ -3890,7 +3988,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4); if (n) { n[1].f = x; n[2].f = y; @@ -4051,7 +4149,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1); if (n) { n[1].e = target; } @@ -4124,7 +4222,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -4170,7 +4268,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -4217,7 +4315,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -4260,7 +4358,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -4300,7 +4398,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -4342,7 +4440,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); if (n) { n[1].e = target; n[2].i = level; @@ -4375,7 +4473,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2); if (n) { n[1].f = value; n[2].b = invert; @@ -4396,7 +4494,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_NV, 2); if (n) { n[1].e = target; n[2].ui = id; @@ -4413,7 +4511,7 @@ save_ProgramEnvParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4450,7 +4548,7 @@ save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * p = params; for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4498,7 +4596,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); if (n) { n[1].e = target; n[2].ui = id; @@ -4544,7 +4642,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_PROGRAM_NV, 4); + n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4); if (n) { GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); if (!programCopy) { @@ -4571,7 +4669,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 2); + n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2); if (n) { GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); if (!idCopy) { @@ -4595,7 +4693,7 @@ save_TrackMatrixNV(GLenum target, GLuint address, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 4); + n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4); if (n) { n[1].e = target; n[2].ui = address; @@ -4620,7 +4718,7 @@ save_ProgramLocalParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4642,7 +4740,7 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4670,7 +4768,7 @@ save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * p = params; for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4697,7 +4795,7 @@ save_ProgramLocalParameter4dARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4719,7 +4817,7 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4742,7 +4840,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); if (n) { GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); if (!nameCopy) { @@ -4801,7 +4899,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); if (n) { n[1].e = face; } @@ -4818,7 +4916,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2); if (n) { n[1].f = (GLfloat) zmin; n[2].f = (GLfloat) zmax; @@ -4841,7 +4939,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_STRING_ARB, 4); + n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4); if (n) { GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); if (!programCopy) { @@ -4862,7 +4960,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj static void GLAPIENTRY save_BeginQueryARB(GLenum target, GLuint id) @@ -4870,7 +4968,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2); if (n) { n[1].e = target; n[2].ui = id; @@ -4887,7 +4985,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1); if (n) { n[1].e = target; } @@ -4896,7 +4994,7 @@ save_EndQueryARB(GLenum target) } } -#endif /* FEATURE_ARB_occlusion_query */ +#endif /* FEATURE_queryobj */ static void GLAPIENTRY @@ -4905,7 +5003,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS); if (n) { GLint i; n[1].i = count; @@ -4926,7 +5024,7 @@ save_TexBumpParameterfvATI(GLenum pname, const GLfloat *param) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5); + n = alloc_instruction(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5); if (n) { n[1].ui = pname; n[2].f = param[0]; @@ -4957,7 +5055,7 @@ save_BindFragmentShaderATI(GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); + n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); if (n) { n[1].ui = id; } @@ -4972,7 +5070,7 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); + n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); if (n) { n[1].ui = dst; n[2].f = value[0]; @@ -4992,7 +5090,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2); if (n) { n[1].e = attr; n[2].f = x; @@ -5013,7 +5111,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3); if (n) { n[1].e = attr; n[2].f = x; @@ -5035,7 +5133,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4); if (n) { n[1].e = attr; n[2].f = x; @@ -5058,7 +5156,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5); if (n) { n[1].e = attr; n[2].f = x; @@ -5083,7 +5181,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2); if (n) { n[1].e = attr; n[2].f = x; @@ -5104,7 +5202,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3); if (n) { n[1].e = attr; n[2].f = x; @@ -5126,7 +5224,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4); if (n) { n[1].e = attr; n[2].f = x; @@ -5149,7 +5247,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5); if (n) { n[1].e = attr; n[2].f = x; @@ -5174,7 +5272,7 @@ save_EvalCoord1f(GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C1, 1); + n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1); if (n) { n[1].f = x; } @@ -5195,7 +5293,7 @@ save_EvalCoord2f(GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C2, 2); + n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2); if (n) { n[1].f = x; n[2].f = y; @@ -5218,7 +5316,7 @@ save_EvalPoint1(GLint x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P1, 1); + n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1); if (n) { n[1].i = x; } @@ -5233,7 +5331,7 @@ save_EvalPoint2(GLint x, GLint y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P2, 2); + n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2); if (n) { n[1].i = x; n[2].i = y; @@ -5336,7 +5434,7 @@ save_Materialfv(GLenum face, GLenum pname, const GLfloat * param) SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATERIAL, 6); + n = alloc_instruction(ctx, OPCODE_MATERIAL, 6); if (n) { n[1].e = face; n[2].e = pname; @@ -5379,7 +5477,7 @@ save_Begin(GLenum mode) return; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN, 1); + n = alloc_instruction(ctx, OPCODE_BEGIN, 1); if (n) { n[1].e = mode; } @@ -5395,7 +5493,7 @@ save_End(void) { GET_CURRENT_CONTEXT(ctx); SAVE_FLUSH_VERTICES(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END, 0); + (void) alloc_instruction(ctx, OPCODE_END, 0); ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; if (ctx->ExecuteFlag) { CALL_End(ctx->Exec, ()); @@ -5408,7 +5506,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_RECTF, 4); if (n) { n[1].f = a; n[2].f = b; @@ -5822,7 +5920,7 @@ save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); + n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); if (n) { n[1].i = srcX0; n[2].i = srcY0; @@ -5851,7 +5949,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1); if (n) { n[1].e = mode; } @@ -5869,7 +5967,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1); if (n) { n[1].ui = program; } @@ -5885,7 +5983,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2); if (n) { n[1].i = location; n[2].f = x; @@ -5902,7 +6000,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3); if (n) { n[1].i = location; n[2].f = x; @@ -5920,7 +6018,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4); if (n) { n[1].i = location; n[2].f = x; @@ -5939,7 +6037,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5); if (n) { n[1].i = location; n[2].f = x; @@ -5970,7 +6068,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -5987,7 +6085,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6004,7 +6102,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6021,7 +6119,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6039,7 +6137,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2); if (n) { n[1].i = location; n[2].i = x; @@ -6055,7 +6153,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3); if (n) { n[1].i = location; n[2].i = x; @@ -6072,7 +6170,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4); if (n) { n[1].i = location; n[2].i = x; @@ -6090,7 +6188,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5); if (n) { n[1].i = location; n[2].i = x; @@ -6111,7 +6209,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6128,7 +6226,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6145,7 +6243,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6162,7 +6260,7 @@ 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); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6181,7 +6279,7 @@ save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX22, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6200,7 +6298,7 @@ save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX33, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6219,7 +6317,7 @@ save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX44, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6239,7 +6337,7 @@ save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX23, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6258,7 +6356,7 @@ save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX32, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6278,7 +6376,7 @@ save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX24, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6297,7 +6395,7 @@ save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX42, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6317,7 +6415,7 @@ save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX34, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6336,7 +6434,7 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX43, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6360,7 +6458,7 @@ static void save_error(GLcontext *ctx, GLenum error, const char *s) { Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2); + n = alloc_instruction(ctx, OPCODE_ERROR, 2); if (n) { n[1].e = error; n[2].data = (void *) s; @@ -6436,13 +6534,10 @@ execute_list(GLcontext *ctx, GLuint list) done = GL_FALSE; while (!done) { - OpCode opcode = n[0].opcode; - int i = (int) n[0].opcode - (int) OPCODE_EXT_0; + const OpCode opcode = n[0].opcode; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Execute(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_execute(ctx, n); } else { switch (opcode) { @@ -7161,7 +7256,7 @@ execute_list(GLcontext *ctx, GLuint list) n[6].f)); break; #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj case OPCODE_BEGIN_QUERY_ARB: CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); break; @@ -7432,7 +7527,7 @@ execute_list(GLcontext *ctx, GLuint list) /** * Test if a display list number is valid. */ -GLboolean GLAPIENTRY +static GLboolean GLAPIENTRY _mesa_IsList(GLuint list) { GET_CURRENT_CONTEXT(ctx); @@ -7445,7 +7540,7 @@ _mesa_IsList(GLuint list) /** * Delete a sequence of consecutive display lists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DeleteLists(GLuint list, GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7467,7 +7562,7 @@ _mesa_DeleteLists(GLuint list, GLsizei range) * Return a display list number, n, such that lists n through n+range-1 * are free. */ -GLuint GLAPIENTRY +static GLuint GLAPIENTRY _mesa_GenLists(GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7507,7 +7602,7 @@ _mesa_GenLists(GLsizei range) /** * Begin a new display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); @@ -7557,7 +7652,7 @@ _mesa_NewList(GLuint name, GLenum mode) /** * End definition of current display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndList(void) { GET_CURRENT_CONTEXT(ctx); @@ -7578,7 +7673,7 @@ _mesa_EndList(void) */ ctx->Driver.EndList(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); + (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0); /* Destroy old list, if any */ destroy_list(ctx, ctx->ListState.CurrentList->Name); @@ -7691,7 +7786,7 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) /** * Set the offset added to list numbers in glCallLists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_ListBase(GLuint base) { GET_CURRENT_CONTEXT(ctx); @@ -8426,7 +8521,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode, * struct. */ void -_mesa_init_dlist_table(struct _glapi_table *table) +_mesa_init_save_table(struct _glapi_table *table) { _mesa_loopback_init_api_table(table); @@ -8435,8 +8530,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_AlphaFunc(table, save_AlphaFunc); SET_Bitmap(table, save_Bitmap); SET_BlendFunc(table, save_BlendFunc); - SET_CallList(table, _mesa_save_CallList); - SET_CallLists(table, _mesa_save_CallLists); + 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); @@ -8457,8 +8552,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_DrawPixels(table, save_DrawPixels); SET_Enable(table, save_Enable); SET_EndList(table, _mesa_EndList); - SET_EvalMesh1(table, _mesa_save_EvalMesh1); - SET_EvalMesh2(table, _mesa_save_EvalMesh2); + 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); @@ -8930,7 +9025,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); SET_GenQueriesARB(table, _mesa_GenQueriesARB); @@ -9036,13 +9131,10 @@ print_list(GLcontext *ctx, GLuint list) done = n ? GL_FALSE : GL_TRUE; while (!done) { - OpCode opcode = n[0].opcode; - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; + const OpCode opcode = n[0].opcode; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Print(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_print(ctx, n); } else { switch (opcode) { @@ -9297,22 +9389,21 @@ mesa_print_display_list(GLuint list) void _mesa_save_vtxfmt_init(GLvertexformat * vfmt) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = save_Begin; - vfmt->CallList = _mesa_save_CallList; - vfmt->CallLists = _mesa_save_CallLists; + + _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; - vfmt->EvalCoord1f = save_EvalCoord1f; - vfmt->EvalCoord1fv = save_EvalCoord1fv; - vfmt->EvalCoord2f = save_EvalCoord2f; - vfmt->EvalCoord2fv = save_EvalCoord2fv; - vfmt->EvalPoint1 = save_EvalPoint1; - vfmt->EvalPoint2 = save_EvalPoint2; + + _MESA_INIT_EVAL_VTXFMT(vfmt, save_); + vfmt->FogCoordfEXT = save_FogCoordfEXT; vfmt->FogCoordfvEXT = save_FogCoordfvEXT; vfmt->Indexf = save_Indexf; @@ -9361,8 +9452,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB; - vfmt->EvalMesh1 = _mesa_save_EvalMesh1; - vfmt->EvalMesh2 = _mesa_save_EvalMesh2; vfmt->Rectf = save_Rectf; /* The driver is required to implement these as @@ -9376,10 +9465,39 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) 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. */ @@ -9394,6 +9512,9 @@ _mesa_init_display_list(GLcontext *ctx) tableInitialized = GL_TRUE; } + /* extension info */ + ctx->ListExt = CALLOC_STRUCT(gl_list_extensions); + /* Display list */ ctx->ListState.CallDepth = 0; ctx->ExecuteFlag = GL_TRUE; @@ -9404,5 +9525,15 @@ _mesa_init_display_list(GLcontext *ctx) /* Display List group */ ctx->List.ListBase = 0; +#if FEATURE_dlist _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); +#endif +} + + +void +_mesa_free_display_list_data(GLcontext *ctx) +{ + free(ctx->ListExt); + ctx->ListExt = NULL; } diff --git a/mesalib/src/mesa/main/dlist.h b/mesalib/src/mesa/main/dlist.h index ab7ec2c8d..f37a93a7f 100644 --- a/mesalib/src/mesa/main/dlist.h +++ b/mesalib/src/mesa/main/dlist.h @@ -33,64 +33,80 @@ #define DLIST_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_dlist -extern void -_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewList = impl ## NewList; \ + (driver)->EndList = impl ## EndList; \ + (driver)->BeginCallList = impl ## BeginCallList; \ + (driver)->EndCallList = impl ## EndCallList; \ + (driver)->SaveFlushVertices = impl ## SaveFlushVertices; \ + (driver)->NotifySaveBegin = impl ## NotifyBegin; \ + } while (0) + +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->CallList = impl ## CallList; \ + (vfmt)->CallLists = impl ## CallLists; \ + } while (0) extern void GLAPIENTRY _mesa_CallList( GLuint list ); extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); -extern void GLAPIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ); -extern void GLAPIENTRY _mesa_EndList( void ); +extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); -extern GLuint GLAPIENTRY _mesa_GenLists( GLsizei range ); +extern void *_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint sz); -extern GLboolean GLAPIENTRY _mesa_IsList( GLuint list ); +extern GLint _mesa_dlist_alloc_opcode( GLcontext *ctx, GLuint sz, + void (*execute)( GLcontext *, void * ), + void (*destroy)( GLcontext *, void * ), + void (*print)( GLcontext *, void * ) ); -extern void GLAPIENTRY _mesa_ListBase( GLuint base ); +extern void _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); -extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode ); +extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); -extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); +extern void _mesa_init_save_table( struct _glapi_table *table ); -extern void GLAPIENTRY _mesa_save_CallList( GLuint list ); +extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); +extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp); +#else /* FEATURE_dlist */ -extern void _mesa_init_dlist_table( struct _glapi_table *table ); +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) do { } while (0) +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0) -extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); +static INLINE void +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) +{ + /* there should be no list to delete */ + ASSERT_NO_FEATURE(); +} +static INLINE void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz); +static INLINE void +_mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ +} -extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, - void (*execute)( GLcontext *, void * ), - void (*destroy)( GLcontext *, void * ), - void (*print)( GLcontext *, void * ) ); +#endif /* FEATURE_dlist */ extern void _mesa_init_display_list( GLcontext * ctx ); -extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); - - -#else - -/** No-op */ -#define _mesa_init_dlist_table(t,ts) ((void)0) - -/** No-op */ -#define _mesa_init_display_list(c) ((void)0) - -/** No-op */ -#define _mesa_save_vtxfmt_init(v) ((void)0) +extern void _mesa_free_display_list_data(GLcontext *ctx); -#endif -#endif +#endif /* DLIST_H */ diff --git a/mesalib/src/mesa/main/dlopen.c b/mesalib/src/mesa/main/dlopen.c index 414cfad8e..81e032081 100644 --- a/mesalib/src/mesa/main/dlopen.c +++ b/mesalib/src/mesa/main/dlopen.c @@ -31,7 +31,7 @@ #include "compiler.h" #include "dlopen.h" -#if defined(_GNU_SOURCE) && !defined(__MINGW32__) +#if defined(_GNU_SOURCE) && !defined(__MINGW32__) && !defined(__blrts) #include #endif #if defined(_WIN32) @@ -46,7 +46,9 @@ void * _mesa_dlopen(const char *libname, int flags) { -#if defined(_GNU_SOURCE) +#if defined(__blrts) + return NULL; +#elif defined(_GNU_SOURCE) flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */ return dlopen(libname, flags); #elif defined(__MINGW32__) @@ -65,7 +67,9 @@ _mesa_dlopen(const char *libname, int flags) GenericFunc _mesa_dlsym(void *handle, const char *fname) { -#if defined(__DJGPP__) +#if defined(__blrts) + return (GenericFunc) NULL; +#elif defined(__DJGPP__) /* need '_' prefix on symbol names */ char fname2[1000]; fname2[0] = '_'; @@ -88,7 +92,9 @@ _mesa_dlsym(void *handle, const char *fname) void _mesa_dlclose(void *handle) { -#if defined(_GNU_SOURCE) +#if defined(__blrts) + (void) handle; +#elif defined(_GNU_SOURCE) dlclose(handle); #elif defined(__MINGW32__) FreeLibrary(handle); diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c index aef658564..5d4b53af4 100644 --- a/mesalib/src/mesa/main/drawpix.c +++ b/mesalib/src/mesa/main/drawpix.c @@ -33,8 +33,11 @@ #include "image.h" #include "readpix.h" #include "state.h" +#include "glapi/dispatch.h" +#if FEATURE_drawpix + /** * If a fragment program is enabled, check that it's valid. @@ -47,12 +50,10 @@ valid_fragment_program(GLcontext *ctx) } -#if _HAVE_FULL_GL - /* * Execute glDrawPixels */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { @@ -140,7 +141,7 @@ end: } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLenum type ) { @@ -225,11 +226,8 @@ end: _mesa_set_vp_override(ctx, GL_FALSE); } -#endif /* _HAVE_FULL_GL */ - - -void GLAPIENTRY +static void GLAPIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) @@ -309,3 +307,15 @@ _mesa_Bitmap( GLsizei width, GLsizei height, 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/drawpix.h b/mesalib/src/mesa/main/drawpix.h index 6177adad6..8ffb1a6d8 100644 --- a/mesalib/src/mesa/main/drawpix.h +++ b/mesalib/src/mesa/main/drawpix.h @@ -22,28 +22,35 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef DRAWPIX_H +#define DRAWPIX_H -#ifndef DRAWPIXELS_H -#define DRAWPIXELS_H +#include "main/mtypes.h" -#include "main/glheader.h" +#if FEATURE_drawpix -extern void GLAPIENTRY -_mesa_DrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) \ + do { \ + (driver)->DrawPixels = impl ## DrawPixels; \ + (driver)->CopyPixels = impl ## CopyPixels; \ + (driver)->Bitmap = impl ## Bitmap; \ + } while (0) +extern void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLenum type ); +#else /* FEATURE_drawpix */ +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_Bitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); +static INLINE void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_drawpix */ -#endif + +#endif /* DRAWPIX_H */ diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index 4a00440ab..12ce14c5d 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -36,8 +36,8 @@ #include "simple_list.h" #include "mtypes.h" #include "enums.h" -#include "math/m_matrix.h" #include "api_arrayelt.h" +#include "texstate.h" @@ -55,46 +55,47 @@ static void client_state(GLcontext *ctx, GLenum cap, GLboolean state) { + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; GLuint flag; GLboolean *var; switch (cap) { case GL_VERTEX_ARRAY: - var = &ctx->Array.ArrayObj->Vertex.Enabled; + var = &arrayObj->Vertex.Enabled; flag = _NEW_ARRAY_VERTEX; break; case GL_NORMAL_ARRAY: - var = &ctx->Array.ArrayObj->Normal.Enabled; + var = &arrayObj->Normal.Enabled; flag = _NEW_ARRAY_NORMAL; break; case GL_COLOR_ARRAY: - var = &ctx->Array.ArrayObj->Color.Enabled; + var = &arrayObj->Color.Enabled; flag = _NEW_ARRAY_COLOR0; break; case GL_INDEX_ARRAY: - var = &ctx->Array.ArrayObj->Index.Enabled; + var = &arrayObj->Index.Enabled; flag = _NEW_ARRAY_INDEX; break; case GL_TEXTURE_COORD_ARRAY: - var = &ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; + var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); break; case GL_EDGE_FLAG_ARRAY: - var = &ctx->Array.ArrayObj->EdgeFlag.Enabled; + var = &arrayObj->EdgeFlag.Enabled; flag = _NEW_ARRAY_EDGEFLAG; break; case GL_FOG_COORDINATE_ARRAY_EXT: - var = &ctx->Array.ArrayObj->FogCoord.Enabled; + var = &arrayObj->FogCoord.Enabled; flag = _NEW_ARRAY_FOGCOORD; break; case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &ctx->Array.ArrayObj->SecondaryColor.Enabled; + var = &arrayObj->SecondaryColor.Enabled; flag = _NEW_ARRAY_COLOR1; break; #if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_OES: - var = &ctx->Array.ArrayObj->PointSize.Enabled; + var = &arrayObj->PointSize.Enabled; flag = _NEW_ARRAY_POINT_SIZE; break; #endif @@ -120,7 +121,7 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); - var = &ctx->Array.ArrayObj->VertexAttrib[n].Enabled; + var = &arrayObj->VertexAttrib[n].Enabled; flag = _NEW_ARRAY_ATTRIB(n); } break; @@ -229,8 +230,7 @@ get_texcoord_unit(GLcontext *ctx) static GLboolean enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit) { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); const GLbitfield newenabled = state ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); @@ -942,6 +942,14 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) 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); @@ -1390,6 +1398,11 @@ _mesa_IsEnabled( GLenum cap ) 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); diff --git a/mesalib/src/mesa/main/enums.c b/mesalib/src/mesa/main/enums.c index 9f650dadd..f9f4bc785 100644 --- a/mesalib/src/mesa/main/enums.c +++ b/mesalib/src/mesa/main/enums.c @@ -384,6 +384,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DELETE_STATUS\0" "GL_DEPTH\0" "GL_DEPTH24_STENCIL8\0" + "GL_DEPTH24_STENCIL8_EXT\0" "GL_DEPTH_ATTACHMENT\0" "GL_DEPTH_ATTACHMENT_EXT\0" "GL_DEPTH_BIAS\0" @@ -391,6 +392,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DEPTH_BOUNDS_EXT\0" "GL_DEPTH_BOUNDS_TEST_EXT\0" "GL_DEPTH_BUFFER_BIT\0" + "GL_DEPTH_CLAMP\0" "GL_DEPTH_CLAMP_NV\0" "GL_DEPTH_CLEAR_VALUE\0" "GL_DEPTH_COMPONENT\0" @@ -408,6 +410,7 @@ LONGSTRING static const char enum_string_table[] = "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_TO_BGRA_NV\0" "GL_DEPTH_STENCIL_TO_RGBA_NV\0" @@ -477,6 +480,7 @@ LONGSTRING static const char enum_string_table[] = "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" @@ -518,6 +522,7 @@ LONGSTRING static const char enum_string_table[] = "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_FLAT\0" "GL_FLOAT\0" @@ -591,6 +596,7 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0" + "GL_FRAMEBUFFER_BINDING\0" "GL_FRAMEBUFFER_BINDING_EXT\0" "GL_FRAMEBUFFER_COMPLETE\0" "GL_FRAMEBUFFER_COMPLETE_EXT\0" @@ -599,12 +605,15 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER\0" "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\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_STATUS_ERROR_EXT\0" "GL_FRAMEBUFFER_UNDEFINED\0" @@ -701,6 +710,7 @@ LONGSTRING static const char enum_string_table[] = "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" @@ -889,6 +899,7 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_CLIPMAP_DEPTH_SGIX\0" "GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX\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" @@ -944,8 +955,10 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_PROJECTION_STACK_DEPTH\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_SAMPLES\0" + "GL_MAX_SAMPLES_EXT\0" "GL_MAX_SERVER_WAIT_TIMEOUT\0" "GL_MAX_SHININESS_NV\0" "GL_MAX_SPOT_EXPONENT_NV\0" @@ -1287,6 +1300,7 @@ LONGSTRING static const char enum_string_table[] = "GL_PROJECTION\0" "GL_PROJECTION_MATRIX\0" "GL_PROJECTION_STACK_DEPTH\0" + "GL_PROVOKING_VERTEX\0" "GL_PROVOKING_VERTEX_EXT\0" "GL_PROXY_COLOR_TABLE\0" "GL_PROXY_HISTOGRAM\0" @@ -1308,6 +1322,7 @@ LONGSTRING static const char enum_string_table[] = "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" @@ -1322,6 +1337,7 @@ LONGSTRING static const char enum_string_table[] = "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" @@ -1340,6 +1356,7 @@ LONGSTRING static const char enum_string_table[] = "GL_RENDER\0" "GL_RENDERBUFFER\0" "GL_RENDERBUFFER_ALPHA_SIZE\0" + "GL_RENDERBUFFER_BINDING\0" "GL_RENDERBUFFER_BINDING_EXT\0" "GL_RENDERBUFFER_BLUE_SIZE\0" "GL_RENDERBUFFER_DEPTH_SIZE\0" @@ -1351,6 +1368,7 @@ LONGSTRING static const char enum_string_table[] = "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0" "GL_RENDERBUFFER_RED_SIZE\0" "GL_RENDERBUFFER_SAMPLES\0" + "GL_RENDERBUFFER_SAMPLES_EXT\0" "GL_RENDERBUFFER_STENCIL_SIZE\0" "GL_RENDERBUFFER_WIDTH\0" "GL_RENDERBUFFER_WIDTH_EXT\0" @@ -1536,9 +1554,13 @@ LONGSTRING static const char enum_string_table[] = "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_INDEX4\0" "GL_STENCIL_INDEX4_EXT\0" + "GL_STENCIL_INDEX8\0" "GL_STENCIL_INDEX8_EXT\0" "GL_STENCIL_INDEX_EXT\0" "GL_STENCIL_PASS_DEPTH_FAIL\0" @@ -1756,6 +1778,7 @@ LONGSTRING static const char enum_string_table[] = "GL_TEXTURE_RESIDENT\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" @@ -1799,6 +1822,7 @@ LONGSTRING static const char enum_string_table[] = "GL_UNSIGNED_INT\0" "GL_UNSIGNED_INT_10_10_10_2\0" "GL_UNSIGNED_INT_24_8\0" + "GL_UNSIGNED_INT_24_8_EXT\0" "GL_UNSIGNED_INT_24_8_NV\0" "GL_UNSIGNED_INT_2_10_10_10_REV\0" "GL_UNSIGNED_INT_8_8_8_8\0" @@ -1895,7 +1919,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1857] = +static const enum_elt all_enums[1881] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2245,1595 +2269,1619 @@ static const enum_elt all_enums[1857] = { 7144, 0x00008B80 }, /* GL_DELETE_STATUS */ { 7161, 0x00001801 }, /* GL_DEPTH */ { 7170, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ - { 7190, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ - { 7210, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 7234, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 7248, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 7262, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 7282, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 7307, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 7327, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 7345, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 7366, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 7385, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 7406, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 7431, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 7457, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 7478, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 7503, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 7529, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 7550, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 7575, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 7601, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 7615, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 7630, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 7645, 0x000084F9 }, /* GL_DEPTH_STENCIL */ - { 7662, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ - { 7690, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 7710, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 7738, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 7766, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 7780, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 7802, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 7828, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 7847, 0x00001201 }, /* GL_DIFFUSE */ - { 7858, 0x00000BD0 }, /* GL_DITHER */ - { 7868, 0x00000A02 }, /* GL_DOMAIN */ - { 7878, 0x00001100 }, /* GL_DONT_CARE */ - { 7891, 0x000086AE }, /* GL_DOT3_RGB */ - { 7903, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7916, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7933, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7950, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7966, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7982, 0x0000140A }, /* GL_DOUBLE */ - { 7992, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 8008, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 8023, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 8039, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 8059, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 8079, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 8095, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 8112, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 8133, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 8154, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 8171, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 8192, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 8213, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 8230, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 8251, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 8272, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 8289, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 8310, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 8331, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 8348, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 8369, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 8390, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 8407, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 8428, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 8449, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 8469, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 8489, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 8505, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 8525, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 8545, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 8561, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 8581, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 8601, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 8617, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 8637, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 8657, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 8673, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 8693, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 8713, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 8729, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 8749, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 8769, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 8785, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 8805, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 8825, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 8841, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 8861, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8881, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8897, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8917, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8937, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ - { 8957, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8989, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 9013, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 9033, 0x00000304 }, /* GL_DST_ALPHA */ - { 9046, 0x00000306 }, /* GL_DST_COLOR */ - { 9059, 0x0000877A }, /* GL_DU8DV8_ATI */ - { 9073, 0x00008779 }, /* GL_DUDV_ATI */ - { 9085, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 9101, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 9121, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 9137, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 9157, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 9173, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 9193, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 9206, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 9225, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 9259, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 9297, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 9324, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 9350, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 9374, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 9406, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 9442, 0x00001600 }, /* GL_EMISSION */ - { 9454, 0x00002000 }, /* GL_ENABLE_BIT */ - { 9468, 0x00000202 }, /* GL_EQUAL */ - { 9477, 0x00001509 }, /* GL_EQUIV */ - { 9486, 0x00010000 }, /* GL_EVAL_BIT */ - { 9498, 0x00000800 }, /* GL_EXP */ - { 9505, 0x00000801 }, /* GL_EXP2 */ - { 9513, 0x00001F03 }, /* GL_EXTENSIONS */ - { 9527, 0x00002400 }, /* GL_EYE_LINEAR */ - { 9541, 0x00002502 }, /* GL_EYE_PLANE */ - { 9554, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 9579, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 9596, 0x00000000 }, /* GL_FALSE */ - { 9605, 0x00001101 }, /* GL_FASTEST */ - { 9616, 0x00001C01 }, /* GL_FEEDBACK */ - { 9628, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 9655, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 9679, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 9703, 0x00001B02 }, /* GL_FILL */ - { 9711, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - { 9742, 0x00001D00 }, /* GL_FLAT */ - { 9750, 0x00001406 }, /* GL_FLOAT */ - { 9759, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 9773, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 9791, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ - { 9807, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ - { 9823, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 9837, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 9855, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ - { 9871, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ - { 9887, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 9901, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 9919, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ - { 9935, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ - { 9951, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 9965, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 9983, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 9997, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 10015, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 10029, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 10047, 0x00000B60 }, /* GL_FOG */ - { 10054, 0x00000080 }, /* GL_FOG_BIT */ - { 10065, 0x00000B66 }, /* GL_FOG_COLOR */ - { 10078, 0x00008451 }, /* GL_FOG_COORD */ - { 10091, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 10109, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 10133, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 10172, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 10215, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 10247, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 10278, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 10307, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 10332, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 10351, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 10385, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 10412, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 10438, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 10462, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 10479, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 10494, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 10518, 0x00000B64 }, /* GL_FOG_END */ - { 10529, 0x00000C54 }, /* GL_FOG_HINT */ - { 10541, 0x00000B61 }, /* GL_FOG_INDEX */ - { 10554, 0x00000B65 }, /* GL_FOG_MODE */ - { 10566, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 10585, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 10610, 0x00000B63 }, /* GL_FOG_START */ - { 10623, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 10641, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 10665, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 10684, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 10707, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 10742, 0x00008D40 }, /* GL_FRAMEBUFFER */ - { 10757, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - { 10794, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - { 10830, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - { 10871, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - { 10912, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - { 10949, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - { 10986, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - { 11024, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 11066, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - { 11104, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 11146, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - { 11181, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - { 11220, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 11269, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - { 11317, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 11369, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - { 11409, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 11453, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - { 11493, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 11537, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 11564, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ - { 11588, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 11616, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ - { 11639, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 11658, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - { 11695, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 11736, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 11777, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 11819, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 11870, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 11908, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - { 11953, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 12002, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - { 12040, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 12082, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 12114, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ - { 12139, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ - { 12166, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 12197, 0x00000404 }, /* GL_FRONT */ - { 12206, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 12224, 0x00000B46 }, /* GL_FRONT_FACE */ - { 12238, 0x00000400 }, /* GL_FRONT_LEFT */ - { 12252, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 12267, 0x00008006 }, /* GL_FUNC_ADD */ - { 12279, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 12295, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 12320, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 12349, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 12366, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 12387, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 12406, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 12430, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 12459, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 12483, 0x00000206 }, /* GL_GEQUAL */ - { 12493, 0x00000204 }, /* GL_GREATER */ - { 12504, 0x00001904 }, /* GL_GREEN */ - { 12513, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 12527, 0x00000D53 }, /* GL_GREEN_BITS */ - { 12541, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12556, 0x00008000 }, /* GL_HINT_BIT */ - { 12568, 0x00008024 }, /* GL_HISTOGRAM */ - { 12581, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12605, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12633, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12656, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12683, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12700, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12720, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 12744, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 12768, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 12796, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 12824, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 12856, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 12878, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 12904, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 12922, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 12944, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 12963, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 12986, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13001, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13021, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13061, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13099, 0x00001E02 }, /* GL_INCR */ - { 13107, 0x00008507 }, /* GL_INCR_WRAP */ - { 13120, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13137, 0x00008222 }, /* GL_INDEX */ - { 13146, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13161, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13191, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13225, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13248, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13270, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13290, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13304, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13325, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13343, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13357, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13373, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13388, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13407, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13426, 0x00001404 }, /* GL_INT */ - { 13433, 0x00008049 }, /* GL_INTENSITY */ - { 13446, 0x0000804C }, /* GL_INTENSITY12 */ - { 13461, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13480, 0x0000804D }, /* GL_INTENSITY16 */ - { 13495, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13514, 0x0000804A }, /* GL_INTENSITY4 */ - { 13528, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13546, 0x0000804B }, /* GL_INTENSITY8 */ - { 13560, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13578, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13595, 0x00008575 }, /* GL_INTERPOLATE */ - { 13610, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13629, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13648, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13660, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13676, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13688, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13704, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13716, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 13732, 0x00000500 }, /* GL_INVALID_ENUM */ - { 13748, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 13781, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 13818, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 13839, 0x00000501 }, /* GL_INVALID_VALUE */ - { 13856, 0x0000862B }, /* GL_INVERSE_NV */ - { 13870, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 13894, 0x0000150A }, /* GL_INVERT */ - { 13904, 0x00001E00 }, /* GL_KEEP */ - { 13912, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ - { 13942, 0x00000406 }, /* GL_LEFT */ - { 13950, 0x00000203 }, /* GL_LEQUAL */ - { 13960, 0x00000201 }, /* GL_LESS */ - { 13968, 0x00004000 }, /* GL_LIGHT0 */ - { 13978, 0x00004001 }, /* GL_LIGHT1 */ - { 13988, 0x00004002 }, /* GL_LIGHT2 */ - { 13998, 0x00004003 }, /* GL_LIGHT3 */ - { 14008, 0x00004004 }, /* GL_LIGHT4 */ - { 14018, 0x00004005 }, /* GL_LIGHT5 */ - { 14028, 0x00004006 }, /* GL_LIGHT6 */ - { 14038, 0x00004007 }, /* GL_LIGHT7 */ - { 14048, 0x00000B50 }, /* GL_LIGHTING */ - { 14060, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14076, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14099, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14128, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14161, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14189, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14213, 0x00001B01 }, /* GL_LINE */ - { 14221, 0x00002601 }, /* GL_LINEAR */ - { 14231, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14253, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14283, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14314, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14338, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14363, 0x00000001 }, /* GL_LINES */ - { 14372, 0x00000004 }, /* GL_LINE_BIT */ - { 14384, 0x00000002 }, /* GL_LINE_LOOP */ - { 14397, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14417, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14432, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14452, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14468, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14492, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14515, 0x00000003 }, /* GL_LINE_STRIP */ - { 14529, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14543, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14557, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14583, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14603, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14618, 0x00000B32 }, /* GL_LIST_BASE */ - { 14631, 0x00020000 }, /* GL_LIST_BIT */ - { 14643, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14657, 0x00000B30 }, /* GL_LIST_MODE */ - { 14670, 0x00000101 }, /* GL_LOAD */ - { 14678, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14690, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 14707, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 14721, 0x00001909 }, /* GL_LUMINANCE */ - { 14734, 0x00008041 }, /* GL_LUMINANCE12 */ - { 14749, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 14772, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 14799, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 14821, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 14847, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 14866, 0x00008042 }, /* GL_LUMINANCE16 */ - { 14881, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 14904, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 14931, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 14950, 0x0000803F }, /* GL_LUMINANCE4 */ - { 14964, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 14985, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15010, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15028, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15049, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15074, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15088, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15109, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15134, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15152, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15171, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15187, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15207, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15229, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15243, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15258, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15282, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15306, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15330, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15354, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15371, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15388, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15416, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15445, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15474, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15503, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15532, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15561, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15590, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15618, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15646, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15674, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15702, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 15730, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 15758, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 15786, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 15814, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 15842, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 15858, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 15878, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 15900, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 15914, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 15929, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 15953, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 15977, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16001, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16025, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16042, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16059, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16087, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16116, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16145, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16174, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16203, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16232, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16261, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16289, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16317, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16345, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16373, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16401, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16429, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16457, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16485, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16513, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16526, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ - { 16552, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ - { 16581, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ - { 16609, 0x00000001 }, /* GL_MAP_READ_BIT */ - { 16625, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16640, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ - { 16666, 0x00000002 }, /* GL_MAP_WRITE_BIT */ - { 16683, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16698, 0x00008630 }, /* GL_MATRIX0_NV */ - { 16712, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 16728, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 16744, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 16760, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 16776, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 16792, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 16808, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 16824, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 16840, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 16856, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 16872, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 16887, 0x00008631 }, /* GL_MATRIX1_NV */ - { 16901, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 16917, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 16933, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 16949, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 16965, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 16981, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 16997, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 17013, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 17029, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 17045, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17061, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17076, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17090, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17106, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17122, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17137, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17151, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17166, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17180, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17195, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17209, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17224, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17238, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17253, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17267, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17282, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17297, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17323, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17357, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17388, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17421, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17452, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17467, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17489, 0x00008008 }, /* GL_MAX */ - { 17496, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17519, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17551, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17577, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17610, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17636, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17670, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17689, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 17718, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 17750, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 17786, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 17822, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 17862, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 17888, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 17918, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 17943, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 17972, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 18001, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 18034, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 18054, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18078, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18102, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18126, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18151, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18169, 0x00008008 }, /* GL_MAX_EXT */ - { 18180, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18215, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18254, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18268, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18288, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18326, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18355, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18379, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18407, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18430, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18467, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18503, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18530, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18559, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18593, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18629, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18656, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 18688, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 18724, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 18753, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 18782, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 18810, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 18848, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 18892, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 18935, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 18969, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 19008, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 19045, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19083, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19126, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19169, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19199, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19230, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19266, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19302, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19332, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19366, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19399, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19428, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19443, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - { 19470, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19490, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19514, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19536, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19562, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19589, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19620, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 19644, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 19678, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 19698, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 19725, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 19746, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 19771, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 19796, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 19831, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 19853, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19879, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 19901, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 19927, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 19961, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 19999, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 20032, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 20069, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20093, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20114, 0x00008007 }, /* GL_MIN */ - { 20121, 0x0000802E }, /* GL_MINMAX */ - { 20131, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20145, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20162, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20183, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20198, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20217, 0x00008007 }, /* GL_MIN_EXT */ - { 20228, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20247, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20270, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20293, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20313, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20333, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20363, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20391, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20419, 0x00001700 }, /* GL_MODELVIEW */ - { 20432, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20450, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20469, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20488, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20507, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20526, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20545, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20564, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20583, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20602, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20621, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 20640, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 20658, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 20677, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 20696, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 20715, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 20734, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 20753, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 20772, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 20791, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 20810, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 20829, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 20848, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 20866, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 20885, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 20904, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 20922, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 20940, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 20958, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 20976, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 20994, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 21012, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 21030, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 21050, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 21077, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21102, 0x00002100 }, /* GL_MODULATE */ - { 21114, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21134, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21161, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21186, 0x00000103 }, /* GL_MULT */ - { 21194, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21209, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21229, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21248, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21267, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21291, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21314, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21344, 0x00002A25 }, /* GL_N3F_V3F */ - { 21355, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21375, 0x0000150E }, /* GL_NAND */ - { 21383, 0x00002600 }, /* GL_NEAREST */ - { 21394, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21425, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21457, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21482, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21508, 0x00000200 }, /* GL_NEVER */ - { 21517, 0x00001102 }, /* GL_NICEST */ - { 21527, 0x00000000 }, /* GL_NONE */ - { 21535, 0x00001505 }, /* GL_NOOP */ - { 21543, 0x00001508 }, /* GL_NOR */ - { 21550, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21563, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21579, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21610, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 21645, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 21669, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 21692, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 21713, 0x00008511 }, /* GL_NORMAL_MAP */ - { 21727, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 21745, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 21762, 0x00000205 }, /* GL_NOTEQUAL */ - { 21774, 0x00000000 }, /* GL_NO_ERROR */ - { 21786, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 21820, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 21858, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 21890, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 21932, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 21962, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 22002, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 22033, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 22062, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22090, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22120, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22137, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22163, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22179, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22214, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22236, 0x00009112 }, /* GL_OBJECT_TYPE */ - { 22251, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22270, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22300, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22321, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22349, 0x00000001 }, /* GL_ONE */ - { 22356, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22384, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22416, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22444, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22476, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22499, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22522, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22545, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22568, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22586, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22608, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22630, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 22646, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 22666, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 22686, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 22704, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 22726, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 22748, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 22764, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 22784, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 22804, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 22822, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 22844, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 22866, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 22882, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 22902, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 22922, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 22943, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 22962, 0x00001507 }, /* GL_OR */ - { 22968, 0x00000A01 }, /* GL_ORDER */ - { 22977, 0x0000150D }, /* GL_OR_INVERTED */ - { 22992, 0x0000150B }, /* GL_OR_REVERSE */ - { 23006, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 23023, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 23041, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 23062, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 23082, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23100, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23119, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23139, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23159, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23177, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23196, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23221, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23245, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23266, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23288, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23310, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23335, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23359, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23380, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23402, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23424, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23446, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23477, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23497, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23522, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23542, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23567, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23587, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23612, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23632, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 23657, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 23677, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 23702, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 23722, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 23747, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 23767, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 23792, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 23812, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 23837, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 23857, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 23882, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 23902, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 23927, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 23945, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ - { 23966, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ - { 23995, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 24028, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 24053, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ - { 24076, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 24107, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 24142, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 24169, 0x00001B00 }, /* GL_POINT */ - { 24178, 0x00000000 }, /* GL_POINTS */ - { 24188, 0x00000002 }, /* GL_POINT_BIT */ - { 24201, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24231, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24265, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24299, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24334, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24363, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24396, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24429, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24463, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24477, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24503, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24521, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24543, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24565, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24588, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24606, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24628, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 24650, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 24673, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 24693, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 24709, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 24730, 0x00008861 }, /* GL_POINT_SPRITE */ - { 24746, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 24766, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 24795, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 24814, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 24840, 0x00000701 }, /* GL_POINT_TOKEN */ - { 24855, 0x00000009 }, /* GL_POLYGON */ - { 24866, 0x00000008 }, /* GL_POLYGON_BIT */ - { 24881, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 24897, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 24920, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 24945, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 24968, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 24991, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 25015, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 25039, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 25057, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 25080, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 25099, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 25122, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 25139, 0x00001203 }, /* GL_POSITION */ - { 25151, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 25183, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25219, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25252, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25289, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25320, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25355, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25387, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25423, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25456, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25488, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25524, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25557, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25594, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25624, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 25658, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 25689, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 25724, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 25755, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 25790, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 25822, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 25858, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 25888, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 25922, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 25953, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 25988, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 26020, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 26051, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 26086, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 26118, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 26154, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 26183, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26216, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26246, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26280, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26319, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26352, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26392, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26426, 0x00008578 }, /* GL_PREVIOUS */ - { 26438, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26454, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26470, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26487, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26508, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26529, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26562, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26594, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26617, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 26640, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 26670, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 26699, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 26727, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 26749, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 26777, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 26805, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 26827, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 26848, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 26888, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 26927, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 26957, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 26992, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 27025, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 27059, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 27098, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 27137, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 27159, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 27185, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27209, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27232, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27254, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27275, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27296, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27323, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27355, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27387, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27422, 0x00001701 }, /* GL_PROJECTION */ - { 27436, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27457, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27483, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ - { 27507, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27528, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27547, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27570, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27609, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 27647, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 27667, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 27697, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 27721, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 27741, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 27771, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 27795, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 27815, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 27848, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 27874, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 27904, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 27935, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 27965, 0x00002003 }, /* GL_Q */ - { 27970, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 27995, 0x00000007 }, /* GL_QUADS */ - { 28004, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - { 28052, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 28069, 0x00000008 }, /* GL_QUAD_STRIP */ - { 28083, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 28105, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 28131, 0x00008866 }, /* GL_QUERY_RESULT */ - { 28147, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 28167, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 28193, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 28223, 0x00002002 }, /* GL_R */ - { 28228, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 28240, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 28273, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28288, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28308, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28340, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28364, 0x000088B8 }, /* GL_READ_ONLY */ - { 28377, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28394, 0x000088BA }, /* GL_READ_WRITE */ - { 28408, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28426, 0x00001903 }, /* GL_RED */ - { 28433, 0x00008016 }, /* GL_REDUCE */ - { 28443, 0x00008016 }, /* GL_REDUCE_EXT */ - { 28457, 0x00000D15 }, /* GL_RED_BIAS */ - { 28469, 0x00000D52 }, /* GL_RED_BITS */ - { 28481, 0x00000D14 }, /* GL_RED_SCALE */ - { 28494, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 28512, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 28534, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 28555, 0x00001C00 }, /* GL_RENDER */ - { 28565, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 28581, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 28608, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 28636, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 28662, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 28689, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 28709, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 28736, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 28759, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 28786, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 28818, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 28854, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 28879, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 28903, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 28932, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 28954, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 28980, 0x00001F01 }, /* GL_RENDERER */ - { 28992, 0x00000C40 }, /* GL_RENDER_MODE */ - { 29007, 0x00002901 }, /* GL_REPEAT */ - { 29017, 0x00001E01 }, /* GL_REPLACE */ - { 29028, 0x00008062 }, /* GL_REPLACE_EXT */ - { 29043, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 29066, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 29084, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 29106, 0x00000102 }, /* GL_RETURN */ - { 29116, 0x00001907 }, /* GL_RGB */ - { 29123, 0x00008052 }, /* GL_RGB10 */ - { 29132, 0x00008059 }, /* GL_RGB10_A2 */ - { 29144, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 29160, 0x00008052 }, /* GL_RGB10_EXT */ - { 29173, 0x00008053 }, /* GL_RGB12 */ - { 29182, 0x00008053 }, /* GL_RGB12_EXT */ - { 29195, 0x00008054 }, /* GL_RGB16 */ - { 29204, 0x00008054 }, /* GL_RGB16_EXT */ - { 29217, 0x0000804E }, /* GL_RGB2_EXT */ - { 29229, 0x0000804F }, /* GL_RGB4 */ - { 29237, 0x0000804F }, /* GL_RGB4_EXT */ - { 29249, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 29262, 0x00008050 }, /* GL_RGB5 */ - { 29270, 0x00008057 }, /* GL_RGB5_A1 */ - { 29281, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29296, 0x00008050 }, /* GL_RGB5_EXT */ - { 29308, 0x00008051 }, /* GL_RGB8 */ - { 29316, 0x00008051 }, /* GL_RGB8_EXT */ - { 29328, 0x00001908 }, /* GL_RGBA */ - { 29336, 0x0000805A }, /* GL_RGBA12 */ - { 29346, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29360, 0x0000805B }, /* GL_RGBA16 */ - { 29370, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29384, 0x00008055 }, /* GL_RGBA2 */ - { 29393, 0x00008055 }, /* GL_RGBA2_EXT */ - { 29406, 0x00008056 }, /* GL_RGBA4 */ - { 29415, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 29434, 0x00008056 }, /* GL_RGBA4_EXT */ - { 29447, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 29461, 0x00008058 }, /* GL_RGBA8 */ - { 29470, 0x00008058 }, /* GL_RGBA8_EXT */ - { 29483, 0x00008F97 }, /* GL_RGBA8_SNORM */ - { 29498, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 29516, 0x00000C31 }, /* GL_RGBA_MODE */ - { 29529, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 29542, 0x00008F93 }, /* GL_RGBA_SNORM */ - { 29556, 0x000083A0 }, /* GL_RGB_S3TC */ - { 29568, 0x00008573 }, /* GL_RGB_SCALE */ - { 29581, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 29598, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 29615, 0x00000407 }, /* GL_RIGHT */ - { 29624, 0x00002000 }, /* GL_S */ - { 29629, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 29643, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 29664, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 29678, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 29699, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 29713, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 29729, 0x000080A9 }, /* GL_SAMPLES */ - { 29740, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 29756, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 29771, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 29789, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 29811, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 29839, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 29871, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 29894, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 29921, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 29939, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 29962, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 29984, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 30003, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 30026, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 30052, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 30082, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 30107, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 30136, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 30151, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 30166, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 30182, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 30207, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 30247, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 30291, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30324, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30354, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30386, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 30416, 0x00001C02 }, /* GL_SELECT */ - { 30426, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 30454, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 30479, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 30495, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 30522, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 30553, 0x0000150F }, /* GL_SET */ - { 30560, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 30581, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 30605, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 30620, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 30635, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 30663, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 30686, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 30716, 0x00001601 }, /* GL_SHININESS */ - { 30729, 0x00001402 }, /* GL_SHORT */ - { 30738, 0x00009119 }, /* GL_SIGNALED */ - { 30750, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ - { 30771, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 30787, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 30807, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 30826, 0x00008C46 }, /* GL_SLUMINANCE */ - { 30840, 0x00008C47 }, /* GL_SLUMINANCE8 */ - { 30855, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ - { 30877, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ - { 30897, 0x00001D01 }, /* GL_SMOOTH */ - { 30907, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 30940, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 30967, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 31000, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 31027, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 31044, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 31065, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 31086, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 31101, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 31120, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 31139, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 31156, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 31177, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 31198, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 31213, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 31232, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 31251, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 31268, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 31289, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 31310, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 31325, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 31344, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 31363, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 31383, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 31401, 0x00001202 }, /* GL_SPECULAR */ - { 31413, 0x00002402 }, /* GL_SPHERE_MAP */ - { 31427, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 31442, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 31460, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 31477, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 31491, 0x00008580 }, /* GL_SRC0_RGB */ - { 31503, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 31517, 0x00008581 }, /* GL_SRC1_RGB */ - { 31529, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 31543, 0x00008582 }, /* GL_SRC2_RGB */ - { 31555, 0x00000302 }, /* GL_SRC_ALPHA */ - { 31568, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 31590, 0x00000300 }, /* GL_SRC_COLOR */ - { 31603, 0x00008C40 }, /* GL_SRGB */ - { 31611, 0x00008C41 }, /* GL_SRGB8 */ - { 31620, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ - { 31636, 0x00008C42 }, /* GL_SRGB_ALPHA */ - { 31650, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 31668, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 31687, 0x000088E6 }, /* GL_STATIC_COPY */ - { 31702, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 31721, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 31736, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 31755, 0x000088E5 }, /* GL_STATIC_READ */ - { 31770, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 31789, 0x00001802 }, /* GL_STENCIL */ - { 31800, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 31822, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 31848, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 31869, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 31894, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 31915, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 31940, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 31972, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 32008, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 32040, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 32076, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 32096, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 32123, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 32149, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 32165, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 32187, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 32210, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 32226, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 32242, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 32259, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 32282, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 32304, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 32326, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 32348, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 32369, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 32396, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 32423, 0x00000B97 }, /* GL_STENCIL_REF */ - { 32438, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 32454, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 32483, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 32505, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 32526, 0x00000C33 }, /* GL_STEREO */ - { 32536, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ - { 32560, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ - { 32585, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ - { 32609, 0x000088E2 }, /* GL_STREAM_COPY */ - { 32624, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 32643, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 32658, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 32677, 0x000088E1 }, /* GL_STREAM_READ */ - { 32692, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 32711, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 32728, 0x000084E7 }, /* GL_SUBTRACT */ - { 32740, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 32756, 0x00009113 }, /* GL_SYNC_CONDITION */ - { 32774, 0x00009116 }, /* GL_SYNC_FENCE */ - { 32788, 0x00009115 }, /* GL_SYNC_FLAGS */ - { 32802, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ - { 32829, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - { 32859, 0x00009114 }, /* GL_SYNC_STATUS */ - { 32874, 0x00002001 }, /* GL_T */ - { 32879, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 32894, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 32913, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 32929, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 32944, 0x00002A27 }, /* GL_T2F_V3F */ - { 32955, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 32974, 0x00002A28 }, /* GL_T4F_V4F */ - { 32985, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 33008, 0x00001702 }, /* GL_TEXTURE */ - { 33019, 0x000084C0 }, /* GL_TEXTURE0 */ - { 33031, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 33047, 0x000084C1 }, /* GL_TEXTURE1 */ - { 33059, 0x000084CA }, /* GL_TEXTURE10 */ - { 33072, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 33089, 0x000084CB }, /* GL_TEXTURE11 */ - { 33102, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 33119, 0x000084CC }, /* GL_TEXTURE12 */ - { 33132, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 33149, 0x000084CD }, /* GL_TEXTURE13 */ - { 33162, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 33179, 0x000084CE }, /* GL_TEXTURE14 */ - { 33192, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 33209, 0x000084CF }, /* GL_TEXTURE15 */ - { 33222, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 33239, 0x000084D0 }, /* GL_TEXTURE16 */ - { 33252, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 33269, 0x000084D1 }, /* GL_TEXTURE17 */ - { 33282, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 33299, 0x000084D2 }, /* GL_TEXTURE18 */ - { 33312, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 33329, 0x000084D3 }, /* GL_TEXTURE19 */ - { 33342, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 33359, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 33375, 0x000084C2 }, /* GL_TEXTURE2 */ - { 33387, 0x000084D4 }, /* GL_TEXTURE20 */ - { 33400, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 33417, 0x000084D5 }, /* GL_TEXTURE21 */ - { 33430, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 33447, 0x000084D6 }, /* GL_TEXTURE22 */ - { 33460, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 33477, 0x000084D7 }, /* GL_TEXTURE23 */ - { 33490, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 33507, 0x000084D8 }, /* GL_TEXTURE24 */ - { 33520, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 33537, 0x000084D9 }, /* GL_TEXTURE25 */ - { 33550, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 33567, 0x000084DA }, /* GL_TEXTURE26 */ - { 33580, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 33597, 0x000084DB }, /* GL_TEXTURE27 */ - { 33610, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 33627, 0x000084DC }, /* GL_TEXTURE28 */ - { 33640, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 33657, 0x000084DD }, /* GL_TEXTURE29 */ - { 33670, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 33687, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 33703, 0x000084C3 }, /* GL_TEXTURE3 */ - { 33715, 0x000084DE }, /* GL_TEXTURE30 */ - { 33728, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 33745, 0x000084DF }, /* GL_TEXTURE31 */ - { 33758, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 33775, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 33791, 0x000084C4 }, /* GL_TEXTURE4 */ - { 33803, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 33819, 0x000084C5 }, /* GL_TEXTURE5 */ - { 33831, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 33847, 0x000084C6 }, /* GL_TEXTURE6 */ - { 33859, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 33875, 0x000084C7 }, /* GL_TEXTURE7 */ - { 33887, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 33903, 0x000084C8 }, /* GL_TEXTURE8 */ - { 33915, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 33931, 0x000084C9 }, /* GL_TEXTURE9 */ - { 33943, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 33959, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 33973, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 33997, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 34011, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 34035, 0x0000806F }, /* GL_TEXTURE_3D */ - { 34049, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 34071, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 34097, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 34119, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 34141, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 34173, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 34195, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 34227, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 34249, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 34277, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 34309, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 34342, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 34374, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 34389, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 34410, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 34435, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 34453, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 34477, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 34508, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 34538, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 34568, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 34603, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 34634, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 34672, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 34699, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 34731, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 34765, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 34789, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 34817, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 34841, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 34869, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 34902, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 34926, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 34948, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 34970, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 34996, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 35030, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 35063, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 35100, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 35128, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 35160, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 35183, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 35221, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 35263, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 35294, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 35322, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 35352, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 35380, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 35400, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 35424, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 35455, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 35490, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 35521, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 35556, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 35587, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 35622, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 35653, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 35688, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 35719, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 35754, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 35785, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 35820, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - { 35849, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 35866, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 35888, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 35914, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 35929, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 35950, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 35970, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 35996, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 36016, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 36033, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 36050, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 36067, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 36084, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 36109, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 36131, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 36157, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 36175, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 36201, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 36227, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 36257, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 36284, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 36309, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 36329, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 36353, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 36380, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 36407, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 36434, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 36460, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 36490, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 36512, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 36530, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 36560, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 36588, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 36616, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 36644, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 36665, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 36684, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 36706, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 36725, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 36745, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - { 36775, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - { 36806, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 36831, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 36855, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 36875, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 36899, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 36919, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 36942, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 36966, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - { 36996, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 37021, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 37055, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 37072, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 37090, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 37108, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 37126, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ - { 37145, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ - { 37164, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 37184, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 37203, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 37232, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 37249, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 37275, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 37305, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 37337, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 37367, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 37401, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 37417, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 37448, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 37483, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 37511, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 37543, 0x00000004 }, /* GL_TRIANGLES */ - { 37556, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 37572, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 37593, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 37611, 0x00000001 }, /* GL_TRUE */ - { 37619, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 37639, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 37662, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 37682, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 37703, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 37725, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 37747, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 37767, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 37788, 0x00009118 }, /* GL_UNSIGNALED */ - { 37802, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 37819, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 37846, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 37869, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 37885, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 37912, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 37933, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 37957, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 37988, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 38012, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 38040, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 38063, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 38081, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 38111, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 38137, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 38167, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 38193, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 38217, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 38245, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 38273, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 38300, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 38332, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 38363, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 38377, 0x00002A20 }, /* GL_V2F */ - { 38384, 0x00002A21 }, /* GL_V3F */ - { 38391, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 38410, 0x00001F00 }, /* GL_VENDOR */ - { 38420, 0x00001F02 }, /* GL_VERSION */ - { 38431, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 38447, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ - { 38471, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 38501, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 38532, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 38567, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 38591, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 38612, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 38635, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 38656, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 38683, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 38711, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 38739, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 38767, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 38795, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 38823, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 38851, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 38878, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 38905, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 38932, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 38959, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 38986, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 39013, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 39040, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 39067, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 39094, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 39132, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 39174, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 39205, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 39240, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 39274, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 39312, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 39343, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 39378, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 39406, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 39438, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 39468, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 39502, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 39530, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 39562, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 39582, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 39604, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 39633, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 39654, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 39683, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 39716, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 39748, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 39775, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 39806, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 39836, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 39853, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 39874, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 39901, 0x00000BA2 }, /* GL_VIEWPORT */ - { 39913, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 39929, 0x0000911D }, /* GL_WAIT_FAILED */ - { 39944, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 39964, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 39995, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 40030, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 40058, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 40083, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 40110, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 40135, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 40159, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 40178, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 40192, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 40210, 0x00001506 }, /* GL_XOR */ - { 40217, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 40236, 0x00008757 }, /* GL_YCBCR_MESA */ - { 40250, 0x00000000 }, /* GL_ZERO */ - { 40258, 0x00000D16 }, /* GL_ZOOM_X */ - { 40268, 0x00000D17 }, /* GL_ZOOM_Y */ + { 7190, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_EXT */ + { 7214, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ + { 7234, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 7258, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 7272, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 7286, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 7306, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 7331, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 7351, 0x0000864F }, /* GL_DEPTH_CLAMP */ + { 7366, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 7384, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 7405, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 7424, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 7445, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 7470, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7496, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7517, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7542, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7568, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7589, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7614, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7640, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7654, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7669, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7684, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7701, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7729, 0x000084F9 }, /* GL_DEPTH_STENCIL_EXT */ + { 7750, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7770, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7798, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7826, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7840, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7862, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7888, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7907, 0x00001201 }, /* GL_DIFFUSE */ + { 7918, 0x00000BD0 }, /* GL_DITHER */ + { 7928, 0x00000A02 }, /* GL_DOMAIN */ + { 7938, 0x00001100 }, /* GL_DONT_CARE */ + { 7951, 0x000086AE }, /* GL_DOT3_RGB */ + { 7963, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7976, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7993, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 8010, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 8026, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 8042, 0x0000140A }, /* GL_DOUBLE */ + { 8052, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 8068, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 8083, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 8099, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 8119, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 8139, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 8155, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 8172, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 8193, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 8214, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 8231, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 8252, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 8273, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 8290, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 8311, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 8332, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 8349, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 8370, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 8391, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 8408, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 8429, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 8450, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 8467, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 8488, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8509, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8529, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8549, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8565, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8585, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8605, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8621, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8641, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8661, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8677, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8697, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8717, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8733, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8753, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8773, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8789, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8809, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8829, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8845, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8865, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8885, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8901, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8921, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8941, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8957, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8977, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8997, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 9017, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */ + { 9045, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 9077, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 9101, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 9121, 0x00000304 }, /* GL_DST_ALPHA */ + { 9134, 0x00000306 }, /* GL_DST_COLOR */ + { 9147, 0x0000877A }, /* GL_DU8DV8_ATI */ + { 9161, 0x00008779 }, /* GL_DUDV_ATI */ + { 9173, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 9189, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 9209, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 9225, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 9245, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 9261, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 9281, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 9294, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 9313, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 9347, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 9385, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 9412, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 9438, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 9462, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 9494, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 9530, 0x00001600 }, /* GL_EMISSION */ + { 9542, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9556, 0x00000202 }, /* GL_EQUAL */ + { 9565, 0x00001509 }, /* GL_EQUIV */ + { 9574, 0x00010000 }, /* GL_EVAL_BIT */ + { 9586, 0x00000800 }, /* GL_EXP */ + { 9593, 0x00000801 }, /* GL_EXP2 */ + { 9601, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9615, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9629, 0x00002502 }, /* GL_EYE_PLANE */ + { 9642, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9667, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9684, 0x00000000 }, /* GL_FALSE */ + { 9693, 0x00001101 }, /* GL_FASTEST */ + { 9704, 0x00001C01 }, /* GL_FEEDBACK */ + { 9716, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9743, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9767, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9791, 0x00001B02 }, /* GL_FILL */ + { 9799, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ + { 9826, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ + { 9857, 0x00001D00 }, /* GL_FLAT */ + { 9865, 0x00001406 }, /* GL_FLOAT */ + { 9874, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9888, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9906, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ + { 9922, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ + { 9938, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9952, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9970, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ + { 9986, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ + { 10002, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 10016, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 10034, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ + { 10050, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ + { 10066, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 10080, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 10098, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 10112, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 10130, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 10144, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 10162, 0x00000B60 }, /* GL_FOG */ + { 10169, 0x00000080 }, /* GL_FOG_BIT */ + { 10180, 0x00000B66 }, /* GL_FOG_COLOR */ + { 10193, 0x00008451 }, /* GL_FOG_COORD */ + { 10206, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 10224, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 10248, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 10287, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 10330, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 10362, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 10393, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 10422, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 10447, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 10466, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 10500, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 10527, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 10553, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 10577, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 10594, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 10609, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 10633, 0x00000B64 }, /* GL_FOG_END */ + { 10644, 0x00000C54 }, /* GL_FOG_HINT */ + { 10656, 0x00000B61 }, /* GL_FOG_INDEX */ + { 10669, 0x00000B65 }, /* GL_FOG_MODE */ + { 10681, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 10700, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10725, 0x00000B63 }, /* GL_FOG_START */ + { 10738, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10756, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10780, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10799, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10822, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10857, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10872, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10909, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10945, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10986, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 11027, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 11064, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 11101, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 11139, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 11181, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 11219, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 11261, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 11296, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 11335, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 11384, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 11432, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 11484, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 11524, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 11568, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 11608, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 11652, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */ + { 11675, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 11702, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 11726, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11754, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11777, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11796, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11833, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11874, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11915, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ + { 11953, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11995, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 12046, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 12084, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 12129, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 12178, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 12216, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */ + { 12258, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ + { 12296, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 12338, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 12370, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 12395, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 12422, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 12453, 0x00000404 }, /* GL_FRONT */ + { 12462, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 12480, 0x00000B46 }, /* GL_FRONT_FACE */ + { 12494, 0x00000400 }, /* GL_FRONT_LEFT */ + { 12508, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 12523, 0x00008006 }, /* GL_FUNC_ADD */ + { 12535, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 12551, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 12576, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 12605, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 12622, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 12643, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 12662, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 12686, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 12715, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 12739, 0x00000206 }, /* GL_GEQUAL */ + { 12749, 0x00000204 }, /* GL_GREATER */ + { 12760, 0x00001904 }, /* GL_GREEN */ + { 12769, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12783, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12797, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12812, 0x00008000 }, /* GL_HINT_BIT */ + { 12824, 0x00008024 }, /* GL_HISTOGRAM */ + { 12837, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12861, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12889, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12912, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12939, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12956, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12976, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 13000, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 13024, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 13052, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 13080, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 13112, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 13134, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 13160, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 13178, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 13200, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 13219, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 13242, 0x0000862A }, /* GL_IDENTITY_NV */ + { 13257, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 13277, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13317, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13355, 0x00001E02 }, /* GL_INCR */ + { 13363, 0x00008507 }, /* GL_INCR_WRAP */ + { 13376, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13393, 0x00008222 }, /* GL_INDEX */ + { 13402, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13417, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13447, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13481, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13504, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13526, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13546, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13560, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13581, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13599, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13613, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13629, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13644, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13663, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13682, 0x00001404 }, /* GL_INT */ + { 13689, 0x00008049 }, /* GL_INTENSITY */ + { 13702, 0x0000804C }, /* GL_INTENSITY12 */ + { 13717, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13736, 0x0000804D }, /* GL_INTENSITY16 */ + { 13751, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13770, 0x0000804A }, /* GL_INTENSITY4 */ + { 13784, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13802, 0x0000804B }, /* GL_INTENSITY8 */ + { 13816, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13834, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13851, 0x00008575 }, /* GL_INTERPOLATE */ + { 13866, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13885, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13904, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13916, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13932, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13944, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13960, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13972, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13988, 0x00000500 }, /* GL_INVALID_ENUM */ + { 14004, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 14037, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 14074, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 14095, 0x00000501 }, /* GL_INVALID_VALUE */ + { 14112, 0x0000862B }, /* GL_INVERSE_NV */ + { 14126, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 14150, 0x0000150A }, /* GL_INVERT */ + { 14160, 0x00001E00 }, /* GL_KEEP */ + { 14168, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ + { 14194, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ + { 14224, 0x00000406 }, /* GL_LEFT */ + { 14232, 0x00000203 }, /* GL_LEQUAL */ + { 14242, 0x00000201 }, /* GL_LESS */ + { 14250, 0x00004000 }, /* GL_LIGHT0 */ + { 14260, 0x00004001 }, /* GL_LIGHT1 */ + { 14270, 0x00004002 }, /* GL_LIGHT2 */ + { 14280, 0x00004003 }, /* GL_LIGHT3 */ + { 14290, 0x00004004 }, /* GL_LIGHT4 */ + { 14300, 0x00004005 }, /* GL_LIGHT5 */ + { 14310, 0x00004006 }, /* GL_LIGHT6 */ + { 14320, 0x00004007 }, /* GL_LIGHT7 */ + { 14330, 0x00000B50 }, /* GL_LIGHTING */ + { 14342, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 14358, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14381, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14410, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14443, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14471, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14495, 0x00001B01 }, /* GL_LINE */ + { 14503, 0x00002601 }, /* GL_LINEAR */ + { 14513, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14535, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14565, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14596, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14620, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14645, 0x00000001 }, /* GL_LINES */ + { 14654, 0x00000004 }, /* GL_LINE_BIT */ + { 14666, 0x00000002 }, /* GL_LINE_LOOP */ + { 14679, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14699, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14714, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14734, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14750, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14774, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14797, 0x00000003 }, /* GL_LINE_STRIP */ + { 14811, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14825, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14839, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14865, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14885, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14900, 0x00000B32 }, /* GL_LIST_BASE */ + { 14913, 0x00020000 }, /* GL_LIST_BIT */ + { 14925, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14939, 0x00000B30 }, /* GL_LIST_MODE */ + { 14952, 0x00000101 }, /* GL_LOAD */ + { 14960, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14972, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14989, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 15003, 0x00001909 }, /* GL_LUMINANCE */ + { 15016, 0x00008041 }, /* GL_LUMINANCE12 */ + { 15031, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 15054, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 15081, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 15103, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 15129, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 15148, 0x00008042 }, /* GL_LUMINANCE16 */ + { 15163, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 15186, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 15213, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 15232, 0x0000803F }, /* GL_LUMINANCE4 */ + { 15246, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 15267, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 15292, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 15310, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 15331, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 15356, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15370, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15391, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15416, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15434, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15453, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15469, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15489, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15511, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15525, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15540, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15564, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15588, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15612, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15636, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15653, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15670, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15698, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15727, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15756, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15785, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15814, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15843, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15872, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15900, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15928, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15956, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15984, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 16012, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 16040, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 16068, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 16096, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 16124, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 16140, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 16160, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 16182, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 16196, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 16211, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 16235, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 16259, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 16283, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 16307, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 16324, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 16341, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16369, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16398, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16427, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16456, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16485, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16514, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16543, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16571, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16599, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16627, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16655, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16683, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16711, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16739, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16767, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16795, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16808, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ + { 16834, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ + { 16863, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ + { 16891, 0x00000001 }, /* GL_MAP_READ_BIT */ + { 16907, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16922, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ + { 16948, 0x00000002 }, /* GL_MAP_WRITE_BIT */ + { 16965, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16980, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16994, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 17010, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 17026, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 17042, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 17058, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 17074, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 17090, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 17106, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 17122, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 17138, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 17154, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 17169, 0x00008631 }, /* GL_MATRIX1_NV */ + { 17183, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 17199, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 17215, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 17231, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 17247, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 17263, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 17279, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 17295, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 17311, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 17327, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 17343, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 17358, 0x00008632 }, /* GL_MATRIX2_NV */ + { 17372, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 17388, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 17404, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 17419, 0x00008633 }, /* GL_MATRIX3_NV */ + { 17433, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 17448, 0x00008634 }, /* GL_MATRIX4_NV */ + { 17462, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 17477, 0x00008635 }, /* GL_MATRIX5_NV */ + { 17491, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17506, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17520, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17535, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17549, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17564, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17579, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17605, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17639, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17670, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17703, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17734, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17749, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17771, 0x00008008 }, /* GL_MAX */ + { 17778, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17801, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17833, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17859, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17892, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17918, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17952, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17971, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */ + { 17996, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 18025, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 18057, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 18093, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 18129, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 18169, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 18195, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 18225, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 18250, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 18279, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 18308, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 18341, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 18361, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 18385, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 18409, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 18433, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 18458, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 18476, 0x00008008 }, /* GL_MAX_EXT */ + { 18487, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 18522, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18561, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18575, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18595, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18633, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18662, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18686, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18714, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18737, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18774, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18810, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18837, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18866, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18900, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18936, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18963, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18995, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 19031, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 19060, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 19089, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 19117, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 19155, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 19199, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 19242, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 19276, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 19315, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 19352, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 19390, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 19433, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 19476, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 19506, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19537, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19573, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19609, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19639, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19673, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19706, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */ + { 19731, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19760, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19775, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */ + { 19794, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + { 19821, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19841, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19865, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19887, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19913, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19940, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19971, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19995, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 20029, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 20049, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 20076, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 20097, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 20122, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 20147, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 20182, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 20204, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 20230, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 20252, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 20278, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 20312, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 20350, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 20383, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 20420, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 20444, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 20465, 0x00008007 }, /* GL_MIN */ + { 20472, 0x0000802E }, /* GL_MINMAX */ + { 20482, 0x0000802E }, /* GL_MINMAX_EXT */ + { 20496, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 20513, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 20534, 0x00008030 }, /* GL_MINMAX_SINK */ + { 20549, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 20568, 0x00008007 }, /* GL_MIN_EXT */ + { 20579, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 20598, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20621, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20644, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20664, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20684, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20714, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20742, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20770, 0x00001700 }, /* GL_MODELVIEW */ + { 20783, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20801, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20820, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20839, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20858, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20877, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20896, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20915, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20934, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20953, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20972, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20991, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 21009, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 21028, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 21047, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 21066, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 21085, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 21104, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 21123, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 21142, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 21161, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 21180, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 21199, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 21217, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 21236, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 21255, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 21273, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 21291, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 21309, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 21327, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 21345, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 21363, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 21381, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 21401, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 21428, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 21453, 0x00002100 }, /* GL_MODULATE */ + { 21465, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 21485, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 21512, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 21537, 0x00000103 }, /* GL_MULT */ + { 21545, 0x0000809D }, /* GL_MULTISAMPLE */ + { 21560, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 21580, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21599, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21618, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21642, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21665, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21695, 0x00002A25 }, /* GL_N3F_V3F */ + { 21706, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21726, 0x0000150E }, /* GL_NAND */ + { 21734, 0x00002600 }, /* GL_NEAREST */ + { 21745, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21776, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21808, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21833, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21859, 0x00000200 }, /* GL_NEVER */ + { 21868, 0x00001102 }, /* GL_NICEST */ + { 21878, 0x00000000 }, /* GL_NONE */ + { 21886, 0x00001505 }, /* GL_NOOP */ + { 21894, 0x00001508 }, /* GL_NOR */ + { 21901, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21914, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21930, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21961, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21996, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 22020, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 22043, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 22064, 0x00008511 }, /* GL_NORMAL_MAP */ + { 22078, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 22096, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 22113, 0x00000205 }, /* GL_NOTEQUAL */ + { 22125, 0x00000000 }, /* GL_NO_ERROR */ + { 22137, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 22171, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 22209, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 22241, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 22283, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 22313, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 22353, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 22384, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 22413, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 22441, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 22471, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 22488, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 22514, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 22530, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 22565, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 22587, 0x00009112 }, /* GL_OBJECT_TYPE */ + { 22602, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22621, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22651, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22672, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22700, 0x00000001 }, /* GL_ONE */ + { 22707, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22735, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22767, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22795, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22827, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22850, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22873, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22896, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22919, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22937, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22959, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22981, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22997, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 23017, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 23037, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 23055, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 23077, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 23099, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 23115, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 23135, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 23155, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 23173, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 23195, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 23217, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 23233, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 23253, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 23273, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 23294, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 23313, 0x00001507 }, /* GL_OR */ + { 23319, 0x00000A01 }, /* GL_ORDER */ + { 23328, 0x0000150D }, /* GL_OR_INVERTED */ + { 23343, 0x0000150B }, /* GL_OR_REVERSE */ + { 23357, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 23374, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 23392, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 23413, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 23433, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 23451, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 23470, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 23490, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 23510, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 23528, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 23547, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 23572, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 23596, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23617, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23639, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23661, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23686, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23710, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23731, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23753, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23775, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23797, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23828, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23848, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23873, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23893, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23918, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23938, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23963, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23983, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 24008, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 24028, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 24053, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 24073, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 24098, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 24118, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 24143, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 24163, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 24188, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 24208, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 24233, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 24253, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 24278, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 24296, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 24317, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 24346, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 24379, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 24404, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 24427, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 24458, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 24493, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 24520, 0x00001B00 }, /* GL_POINT */ + { 24529, 0x00000000 }, /* GL_POINTS */ + { 24539, 0x00000002 }, /* GL_POINT_BIT */ + { 24552, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 24582, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 24616, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 24650, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 24685, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 24714, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24747, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24780, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24814, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24828, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24854, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24872, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24894, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24916, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24939, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24957, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24979, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 25001, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 25024, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 25044, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 25060, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 25081, 0x00008861 }, /* GL_POINT_SPRITE */ + { 25097, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 25117, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 25146, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 25165, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 25191, 0x00000701 }, /* GL_POINT_TOKEN */ + { 25206, 0x00000009 }, /* GL_POLYGON */ + { 25217, 0x00000008 }, /* GL_POLYGON_BIT */ + { 25232, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 25248, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 25271, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 25296, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 25319, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 25342, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 25366, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 25390, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 25408, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 25431, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 25450, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 25473, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 25490, 0x00001203 }, /* GL_POSITION */ + { 25502, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 25534, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 25570, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 25603, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 25640, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 25671, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 25706, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25738, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25774, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25807, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25839, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25875, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25908, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25945, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25975, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 26009, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 26040, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 26075, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 26106, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 26141, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 26173, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 26209, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 26239, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 26273, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 26304, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 26339, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 26371, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 26402, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 26437, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 26469, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 26505, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 26534, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 26567, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 26597, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 26631, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 26670, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 26703, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26743, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26777, 0x00008578 }, /* GL_PREVIOUS */ + { 26789, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26805, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26821, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26838, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26859, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26880, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26913, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26945, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26968, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26991, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 27021, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 27050, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 27078, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 27100, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 27128, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 27156, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 27178, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 27199, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 27239, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 27278, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 27308, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 27343, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 27376, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 27410, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 27449, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 27488, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 27510, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 27536, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 27560, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 27583, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 27605, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 27626, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 27647, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 27674, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 27706, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27738, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27773, 0x00001701 }, /* GL_PROJECTION */ + { 27787, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27808, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27834, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ + { 27854, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ + { 27878, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27899, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27918, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27941, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27980, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 28018, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 28038, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 28068, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 28092, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 28112, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 28142, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 28166, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 28186, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 28219, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 28245, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 28275, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 28306, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 28336, 0x00002003 }, /* GL_Q */ + { 28341, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 28366, 0x00000007 }, /* GL_QUADS */ + { 28375, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + { 28419, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ + { 28467, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 28484, 0x00000008 }, /* GL_QUAD_STRIP */ + { 28498, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 28520, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 28546, 0x00008866 }, /* GL_QUERY_RESULT */ + { 28562, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 28582, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 28608, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 28638, 0x00002002 }, /* GL_R */ + { 28643, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 28655, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 28688, 0x00000C02 }, /* GL_READ_BUFFER */ + { 28703, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 28723, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */ + { 28751, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 28783, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 28807, 0x000088B8 }, /* GL_READ_ONLY */ + { 28820, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 28837, 0x000088BA }, /* GL_READ_WRITE */ + { 28851, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 28869, 0x00001903 }, /* GL_RED */ + { 28876, 0x00008016 }, /* GL_REDUCE */ + { 28886, 0x00008016 }, /* GL_REDUCE_EXT */ + { 28900, 0x00000D15 }, /* GL_RED_BIAS */ + { 28912, 0x00000D52 }, /* GL_RED_BITS */ + { 28924, 0x00000D14 }, /* GL_RED_SCALE */ + { 28937, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28955, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28977, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28998, 0x00001C00 }, /* GL_RENDER */ + { 29008, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 29024, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 29051, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */ + { 29075, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 29103, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 29129, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 29156, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 29176, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 29203, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 29226, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 29253, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 29285, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 29321, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 29346, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 29370, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */ + { 29398, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 29427, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 29449, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 29475, 0x00001F01 }, /* GL_RENDERER */ + { 29487, 0x00000C40 }, /* GL_RENDER_MODE */ + { 29502, 0x00002901 }, /* GL_REPEAT */ + { 29512, 0x00001E01 }, /* GL_REPLACE */ + { 29523, 0x00008062 }, /* GL_REPLACE_EXT */ + { 29538, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 29561, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 29579, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 29601, 0x00000102 }, /* GL_RETURN */ + { 29611, 0x00001907 }, /* GL_RGB */ + { 29618, 0x00008052 }, /* GL_RGB10 */ + { 29627, 0x00008059 }, /* GL_RGB10_A2 */ + { 29639, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 29655, 0x00008052 }, /* GL_RGB10_EXT */ + { 29668, 0x00008053 }, /* GL_RGB12 */ + { 29677, 0x00008053 }, /* GL_RGB12_EXT */ + { 29690, 0x00008054 }, /* GL_RGB16 */ + { 29699, 0x00008054 }, /* GL_RGB16_EXT */ + { 29712, 0x0000804E }, /* GL_RGB2_EXT */ + { 29724, 0x0000804F }, /* GL_RGB4 */ + { 29732, 0x0000804F }, /* GL_RGB4_EXT */ + { 29744, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 29757, 0x00008050 }, /* GL_RGB5 */ + { 29765, 0x00008057 }, /* GL_RGB5_A1 */ + { 29776, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 29791, 0x00008050 }, /* GL_RGB5_EXT */ + { 29803, 0x00008051 }, /* GL_RGB8 */ + { 29811, 0x00008051 }, /* GL_RGB8_EXT */ + { 29823, 0x00001908 }, /* GL_RGBA */ + { 29831, 0x0000805A }, /* GL_RGBA12 */ + { 29841, 0x0000805A }, /* GL_RGBA12_EXT */ + { 29855, 0x0000805B }, /* GL_RGBA16 */ + { 29865, 0x0000805B }, /* GL_RGBA16_EXT */ + { 29879, 0x00008055 }, /* GL_RGBA2 */ + { 29888, 0x00008055 }, /* GL_RGBA2_EXT */ + { 29901, 0x00008056 }, /* GL_RGBA4 */ + { 29910, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 29929, 0x00008056 }, /* GL_RGBA4_EXT */ + { 29942, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 29956, 0x00008058 }, /* GL_RGBA8 */ + { 29965, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29978, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 29993, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 30011, 0x00000C31 }, /* GL_RGBA_MODE */ + { 30024, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 30037, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 30051, 0x000083A0 }, /* GL_RGB_S3TC */ + { 30063, 0x00008573 }, /* GL_RGB_SCALE */ + { 30076, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 30093, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 30110, 0x00000407 }, /* GL_RIGHT */ + { 30119, 0x00002000 }, /* GL_S */ + { 30124, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 30138, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 30159, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 30173, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 30194, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 30208, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 30224, 0x000080A9 }, /* GL_SAMPLES */ + { 30235, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 30251, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 30266, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 30284, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 30306, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 30334, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 30366, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 30389, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 30416, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 30434, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 30457, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 30479, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 30498, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 30521, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 30547, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 30577, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 30602, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 30631, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 30646, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 30661, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 30677, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 30702, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 30742, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 30786, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 30819, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 30849, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 30881, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 30911, 0x00001C02 }, /* GL_SELECT */ + { 30921, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 30949, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30974, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30990, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 31017, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 31048, 0x0000150F }, /* GL_SET */ + { 31055, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 31076, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 31100, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 31115, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 31130, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 31158, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 31181, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 31211, 0x00001601 }, /* GL_SHININESS */ + { 31224, 0x00001402 }, /* GL_SHORT */ + { 31233, 0x00009119 }, /* GL_SIGNALED */ + { 31245, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 31266, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 31282, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 31302, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 31321, 0x00008C46 }, /* GL_SLUMINANCE */ + { 31335, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 31350, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 31372, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 31392, 0x00001D01 }, /* GL_SMOOTH */ + { 31402, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 31435, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 31462, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 31495, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 31522, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 31539, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 31560, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 31581, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 31596, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 31615, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 31634, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 31651, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 31672, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 31693, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 31708, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 31727, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 31746, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 31763, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 31784, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 31805, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 31820, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 31839, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 31858, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 31878, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 31896, 0x00001202 }, /* GL_SPECULAR */ + { 31908, 0x00002402 }, /* GL_SPHERE_MAP */ + { 31922, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 31937, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 31955, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 31972, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 31986, 0x00008580 }, /* GL_SRC0_RGB */ + { 31998, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 32012, 0x00008581 }, /* GL_SRC1_RGB */ + { 32024, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 32038, 0x00008582 }, /* GL_SRC2_RGB */ + { 32050, 0x00000302 }, /* GL_SRC_ALPHA */ + { 32063, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 32085, 0x00000300 }, /* GL_SRC_COLOR */ + { 32098, 0x00008C40 }, /* GL_SRGB */ + { 32106, 0x00008C41 }, /* GL_SRGB8 */ + { 32115, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 32131, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 32145, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 32163, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 32182, 0x000088E6 }, /* GL_STATIC_COPY */ + { 32197, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 32216, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 32231, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 32250, 0x000088E5 }, /* GL_STATIC_READ */ + { 32265, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 32284, 0x00001802 }, /* GL_STENCIL */ + { 32295, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 32317, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 32343, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 32364, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 32389, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 32410, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 32435, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 32467, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 32503, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 32535, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 32571, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 32591, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 32618, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 32644, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 32660, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 32682, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 32705, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 32721, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 32737, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 32754, 0x00008D46 }, /* GL_STENCIL_INDEX1 */ + { 32772, 0x00008D49 }, /* GL_STENCIL_INDEX16 */ + { 32791, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 32814, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 32836, 0x00008D47 }, /* GL_STENCIL_INDEX4 */ + { 32854, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 32876, 0x00008D48 }, /* GL_STENCIL_INDEX8 */ + { 32894, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 32916, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 32937, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 32964, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 32991, 0x00000B97 }, /* GL_STENCIL_REF */ + { 33006, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 33022, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 33051, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 33073, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 33094, 0x00000C33 }, /* GL_STEREO */ + { 33104, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ + { 33128, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ + { 33153, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ + { 33177, 0x000088E2 }, /* GL_STREAM_COPY */ + { 33192, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 33211, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 33226, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 33245, 0x000088E1 }, /* GL_STREAM_READ */ + { 33260, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 33279, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 33296, 0x000084E7 }, /* GL_SUBTRACT */ + { 33308, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 33324, 0x00009113 }, /* GL_SYNC_CONDITION */ + { 33342, 0x00009116 }, /* GL_SYNC_FENCE */ + { 33356, 0x00009115 }, /* GL_SYNC_FLAGS */ + { 33370, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ + { 33397, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + { 33427, 0x00009114 }, /* GL_SYNC_STATUS */ + { 33442, 0x00002001 }, /* GL_T */ + { 33447, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 33462, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 33481, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 33497, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 33512, 0x00002A27 }, /* GL_T2F_V3F */ + { 33523, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 33542, 0x00002A28 }, /* GL_T4F_V4F */ + { 33553, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 33576, 0x00001702 }, /* GL_TEXTURE */ + { 33587, 0x000084C0 }, /* GL_TEXTURE0 */ + { 33599, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 33615, 0x000084C1 }, /* GL_TEXTURE1 */ + { 33627, 0x000084CA }, /* GL_TEXTURE10 */ + { 33640, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 33657, 0x000084CB }, /* GL_TEXTURE11 */ + { 33670, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 33687, 0x000084CC }, /* GL_TEXTURE12 */ + { 33700, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 33717, 0x000084CD }, /* GL_TEXTURE13 */ + { 33730, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 33747, 0x000084CE }, /* GL_TEXTURE14 */ + { 33760, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 33777, 0x000084CF }, /* GL_TEXTURE15 */ + { 33790, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 33807, 0x000084D0 }, /* GL_TEXTURE16 */ + { 33820, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 33837, 0x000084D1 }, /* GL_TEXTURE17 */ + { 33850, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 33867, 0x000084D2 }, /* GL_TEXTURE18 */ + { 33880, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 33897, 0x000084D3 }, /* GL_TEXTURE19 */ + { 33910, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 33927, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 33943, 0x000084C2 }, /* GL_TEXTURE2 */ + { 33955, 0x000084D4 }, /* GL_TEXTURE20 */ + { 33968, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 33985, 0x000084D5 }, /* GL_TEXTURE21 */ + { 33998, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 34015, 0x000084D6 }, /* GL_TEXTURE22 */ + { 34028, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 34045, 0x000084D7 }, /* GL_TEXTURE23 */ + { 34058, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 34075, 0x000084D8 }, /* GL_TEXTURE24 */ + { 34088, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 34105, 0x000084D9 }, /* GL_TEXTURE25 */ + { 34118, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 34135, 0x000084DA }, /* GL_TEXTURE26 */ + { 34148, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 34165, 0x000084DB }, /* GL_TEXTURE27 */ + { 34178, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 34195, 0x000084DC }, /* GL_TEXTURE28 */ + { 34208, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 34225, 0x000084DD }, /* GL_TEXTURE29 */ + { 34238, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 34255, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 34271, 0x000084C3 }, /* GL_TEXTURE3 */ + { 34283, 0x000084DE }, /* GL_TEXTURE30 */ + { 34296, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 34313, 0x000084DF }, /* GL_TEXTURE31 */ + { 34326, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 34343, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 34359, 0x000084C4 }, /* GL_TEXTURE4 */ + { 34371, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 34387, 0x000084C5 }, /* GL_TEXTURE5 */ + { 34399, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 34415, 0x000084C6 }, /* GL_TEXTURE6 */ + { 34427, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 34443, 0x000084C7 }, /* GL_TEXTURE7 */ + { 34455, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 34471, 0x000084C8 }, /* GL_TEXTURE8 */ + { 34483, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 34499, 0x000084C9 }, /* GL_TEXTURE9 */ + { 34511, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 34527, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 34541, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 34565, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 34579, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 34603, 0x0000806F }, /* GL_TEXTURE_3D */ + { 34617, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 34639, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 34665, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 34687, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 34709, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 34741, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 34763, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 34795, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 34817, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 34845, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 34877, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 34910, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 34942, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 34957, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 34978, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 35003, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 35021, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 35045, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 35076, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 35106, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 35136, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 35171, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 35202, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 35240, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 35267, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 35299, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 35333, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 35357, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 35385, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 35409, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 35437, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 35470, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 35494, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 35516, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 35538, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 35564, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 35598, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 35631, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 35668, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 35696, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 35728, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 35751, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 35789, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 35831, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 35862, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 35890, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 35920, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 35948, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 35968, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 35992, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 36023, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 36058, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 36089, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 36124, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 36155, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 36190, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 36221, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 36256, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 36287, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 36322, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 36353, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 36388, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + { 36417, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 36434, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 36456, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 36482, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 36497, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 36518, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 36538, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 36564, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 36584, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 36601, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 36618, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 36635, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 36652, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 36677, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 36699, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 36725, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 36743, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 36769, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 36795, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 36825, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 36852, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 36877, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 36897, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 36921, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 36948, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 36975, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 37002, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 37028, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 37058, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 37080, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 37098, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 37128, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 37156, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 37184, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 37212, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 37233, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 37252, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 37274, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 37293, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 37313, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + { 37343, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + { 37374, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 37399, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 37423, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 37443, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 37467, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 37487, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 37510, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 37534, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */ + { 37562, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + { 37592, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 37617, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 37651, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 37668, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 37686, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 37704, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 37722, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ + { 37741, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ + { 37760, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 37780, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 37799, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 37828, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 37845, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 37871, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 37901, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 37933, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 37963, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 37997, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 38013, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 38044, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 38079, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 38107, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 38139, 0x00000004 }, /* GL_TRIANGLES */ + { 38152, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 38168, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 38189, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 38207, 0x00000001 }, /* GL_TRUE */ + { 38215, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 38235, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 38258, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 38278, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 38299, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 38321, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 38343, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 38363, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 38384, 0x00009118 }, /* GL_UNSIGNALED */ + { 38398, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 38415, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 38442, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 38465, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 38481, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 38508, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 38529, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */ + { 38554, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 38578, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 38609, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 38633, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 38661, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 38684, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 38702, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 38732, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 38758, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 38788, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 38814, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 38838, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 38866, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 38894, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 38921, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 38953, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 38984, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 38998, 0x00002A20 }, /* GL_V2F */ + { 39005, 0x00002A21 }, /* GL_V3F */ + { 39012, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 39031, 0x00001F00 }, /* GL_VENDOR */ + { 39041, 0x00001F02 }, /* GL_VERSION */ + { 39052, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 39068, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ + { 39092, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 39122, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 39153, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 39188, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 39212, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 39233, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 39256, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 39277, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 39304, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 39332, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 39360, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 39388, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 39416, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 39444, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 39472, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 39499, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 39526, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 39553, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 39580, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 39607, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 39634, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 39661, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 39688, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 39715, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 39753, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 39795, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 39826, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 39861, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 39895, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 39933, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 39964, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 39999, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 40027, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 40059, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 40089, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 40123, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 40151, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 40183, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 40203, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 40225, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 40254, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 40275, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 40304, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 40337, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 40369, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 40396, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 40427, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 40457, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 40474, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 40495, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 40522, 0x00000BA2 }, /* GL_VIEWPORT */ + { 40534, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 40550, 0x0000911D }, /* GL_WAIT_FAILED */ + { 40565, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 40585, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 40616, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 40651, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 40679, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 40704, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 40731, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 40756, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 40780, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 40799, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 40813, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 40831, 0x00001506 }, /* GL_XOR */ + { 40838, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 40857, 0x00008757 }, /* GL_YCBCR_MESA */ + { 40871, 0x00000000 }, /* GL_ZERO */ + { 40879, 0x00000D16 }, /* GL_ZOOM_X */ + { 40889, 0x00000D17 }, /* GL_ZOOM_Y */ }; static const unsigned reduced_enums[1347] = { - 475, /* GL_FALSE */ - 691, /* GL_LINES */ - 693, /* GL_LINE_LOOP */ - 700, /* GL_LINE_STRIP */ - 1743, /* GL_TRIANGLES */ - 1746, /* GL_TRIANGLE_STRIP */ - 1744, /* GL_TRIANGLE_FAN */ - 1271, /* GL_QUADS */ - 1274, /* GL_QUAD_STRIP */ - 1158, /* GL_POLYGON */ - 1170, /* GL_POLYGON_STIPPLE_BIT */ - 1119, /* GL_PIXEL_MODE_BIT */ - 678, /* GL_LIGHTING_BIT */ - 504, /* GL_FOG_BIT */ + 479, /* GL_FALSE */ + 701, /* GL_LINES */ + 703, /* GL_LINE_LOOP */ + 710, /* GL_LINE_STRIP */ + 1766, /* GL_TRIANGLES */ + 1769, /* GL_TRIANGLE_STRIP */ + 1767, /* GL_TRIANGLE_FAN */ + 1285, /* GL_QUADS */ + 1289, /* GL_QUAD_STRIP */ + 1171, /* GL_POLYGON */ + 1183, /* GL_POLYGON_STIPPLE_BIT */ + 1132, /* GL_PIXEL_MODE_BIT */ + 688, /* GL_LIGHTING_BIT */ + 509, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 710, /* GL_LOAD */ - 1326, /* GL_RETURN */ - 991, /* GL_MULT */ + 720, /* GL_LOAD */ + 1344, /* GL_RETURN */ + 1004, /* GL_MULT */ 23, /* GL_ADD */ - 1007, /* GL_NEVER */ - 668, /* GL_LESS */ - 465, /* GL_EQUAL */ - 667, /* GL_LEQUAL */ - 590, /* GL_GREATER */ - 1022, /* GL_NOTEQUAL */ - 589, /* GL_GEQUAL */ + 1020, /* GL_NEVER */ + 678, /* GL_LESS */ + 469, /* GL_EQUAL */ + 677, /* GL_LEQUAL */ + 599, /* GL_GREATER */ + 1035, /* GL_NOTEQUAL */ + 598, /* GL_GEQUAL */ 47, /* GL_ALWAYS */ - 1467, /* GL_SRC_COLOR */ - 1052, /* GL_ONE_MINUS_SRC_COLOR */ - 1465, /* GL_SRC_ALPHA */ - 1051, /* GL_ONE_MINUS_SRC_ALPHA */ - 444, /* GL_DST_ALPHA */ - 1049, /* GL_ONE_MINUS_DST_ALPHA */ - 445, /* GL_DST_COLOR */ - 1050, /* GL_ONE_MINUS_DST_COLOR */ - 1466, /* GL_SRC_ALPHA_SATURATE */ - 577, /* GL_FRONT_LEFT */ - 578, /* GL_FRONT_RIGHT */ + 1485, /* GL_SRC_COLOR */ + 1065, /* GL_ONE_MINUS_SRC_COLOR */ + 1483, /* GL_SRC_ALPHA */ + 1064, /* GL_ONE_MINUS_SRC_ALPHA */ + 448, /* GL_DST_ALPHA */ + 1062, /* GL_ONE_MINUS_DST_ALPHA */ + 449, /* GL_DST_COLOR */ + 1063, /* GL_ONE_MINUS_DST_COLOR */ + 1484, /* GL_SRC_ALPHA_SATURATE */ + 586, /* GL_FRONT_LEFT */ + 587, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ - 574, /* GL_FRONT */ + 583, /* GL_FRONT */ 68, /* GL_BACK */ - 666, /* GL_LEFT */ - 1368, /* GL_RIGHT */ - 575, /* GL_FRONT_AND_BACK */ + 676, /* GL_LEFT */ + 1386, /* GL_RIGHT */ + 584, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 656, /* GL_INVALID_ENUM */ - 660, /* GL_INVALID_VALUE */ - 659, /* GL_INVALID_OPERATION */ - 1472, /* GL_STACK_OVERFLOW */ - 1473, /* GL_STACK_UNDERFLOW */ - 1077, /* GL_OUT_OF_MEMORY */ - 657, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 665, /* GL_INVALID_ENUM */ + 669, /* GL_INVALID_VALUE */ + 668, /* GL_INVALID_OPERATION */ + 1490, /* GL_STACK_OVERFLOW */ + 1491, /* GL_STACK_UNDERFLOW */ + 1090, /* GL_OUT_OF_MEMORY */ + 666, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1097, /* GL_PASS_THROUGH_TOKEN */ - 1157, /* GL_POINT_TOKEN */ - 701, /* GL_LINE_TOKEN */ - 1171, /* GL_POLYGON_TOKEN */ + 1110, /* GL_PASS_THROUGH_TOKEN */ + 1170, /* GL_POINT_TOKEN */ + 711, /* GL_LINE_TOKEN */ + 1184, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ - 443, /* GL_DRAW_PIXEL_TOKEN */ + 447, /* GL_DRAW_PIXEL_TOKEN */ 301, /* GL_COPY_PIXEL_TOKEN */ - 694, /* GL_LINE_RESET_TOKEN */ - 468, /* GL_EXP */ - 469, /* GL_EXP2 */ + 704, /* GL_LINE_RESET_TOKEN */ + 472, /* GL_EXP */ + 473, /* GL_EXP2 */ 337, /* GL_CW */ 125, /* GL_CCW */ 146, /* GL_COEFF */ - 1074, /* GL_ORDER */ - 381, /* GL_DOMAIN */ + 1087, /* GL_ORDER */ + 384, /* GL_DOMAIN */ 311, /* GL_CURRENT_COLOR */ 314, /* GL_CURRENT_INDEX */ 320, /* GL_CURRENT_NORMAL */ @@ -3844,519 +3892,519 @@ static const unsigned reduced_enums[1347] = 328, /* GL_CURRENT_RASTER_POSITION */ 329, /* GL_CURRENT_RASTER_POSITION_VALID */ 326, /* GL_CURRENT_RASTER_DISTANCE */ - 1150, /* GL_POINT_SMOOTH */ - 1139, /* GL_POINT_SIZE */ - 1149, /* GL_POINT_SIZE_RANGE */ - 1140, /* GL_POINT_SIZE_GRANULARITY */ - 695, /* GL_LINE_SMOOTH */ - 702, /* GL_LINE_WIDTH */ - 704, /* GL_LINE_WIDTH_RANGE */ - 703, /* GL_LINE_WIDTH_GRANULARITY */ - 697, /* GL_LINE_STIPPLE */ - 698, /* GL_LINE_STIPPLE_PATTERN */ - 699, /* GL_LINE_STIPPLE_REPEAT */ - 709, /* GL_LIST_MODE */ - 874, /* GL_MAX_LIST_NESTING */ - 706, /* GL_LIST_BASE */ - 708, /* GL_LIST_INDEX */ - 1160, /* GL_POLYGON_MODE */ - 1167, /* GL_POLYGON_SMOOTH */ - 1169, /* GL_POLYGON_STIPPLE */ - 454, /* GL_EDGE_FLAG */ + 1163, /* GL_POINT_SMOOTH */ + 1152, /* GL_POINT_SIZE */ + 1162, /* GL_POINT_SIZE_RANGE */ + 1153, /* GL_POINT_SIZE_GRANULARITY */ + 705, /* GL_LINE_SMOOTH */ + 712, /* GL_LINE_WIDTH */ + 714, /* GL_LINE_WIDTH_RANGE */ + 713, /* GL_LINE_WIDTH_GRANULARITY */ + 707, /* GL_LINE_STIPPLE */ + 708, /* GL_LINE_STIPPLE_PATTERN */ + 709, /* GL_LINE_STIPPLE_REPEAT */ + 719, /* GL_LIST_MODE */ + 885, /* GL_MAX_LIST_NESTING */ + 716, /* GL_LIST_BASE */ + 718, /* GL_LIST_INDEX */ + 1173, /* GL_POLYGON_MODE */ + 1180, /* GL_POLYGON_SMOOTH */ + 1182, /* GL_POLYGON_STIPPLE */ + 458, /* GL_EDGE_FLAG */ 304, /* GL_CULL_FACE */ 305, /* GL_CULL_FACE_MODE */ - 576, /* GL_FRONT_FACE */ - 677, /* GL_LIGHTING */ - 682, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 683, /* GL_LIGHT_MODEL_TWO_SIDE */ - 679, /* GL_LIGHT_MODEL_AMBIENT */ - 1414, /* GL_SHADE_MODEL */ + 585, /* GL_FRONT_FACE */ + 687, /* GL_LIGHTING */ + 692, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 693, /* GL_LIGHT_MODEL_TWO_SIDE */ + 689, /* GL_LIGHT_MODEL_AMBIENT */ + 1432, /* GL_SHADE_MODEL */ 193, /* GL_COLOR_MATERIAL_FACE */ 194, /* GL_COLOR_MATERIAL_PARAMETER */ 192, /* GL_COLOR_MATERIAL */ - 503, /* GL_FOG */ - 525, /* GL_FOG_INDEX */ - 521, /* GL_FOG_DENSITY */ - 529, /* GL_FOG_START */ - 523, /* GL_FOG_END */ - 526, /* GL_FOG_MODE */ - 505, /* GL_FOG_COLOR */ - 368, /* GL_DEPTH_RANGE */ - 375, /* GL_DEPTH_TEST */ - 378, /* GL_DEPTH_WRITEMASK */ - 356, /* GL_DEPTH_CLEAR_VALUE */ - 367, /* GL_DEPTH_FUNC */ + 508, /* GL_FOG */ + 530, /* GL_FOG_INDEX */ + 526, /* GL_FOG_DENSITY */ + 534, /* GL_FOG_START */ + 528, /* GL_FOG_END */ + 531, /* GL_FOG_MODE */ + 510, /* GL_FOG_COLOR */ + 370, /* GL_DEPTH_RANGE */ + 378, /* GL_DEPTH_TEST */ + 381, /* GL_DEPTH_WRITEMASK */ + 358, /* GL_DEPTH_CLEAR_VALUE */ + 369, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1508, /* GL_STENCIL_TEST */ - 1496, /* GL_STENCIL_CLEAR_VALUE */ - 1498, /* GL_STENCIL_FUNC */ - 1510, /* GL_STENCIL_VALUE_MASK */ - 1497, /* GL_STENCIL_FAIL */ - 1505, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1506, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1507, /* GL_STENCIL_REF */ - 1511, /* GL_STENCIL_WRITEMASK */ - 843, /* GL_MATRIX_MODE */ - 1012, /* GL_NORMALIZE */ - 1837, /* GL_VIEWPORT */ - 986, /* GL_MODELVIEW_STACK_DEPTH */ - 1250, /* GL_PROJECTION_STACK_DEPTH */ - 1718, /* GL_TEXTURE_STACK_DEPTH */ - 984, /* GL_MODELVIEW_MATRIX */ - 1249, /* GL_PROJECTION_MATRIX */ - 1701, /* GL_TEXTURE_MATRIX */ + 1530, /* GL_STENCIL_TEST */ + 1514, /* GL_STENCIL_CLEAR_VALUE */ + 1516, /* GL_STENCIL_FUNC */ + 1532, /* GL_STENCIL_VALUE_MASK */ + 1515, /* GL_STENCIL_FAIL */ + 1527, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1528, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1529, /* GL_STENCIL_REF */ + 1533, /* GL_STENCIL_WRITEMASK */ + 853, /* GL_MATRIX_MODE */ + 1025, /* GL_NORMALIZE */ + 1861, /* GL_VIEWPORT */ + 999, /* GL_MODELVIEW_STACK_DEPTH */ + 1263, /* GL_PROJECTION_STACK_DEPTH */ + 1740, /* GL_TEXTURE_STACK_DEPTH */ + 997, /* GL_MODELVIEW_MATRIX */ + 1262, /* GL_PROJECTION_MATRIX */ + 1723, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ 136, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 380, /* GL_DITHER */ + 383, /* GL_DITHER */ 78, /* GL_BLEND_DST */ 87, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 712, /* GL_LOGIC_OP_MODE */ - 630, /* GL_INDEX_LOGIC_OP */ + 722, /* GL_LOGIC_OP_MODE */ + 639, /* GL_INDEX_LOGIC_OP */ 191, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ - 391, /* GL_DRAW_BUFFER */ - 1284, /* GL_READ_BUFFER */ - 1395, /* GL_SCISSOR_BOX */ - 1396, /* GL_SCISSOR_TEST */ - 629, /* GL_INDEX_CLEAR_VALUE */ - 634, /* GL_INDEX_WRITEMASK */ + 394, /* GL_DRAW_BUFFER */ + 1299, /* GL_READ_BUFFER */ + 1413, /* GL_SCISSOR_BOX */ + 1414, /* GL_SCISSOR_TEST */ + 638, /* GL_INDEX_CLEAR_VALUE */ + 643, /* GL_INDEX_WRITEMASK */ 188, /* GL_COLOR_CLEAR_VALUE */ 230, /* GL_COLOR_WRITEMASK */ - 631, /* GL_INDEX_MODE */ - 1361, /* GL_RGBA_MODE */ - 390, /* GL_DOUBLEBUFFER */ - 1512, /* GL_STEREO */ - 1319, /* GL_RENDER_MODE */ - 1098, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1151, /* GL_POINT_SMOOTH_HINT */ - 696, /* GL_LINE_SMOOTH_HINT */ - 1168, /* GL_POLYGON_SMOOTH_HINT */ - 524, /* GL_FOG_HINT */ - 1682, /* GL_TEXTURE_GEN_S */ - 1683, /* GL_TEXTURE_GEN_T */ - 1681, /* GL_TEXTURE_GEN_R */ - 1680, /* GL_TEXTURE_GEN_Q */ - 1111, /* GL_PIXEL_MAP_I_TO_I */ - 1117, /* GL_PIXEL_MAP_S_TO_S */ - 1113, /* GL_PIXEL_MAP_I_TO_R */ - 1109, /* GL_PIXEL_MAP_I_TO_G */ - 1107, /* GL_PIXEL_MAP_I_TO_B */ - 1105, /* GL_PIXEL_MAP_I_TO_A */ - 1115, /* GL_PIXEL_MAP_R_TO_R */ - 1103, /* GL_PIXEL_MAP_G_TO_G */ - 1101, /* GL_PIXEL_MAP_B_TO_B */ - 1099, /* GL_PIXEL_MAP_A_TO_A */ - 1112, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1118, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1114, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1110, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1108, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1106, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1116, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1104, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1102, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1100, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1755, /* GL_UNPACK_SWAP_BYTES */ - 1750, /* GL_UNPACK_LSB_FIRST */ - 1751, /* GL_UNPACK_ROW_LENGTH */ - 1754, /* GL_UNPACK_SKIP_ROWS */ - 1753, /* GL_UNPACK_SKIP_PIXELS */ - 1748, /* GL_UNPACK_ALIGNMENT */ - 1086, /* GL_PACK_SWAP_BYTES */ - 1081, /* GL_PACK_LSB_FIRST */ - 1082, /* GL_PACK_ROW_LENGTH */ - 1085, /* GL_PACK_SKIP_ROWS */ - 1084, /* GL_PACK_SKIP_PIXELS */ - 1078, /* GL_PACK_ALIGNMENT */ - 790, /* GL_MAP_COLOR */ - 795, /* GL_MAP_STENCIL */ - 633, /* GL_INDEX_SHIFT */ - 632, /* GL_INDEX_OFFSET */ - 1297, /* GL_RED_SCALE */ - 1295, /* GL_RED_BIAS */ - 1855, /* GL_ZOOM_X */ - 1856, /* GL_ZOOM_Y */ - 594, /* GL_GREEN_SCALE */ - 592, /* GL_GREEN_BIAS */ + 640, /* GL_INDEX_MODE */ + 1379, /* GL_RGBA_MODE */ + 393, /* GL_DOUBLEBUFFER */ + 1534, /* GL_STEREO */ + 1337, /* GL_RENDER_MODE */ + 1111, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1164, /* GL_POINT_SMOOTH_HINT */ + 706, /* GL_LINE_SMOOTH_HINT */ + 1181, /* GL_POLYGON_SMOOTH_HINT */ + 529, /* GL_FOG_HINT */ + 1704, /* GL_TEXTURE_GEN_S */ + 1705, /* GL_TEXTURE_GEN_T */ + 1703, /* GL_TEXTURE_GEN_R */ + 1702, /* GL_TEXTURE_GEN_Q */ + 1124, /* GL_PIXEL_MAP_I_TO_I */ + 1130, /* GL_PIXEL_MAP_S_TO_S */ + 1126, /* GL_PIXEL_MAP_I_TO_R */ + 1122, /* GL_PIXEL_MAP_I_TO_G */ + 1120, /* GL_PIXEL_MAP_I_TO_B */ + 1118, /* GL_PIXEL_MAP_I_TO_A */ + 1128, /* GL_PIXEL_MAP_R_TO_R */ + 1116, /* GL_PIXEL_MAP_G_TO_G */ + 1114, /* GL_PIXEL_MAP_B_TO_B */ + 1112, /* GL_PIXEL_MAP_A_TO_A */ + 1125, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1131, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1127, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1123, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1121, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1119, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1129, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1117, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1115, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1113, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1778, /* GL_UNPACK_SWAP_BYTES */ + 1773, /* GL_UNPACK_LSB_FIRST */ + 1774, /* GL_UNPACK_ROW_LENGTH */ + 1777, /* GL_UNPACK_SKIP_ROWS */ + 1776, /* GL_UNPACK_SKIP_PIXELS */ + 1771, /* GL_UNPACK_ALIGNMENT */ + 1099, /* GL_PACK_SWAP_BYTES */ + 1094, /* GL_PACK_LSB_FIRST */ + 1095, /* GL_PACK_ROW_LENGTH */ + 1098, /* GL_PACK_SKIP_ROWS */ + 1097, /* GL_PACK_SKIP_PIXELS */ + 1091, /* GL_PACK_ALIGNMENT */ + 800, /* GL_MAP_COLOR */ + 805, /* GL_MAP_STENCIL */ + 642, /* GL_INDEX_SHIFT */ + 641, /* GL_INDEX_OFFSET */ + 1313, /* GL_RED_SCALE */ + 1311, /* GL_RED_BIAS */ + 1879, /* GL_ZOOM_X */ + 1880, /* GL_ZOOM_Y */ + 603, /* GL_GREEN_SCALE */ + 601, /* GL_GREEN_BIAS */ 93, /* GL_BLUE_SCALE */ 91, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 369, /* GL_DEPTH_SCALE */ - 350, /* GL_DEPTH_BIAS */ - 869, /* GL_MAX_EVAL_ORDER */ - 873, /* GL_MAX_LIGHTS */ - 852, /* GL_MAX_CLIP_PLANES */ - 919, /* GL_MAX_TEXTURE_SIZE */ - 879, /* GL_MAX_PIXEL_MAP_TABLE */ - 848, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 876, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 877, /* GL_MAX_NAME_STACK_DEPTH */ - 905, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 920, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 934, /* GL_MAX_VIEWPORT_DIMS */ - 849, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1522, /* GL_SUBPIXEL_BITS */ - 628, /* GL_INDEX_BITS */ - 1296, /* GL_RED_BITS */ - 593, /* GL_GREEN_BITS */ + 371, /* GL_DEPTH_SCALE */ + 351, /* GL_DEPTH_BIAS */ + 880, /* GL_MAX_EVAL_ORDER */ + 884, /* GL_MAX_LIGHTS */ + 862, /* GL_MAX_CLIP_PLANES */ + 932, /* GL_MAX_TEXTURE_SIZE */ + 890, /* GL_MAX_PIXEL_MAP_TABLE */ + 858, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 887, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 888, /* GL_MAX_NAME_STACK_DEPTH */ + 916, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 933, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 947, /* GL_MAX_VIEWPORT_DIMS */ + 859, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1544, /* GL_SUBPIXEL_BITS */ + 637, /* GL_INDEX_BITS */ + 1312, /* GL_RED_BITS */ + 602, /* GL_GREEN_BITS */ 92, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 351, /* GL_DEPTH_BITS */ - 1494, /* GL_STENCIL_BITS */ + 352, /* GL_DEPTH_BITS */ + 1512, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 1000, /* GL_NAME_STACK_DEPTH */ + 1013, /* GL_NAME_STACK_DEPTH */ 62, /* GL_AUTO_NORMAL */ - 736, /* GL_MAP1_COLOR_4 */ - 739, /* GL_MAP1_INDEX */ - 740, /* GL_MAP1_NORMAL */ - 741, /* GL_MAP1_TEXTURE_COORD_1 */ - 742, /* GL_MAP1_TEXTURE_COORD_2 */ - 743, /* GL_MAP1_TEXTURE_COORD_3 */ - 744, /* GL_MAP1_TEXTURE_COORD_4 */ - 745, /* GL_MAP1_VERTEX_3 */ - 746, /* GL_MAP1_VERTEX_4 */ - 763, /* GL_MAP2_COLOR_4 */ - 766, /* GL_MAP2_INDEX */ - 767, /* GL_MAP2_NORMAL */ - 768, /* GL_MAP2_TEXTURE_COORD_1 */ - 769, /* GL_MAP2_TEXTURE_COORD_2 */ - 770, /* GL_MAP2_TEXTURE_COORD_3 */ - 771, /* GL_MAP2_TEXTURE_COORD_4 */ - 772, /* GL_MAP2_VERTEX_3 */ - 773, /* GL_MAP2_VERTEX_4 */ - 737, /* GL_MAP1_GRID_DOMAIN */ - 738, /* GL_MAP1_GRID_SEGMENTS */ - 764, /* GL_MAP2_GRID_DOMAIN */ - 765, /* GL_MAP2_GRID_SEGMENTS */ - 1605, /* GL_TEXTURE_1D */ - 1607, /* GL_TEXTURE_2D */ - 478, /* GL_FEEDBACK_BUFFER_POINTER */ - 479, /* GL_FEEDBACK_BUFFER_SIZE */ - 480, /* GL_FEEDBACK_BUFFER_TYPE */ - 1405, /* GL_SELECTION_BUFFER_POINTER */ - 1406, /* GL_SELECTION_BUFFER_SIZE */ - 1723, /* GL_TEXTURE_WIDTH */ - 1687, /* GL_TEXTURE_HEIGHT */ - 1642, /* GL_TEXTURE_COMPONENTS */ - 1626, /* GL_TEXTURE_BORDER_COLOR */ - 1625, /* GL_TEXTURE_BORDER */ - 382, /* GL_DONT_CARE */ - 476, /* GL_FASTEST */ - 1008, /* GL_NICEST */ + 746, /* GL_MAP1_COLOR_4 */ + 749, /* GL_MAP1_INDEX */ + 750, /* GL_MAP1_NORMAL */ + 751, /* GL_MAP1_TEXTURE_COORD_1 */ + 752, /* GL_MAP1_TEXTURE_COORD_2 */ + 753, /* GL_MAP1_TEXTURE_COORD_3 */ + 754, /* GL_MAP1_TEXTURE_COORD_4 */ + 755, /* GL_MAP1_VERTEX_3 */ + 756, /* GL_MAP1_VERTEX_4 */ + 773, /* GL_MAP2_COLOR_4 */ + 776, /* GL_MAP2_INDEX */ + 777, /* GL_MAP2_NORMAL */ + 778, /* GL_MAP2_TEXTURE_COORD_1 */ + 779, /* GL_MAP2_TEXTURE_COORD_2 */ + 780, /* GL_MAP2_TEXTURE_COORD_3 */ + 781, /* GL_MAP2_TEXTURE_COORD_4 */ + 782, /* GL_MAP2_VERTEX_3 */ + 783, /* GL_MAP2_VERTEX_4 */ + 747, /* GL_MAP1_GRID_DOMAIN */ + 748, /* GL_MAP1_GRID_SEGMENTS */ + 774, /* GL_MAP2_GRID_DOMAIN */ + 775, /* GL_MAP2_GRID_SEGMENTS */ + 1627, /* GL_TEXTURE_1D */ + 1629, /* GL_TEXTURE_2D */ + 482, /* GL_FEEDBACK_BUFFER_POINTER */ + 483, /* GL_FEEDBACK_BUFFER_SIZE */ + 484, /* GL_FEEDBACK_BUFFER_TYPE */ + 1423, /* GL_SELECTION_BUFFER_POINTER */ + 1424, /* GL_SELECTION_BUFFER_SIZE */ + 1746, /* GL_TEXTURE_WIDTH */ + 1709, /* GL_TEXTURE_HEIGHT */ + 1664, /* GL_TEXTURE_COMPONENTS */ + 1648, /* GL_TEXTURE_BORDER_COLOR */ + 1647, /* GL_TEXTURE_BORDER */ + 385, /* GL_DONT_CARE */ + 480, /* GL_FASTEST */ + 1021, /* GL_NICEST */ 48, /* GL_AMBIENT */ - 379, /* GL_DIFFUSE */ - 1454, /* GL_SPECULAR */ - 1172, /* GL_POSITION */ - 1457, /* GL_SPOT_DIRECTION */ - 1458, /* GL_SPOT_EXPONENT */ - 1456, /* GL_SPOT_CUTOFF */ + 382, /* GL_DIFFUSE */ + 1472, /* GL_SPECULAR */ + 1185, /* GL_POSITION */ + 1475, /* GL_SPOT_DIRECTION */ + 1476, /* GL_SPOT_EXPONENT */ + 1474, /* GL_SPOT_CUTOFF */ 275, /* GL_CONSTANT_ATTENUATION */ - 686, /* GL_LINEAR_ATTENUATION */ - 1270, /* GL_QUADRATIC_ATTENUATION */ + 696, /* GL_LINEAR_ATTENUATION */ + 1284, /* GL_QUADRATIC_ATTENUATION */ 244, /* GL_COMPILE */ 245, /* GL_COMPILE_AND_EXECUTE */ 120, /* GL_BYTE */ - 1757, /* GL_UNSIGNED_BYTE */ - 1419, /* GL_SHORT */ - 1768, /* GL_UNSIGNED_SHORT */ - 636, /* GL_INT */ - 1760, /* GL_UNSIGNED_INT */ - 484, /* GL_FLOAT */ + 1780, /* GL_UNSIGNED_BYTE */ + 1437, /* GL_SHORT */ + 1792, /* GL_UNSIGNED_SHORT */ + 645, /* GL_INT */ + 1783, /* GL_UNSIGNED_INT */ + 489, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 389, /* GL_DOUBLE */ + 392, /* GL_DOUBLE */ 132, /* GL_CLEAR */ 50, /* GL_AND */ 52, /* GL_AND_REVERSE */ 299, /* GL_COPY */ 51, /* GL_AND_INVERTED */ - 1010, /* GL_NOOP */ - 1851, /* GL_XOR */ - 1073, /* GL_OR */ - 1011, /* GL_NOR */ - 466, /* GL_EQUIV */ - 663, /* GL_INVERT */ - 1076, /* GL_OR_REVERSE */ + 1023, /* GL_NOOP */ + 1875, /* GL_XOR */ + 1086, /* GL_OR */ + 1024, /* GL_NOR */ + 470, /* GL_EQUIV */ + 672, /* GL_INVERT */ + 1089, /* GL_OR_REVERSE */ 300, /* GL_COPY_INVERTED */ - 1075, /* GL_OR_INVERTED */ - 1001, /* GL_NAND */ - 1410, /* GL_SET */ - 463, /* GL_EMISSION */ - 1418, /* GL_SHININESS */ + 1088, /* GL_OR_INVERTED */ + 1014, /* GL_NAND */ + 1428, /* GL_SET */ + 467, /* GL_EMISSION */ + 1436, /* GL_SHININESS */ 49, /* GL_AMBIENT_AND_DIFFUSE */ 190, /* GL_COLOR_INDEXES */ - 951, /* GL_MODELVIEW */ - 1248, /* GL_PROJECTION */ - 1540, /* GL_TEXTURE */ + 964, /* GL_MODELVIEW */ + 1261, /* GL_PROJECTION */ + 1562, /* GL_TEXTURE */ 147, /* GL_COLOR */ 346, /* GL_DEPTH */ - 1480, /* GL_STENCIL */ + 1498, /* GL_STENCIL */ 189, /* GL_COLOR_INDEX */ - 1499, /* GL_STENCIL_INDEX */ - 357, /* GL_DEPTH_COMPONENT */ - 1292, /* GL_RED */ - 591, /* GL_GREEN */ + 1517, /* GL_STENCIL_INDEX */ + 359, /* GL_DEPTH_COMPONENT */ + 1308, /* GL_RED */ + 600, /* GL_GREEN */ 90, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1327, /* GL_RGB */ - 1346, /* GL_RGBA */ - 714, /* GL_LUMINANCE */ - 735, /* GL_LUMINANCE_ALPHA */ + 1345, /* GL_RGB */ + 1364, /* GL_RGBA */ + 724, /* GL_LUMINANCE */ + 745, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1128, /* GL_POINT */ - 684, /* GL_LINE */ - 481, /* GL_FILL */ - 1301, /* GL_RENDER */ - 477, /* GL_FEEDBACK */ - 1404, /* GL_SELECT */ - 483, /* GL_FLAT */ - 1429, /* GL_SMOOTH */ - 664, /* GL_KEEP */ - 1321, /* GL_REPLACE */ - 618, /* GL_INCR */ + 1141, /* GL_POINT */ + 694, /* GL_LINE */ + 485, /* GL_FILL */ + 1317, /* GL_RENDER */ + 481, /* GL_FEEDBACK */ + 1422, /* GL_SELECT */ + 488, /* GL_FLAT */ + 1447, /* GL_SMOOTH */ + 673, /* GL_KEEP */ + 1339, /* GL_REPLACE */ + 627, /* GL_INCR */ 342, /* GL_DECR */ - 1783, /* GL_VENDOR */ - 1318, /* GL_RENDERER */ - 1784, /* GL_VERSION */ - 470, /* GL_EXTENSIONS */ - 1369, /* GL_S */ - 1531, /* GL_T */ - 1281, /* GL_R */ - 1269, /* GL_Q */ - 987, /* GL_MODULATE */ + 1807, /* GL_VENDOR */ + 1336, /* GL_RENDERER */ + 1808, /* GL_VERSION */ + 474, /* GL_EXTENSIONS */ + 1387, /* GL_S */ + 1553, /* GL_T */ + 1296, /* GL_R */ + 1283, /* GL_Q */ + 1000, /* GL_MODULATE */ 341, /* GL_DECAL */ - 1677, /* GL_TEXTURE_ENV_MODE */ - 1676, /* GL_TEXTURE_ENV_COLOR */ - 1675, /* GL_TEXTURE_ENV */ - 471, /* GL_EYE_LINEAR */ - 1034, /* GL_OBJECT_LINEAR */ - 1455, /* GL_SPHERE_MAP */ - 1679, /* GL_TEXTURE_GEN_MODE */ - 1036, /* GL_OBJECT_PLANE */ - 472, /* GL_EYE_PLANE */ - 1002, /* GL_NEAREST */ - 685, /* GL_LINEAR */ - 1006, /* GL_NEAREST_MIPMAP_NEAREST */ - 690, /* GL_LINEAR_MIPMAP_NEAREST */ - 1005, /* GL_NEAREST_MIPMAP_LINEAR */ - 689, /* GL_LINEAR_MIPMAP_LINEAR */ - 1700, /* GL_TEXTURE_MAG_FILTER */ - 1708, /* GL_TEXTURE_MIN_FILTER */ - 1725, /* GL_TEXTURE_WRAP_S */ - 1726, /* GL_TEXTURE_WRAP_T */ + 1699, /* GL_TEXTURE_ENV_MODE */ + 1698, /* GL_TEXTURE_ENV_COLOR */ + 1697, /* GL_TEXTURE_ENV */ + 475, /* GL_EYE_LINEAR */ + 1047, /* GL_OBJECT_LINEAR */ + 1473, /* GL_SPHERE_MAP */ + 1701, /* GL_TEXTURE_GEN_MODE */ + 1049, /* GL_OBJECT_PLANE */ + 476, /* GL_EYE_PLANE */ + 1015, /* GL_NEAREST */ + 695, /* GL_LINEAR */ + 1019, /* GL_NEAREST_MIPMAP_NEAREST */ + 700, /* GL_LINEAR_MIPMAP_NEAREST */ + 1018, /* GL_NEAREST_MIPMAP_LINEAR */ + 699, /* GL_LINEAR_MIPMAP_LINEAR */ + 1722, /* GL_TEXTURE_MAG_FILTER */ + 1730, /* GL_TEXTURE_MIN_FILTER */ + 1748, /* GL_TEXTURE_WRAP_S */ + 1749, /* GL_TEXTURE_WRAP_T */ 126, /* GL_CLAMP */ - 1320, /* GL_REPEAT */ - 1166, /* GL_POLYGON_OFFSET_UNITS */ - 1165, /* GL_POLYGON_OFFSET_POINT */ - 1164, /* GL_POLYGON_OFFSET_LINE */ - 1282, /* GL_R3_G3_B2 */ - 1780, /* GL_V2F */ - 1781, /* GL_V3F */ + 1338, /* GL_REPEAT */ + 1179, /* GL_POLYGON_OFFSET_UNITS */ + 1178, /* GL_POLYGON_OFFSET_POINT */ + 1177, /* GL_POLYGON_OFFSET_LINE */ + 1297, /* GL_R3_G3_B2 */ + 1804, /* GL_V2F */ + 1805, /* GL_V3F */ 123, /* GL_C4UB_V2F */ 124, /* GL_C4UB_V3F */ 121, /* GL_C3F_V3F */ - 999, /* GL_N3F_V3F */ + 1012, /* GL_N3F_V3F */ 122, /* GL_C4F_N3F_V3F */ - 1536, /* GL_T2F_V3F */ - 1538, /* GL_T4F_V4F */ - 1534, /* GL_T2F_C4UB_V3F */ - 1532, /* GL_T2F_C3F_V3F */ - 1535, /* GL_T2F_N3F_V3F */ - 1533, /* GL_T2F_C4F_N3F_V3F */ - 1537, /* GL_T4F_C4F_N3F_V4F */ + 1558, /* GL_T2F_V3F */ + 1560, /* GL_T4F_V4F */ + 1556, /* GL_T2F_C4UB_V3F */ + 1554, /* GL_T2F_C3F_V3F */ + 1557, /* GL_T2F_N3F_V3F */ + 1555, /* GL_T2F_C4F_N3F_V3F */ + 1559, /* GL_T4F_C4F_N3F_V4F */ 139, /* GL_CLIP_PLANE0 */ 140, /* GL_CLIP_PLANE1 */ 141, /* GL_CLIP_PLANE2 */ 142, /* GL_CLIP_PLANE3 */ 143, /* GL_CLIP_PLANE4 */ 144, /* GL_CLIP_PLANE5 */ - 669, /* GL_LIGHT0 */ - 670, /* GL_LIGHT1 */ - 671, /* GL_LIGHT2 */ - 672, /* GL_LIGHT3 */ - 673, /* GL_LIGHT4 */ - 674, /* GL_LIGHT5 */ - 675, /* GL_LIGHT6 */ - 676, /* GL_LIGHT7 */ - 595, /* GL_HINT_BIT */ + 679, /* GL_LIGHT0 */ + 680, /* GL_LIGHT1 */ + 681, /* GL_LIGHT2 */ + 682, /* GL_LIGHT3 */ + 683, /* GL_LIGHT4 */ + 684, /* GL_LIGHT5 */ + 685, /* GL_LIGHT6 */ + 686, /* GL_LIGHT7 */ + 604, /* GL_HINT_BIT */ 277, /* GL_CONSTANT_COLOR */ - 1047, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 1060, /* GL_ONE_MINUS_CONSTANT_COLOR */ 272, /* GL_CONSTANT_ALPHA */ - 1045, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1058, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ - 579, /* GL_FUNC_ADD */ - 935, /* GL_MIN */ - 845, /* GL_MAX */ + 588, /* GL_FUNC_ADD */ + 948, /* GL_MIN */ + 855, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ - 583, /* GL_FUNC_SUBTRACT */ - 581, /* GL_FUNC_REVERSE_SUBTRACT */ + 592, /* GL_FUNC_SUBTRACT */ + 590, /* GL_FUNC_REVERSE_SUBTRACT */ 280, /* GL_CONVOLUTION_1D */ 281, /* GL_CONVOLUTION_2D */ - 1407, /* GL_SEPARABLE_2D */ + 1425, /* GL_SEPARABLE_2D */ 284, /* GL_CONVOLUTION_BORDER_MODE */ 288, /* GL_CONVOLUTION_FILTER_SCALE */ 286, /* GL_CONVOLUTION_FILTER_BIAS */ - 1293, /* GL_REDUCE */ + 1309, /* GL_REDUCE */ 290, /* GL_CONVOLUTION_FORMAT */ 294, /* GL_CONVOLUTION_WIDTH */ 292, /* GL_CONVOLUTION_HEIGHT */ - 860, /* GL_MAX_CONVOLUTION_WIDTH */ - 858, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1205, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1201, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1196, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1192, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1203, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1199, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1194, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1190, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 596, /* GL_HISTOGRAM */ - 1253, /* GL_PROXY_HISTOGRAM */ - 612, /* GL_HISTOGRAM_WIDTH */ - 602, /* GL_HISTOGRAM_FORMAT */ - 608, /* GL_HISTOGRAM_RED_SIZE */ - 604, /* GL_HISTOGRAM_GREEN_SIZE */ - 599, /* GL_HISTOGRAM_BLUE_SIZE */ - 597, /* GL_HISTOGRAM_ALPHA_SIZE */ - 606, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 610, /* GL_HISTOGRAM_SINK */ - 936, /* GL_MINMAX */ - 938, /* GL_MINMAX_FORMAT */ - 940, /* GL_MINMAX_SINK */ - 1539, /* GL_TABLE_TOO_LARGE_EXT */ - 1759, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1770, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1772, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1765, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1761, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1163, /* GL_POLYGON_OFFSET_FILL */ - 1162, /* GL_POLYGON_OFFSET_FACTOR */ - 1161, /* GL_POLYGON_OFFSET_BIAS */ - 1324, /* GL_RESCALE_NORMAL */ + 871, /* GL_MAX_CONVOLUTION_WIDTH */ + 869, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1218, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1214, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1209, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1205, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1216, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1212, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1207, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1203, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 605, /* GL_HISTOGRAM */ + 1267, /* GL_PROXY_HISTOGRAM */ + 621, /* GL_HISTOGRAM_WIDTH */ + 611, /* GL_HISTOGRAM_FORMAT */ + 617, /* GL_HISTOGRAM_RED_SIZE */ + 613, /* GL_HISTOGRAM_GREEN_SIZE */ + 608, /* GL_HISTOGRAM_BLUE_SIZE */ + 606, /* GL_HISTOGRAM_ALPHA_SIZE */ + 615, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 619, /* GL_HISTOGRAM_SINK */ + 949, /* GL_MINMAX */ + 951, /* GL_MINMAX_FORMAT */ + 953, /* GL_MINMAX_SINK */ + 1561, /* GL_TABLE_TOO_LARGE_EXT */ + 1782, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1794, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1796, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1789, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1784, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1176, /* GL_POLYGON_OFFSET_FILL */ + 1175, /* GL_POLYGON_OFFSET_FACTOR */ + 1174, /* GL_POLYGON_OFFSET_BIAS */ + 1342, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 725, /* GL_LUMINANCE4 */ - 731, /* GL_LUMINANCE8 */ - 715, /* GL_LUMINANCE12 */ - 721, /* GL_LUMINANCE16 */ - 726, /* GL_LUMINANCE4_ALPHA4 */ - 729, /* GL_LUMINANCE6_ALPHA2 */ - 732, /* GL_LUMINANCE8_ALPHA8 */ - 718, /* GL_LUMINANCE12_ALPHA4 */ - 716, /* GL_LUMINANCE12_ALPHA12 */ - 722, /* GL_LUMINANCE16_ALPHA16 */ - 637, /* GL_INTENSITY */ - 642, /* GL_INTENSITY4 */ - 644, /* GL_INTENSITY8 */ - 638, /* GL_INTENSITY12 */ - 640, /* GL_INTENSITY16 */ - 1336, /* GL_RGB2_EXT */ - 1337, /* GL_RGB4 */ - 1340, /* GL_RGB5 */ - 1344, /* GL_RGB8 */ - 1328, /* GL_RGB10 */ - 1332, /* GL_RGB12 */ - 1334, /* GL_RGB16 */ - 1351, /* GL_RGBA2 */ - 1353, /* GL_RGBA4 */ - 1341, /* GL_RGB5_A1 */ - 1357, /* GL_RGBA8 */ - 1329, /* GL_RGB10_A2 */ - 1347, /* GL_RGBA12 */ - 1349, /* GL_RGBA16 */ - 1715, /* GL_TEXTURE_RED_SIZE */ - 1685, /* GL_TEXTURE_GREEN_SIZE */ - 1623, /* GL_TEXTURE_BLUE_SIZE */ - 1610, /* GL_TEXTURE_ALPHA_SIZE */ - 1698, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1689, /* GL_TEXTURE_INTENSITY_SIZE */ - 1322, /* GL_REPLACE_EXT */ - 1257, /* GL_PROXY_TEXTURE_1D */ - 1260, /* GL_PROXY_TEXTURE_2D */ - 1721, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1710, /* GL_TEXTURE_PRIORITY */ - 1717, /* GL_TEXTURE_RESIDENT */ - 1613, /* GL_TEXTURE_BINDING_1D */ - 1615, /* GL_TEXTURE_BINDING_2D */ - 1617, /* GL_TEXTURE_BINDING_3D */ - 1083, /* GL_PACK_SKIP_IMAGES */ - 1079, /* GL_PACK_IMAGE_HEIGHT */ - 1752, /* GL_UNPACK_SKIP_IMAGES */ - 1749, /* GL_UNPACK_IMAGE_HEIGHT */ - 1609, /* GL_TEXTURE_3D */ - 1263, /* GL_PROXY_TEXTURE_3D */ - 1672, /* GL_TEXTURE_DEPTH */ - 1724, /* GL_TEXTURE_WRAP_R */ - 846, /* GL_MAX_3D_TEXTURE_SIZE */ - 1785, /* GL_VERTEX_ARRAY */ - 1013, /* GL_NORMAL_ARRAY */ + 735, /* GL_LUMINANCE4 */ + 741, /* GL_LUMINANCE8 */ + 725, /* GL_LUMINANCE12 */ + 731, /* GL_LUMINANCE16 */ + 736, /* GL_LUMINANCE4_ALPHA4 */ + 739, /* GL_LUMINANCE6_ALPHA2 */ + 742, /* GL_LUMINANCE8_ALPHA8 */ + 728, /* GL_LUMINANCE12_ALPHA4 */ + 726, /* GL_LUMINANCE12_ALPHA12 */ + 732, /* GL_LUMINANCE16_ALPHA16 */ + 646, /* GL_INTENSITY */ + 651, /* GL_INTENSITY4 */ + 653, /* GL_INTENSITY8 */ + 647, /* GL_INTENSITY12 */ + 649, /* GL_INTENSITY16 */ + 1354, /* GL_RGB2_EXT */ + 1355, /* GL_RGB4 */ + 1358, /* GL_RGB5 */ + 1362, /* GL_RGB8 */ + 1346, /* GL_RGB10 */ + 1350, /* GL_RGB12 */ + 1352, /* GL_RGB16 */ + 1369, /* GL_RGBA2 */ + 1371, /* GL_RGBA4 */ + 1359, /* GL_RGB5_A1 */ + 1375, /* GL_RGBA8 */ + 1347, /* GL_RGB10_A2 */ + 1365, /* GL_RGBA12 */ + 1367, /* GL_RGBA16 */ + 1737, /* GL_TEXTURE_RED_SIZE */ + 1707, /* GL_TEXTURE_GREEN_SIZE */ + 1645, /* GL_TEXTURE_BLUE_SIZE */ + 1632, /* GL_TEXTURE_ALPHA_SIZE */ + 1720, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1711, /* GL_TEXTURE_INTENSITY_SIZE */ + 1340, /* GL_REPLACE_EXT */ + 1271, /* GL_PROXY_TEXTURE_1D */ + 1274, /* GL_PROXY_TEXTURE_2D */ + 1744, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1732, /* GL_TEXTURE_PRIORITY */ + 1739, /* GL_TEXTURE_RESIDENT */ + 1635, /* GL_TEXTURE_BINDING_1D */ + 1637, /* GL_TEXTURE_BINDING_2D */ + 1639, /* GL_TEXTURE_BINDING_3D */ + 1096, /* GL_PACK_SKIP_IMAGES */ + 1092, /* GL_PACK_IMAGE_HEIGHT */ + 1775, /* GL_UNPACK_SKIP_IMAGES */ + 1772, /* GL_UNPACK_IMAGE_HEIGHT */ + 1631, /* GL_TEXTURE_3D */ + 1277, /* GL_PROXY_TEXTURE_3D */ + 1694, /* GL_TEXTURE_DEPTH */ + 1747, /* GL_TEXTURE_WRAP_R */ + 856, /* GL_MAX_3D_TEXTURE_SIZE */ + 1809, /* GL_VERTEX_ARRAY */ + 1026, /* GL_NORMAL_ARRAY */ 148, /* GL_COLOR_ARRAY */ - 622, /* GL_INDEX_ARRAY */ - 1650, /* GL_TEXTURE_COORD_ARRAY */ - 455, /* GL_EDGE_FLAG_ARRAY */ - 1791, /* GL_VERTEX_ARRAY_SIZE */ - 1793, /* GL_VERTEX_ARRAY_TYPE */ - 1792, /* GL_VERTEX_ARRAY_STRIDE */ - 1018, /* GL_NORMAL_ARRAY_TYPE */ - 1017, /* GL_NORMAL_ARRAY_STRIDE */ + 631, /* GL_INDEX_ARRAY */ + 1672, /* GL_TEXTURE_COORD_ARRAY */ + 459, /* GL_EDGE_FLAG_ARRAY */ + 1815, /* GL_VERTEX_ARRAY_SIZE */ + 1817, /* GL_VERTEX_ARRAY_TYPE */ + 1816, /* GL_VERTEX_ARRAY_STRIDE */ + 1031, /* GL_NORMAL_ARRAY_TYPE */ + 1030, /* GL_NORMAL_ARRAY_STRIDE */ 152, /* GL_COLOR_ARRAY_SIZE */ 154, /* GL_COLOR_ARRAY_TYPE */ 153, /* GL_COLOR_ARRAY_STRIDE */ - 627, /* GL_INDEX_ARRAY_TYPE */ - 626, /* GL_INDEX_ARRAY_STRIDE */ - 1654, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1656, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1655, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 459, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1790, /* GL_VERTEX_ARRAY_POINTER */ - 1016, /* GL_NORMAL_ARRAY_POINTER */ + 636, /* GL_INDEX_ARRAY_TYPE */ + 635, /* GL_INDEX_ARRAY_STRIDE */ + 1676, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1678, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1677, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 463, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1814, /* GL_VERTEX_ARRAY_POINTER */ + 1029, /* GL_NORMAL_ARRAY_POINTER */ 151, /* GL_COLOR_ARRAY_POINTER */ - 625, /* GL_INDEX_ARRAY_POINTER */ - 1653, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 458, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 992, /* GL_MULTISAMPLE */ - 1381, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1383, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1388, /* GL_SAMPLE_COVERAGE */ - 1385, /* GL_SAMPLE_BUFFERS */ - 1376, /* GL_SAMPLES */ - 1392, /* GL_SAMPLE_COVERAGE_VALUE */ - 1390, /* GL_SAMPLE_COVERAGE_INVERT */ + 634, /* GL_INDEX_ARRAY_POINTER */ + 1675, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 462, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 1005, /* GL_MULTISAMPLE */ + 1399, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1401, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1406, /* GL_SAMPLE_COVERAGE */ + 1403, /* GL_SAMPLE_BUFFERS */ + 1394, /* GL_SAMPLES */ + 1410, /* GL_SAMPLE_COVERAGE_VALUE */ + 1408, /* GL_SAMPLE_COVERAGE_INVERT */ 195, /* GL_COLOR_MATRIX */ 197, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 854, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1188, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1184, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1179, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1175, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1186, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1182, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1177, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1173, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1633, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1264, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1635, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 865, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1201, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1197, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1192, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1188, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1199, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1195, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1190, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1186, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1655, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1278, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1657, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 89, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 88, /* GL_BLEND_SRC_ALPHA */ 201, /* GL_COLOR_TABLE */ - 1198, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1181, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1252, /* GL_PROXY_COLOR_TABLE */ - 1256, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1255, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1211, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1194, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1266, /* GL_PROXY_COLOR_TABLE */ + 1270, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1269, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 225, /* GL_COLOR_TABLE_SCALE */ 205, /* GL_COLOR_TABLE_BIAS */ 210, /* GL_COLOR_TABLE_FORMAT */ @@ -4369,380 +4417,380 @@ static const unsigned reduced_enums[1347] = 216, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 868, /* GL_MAX_ELEMENTS_VERTICES */ - 867, /* GL_MAX_ELEMENTS_INDICES */ - 1688, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 879, /* GL_MAX_ELEMENTS_VERTICES */ + 878, /* GL_MAX_ELEMENTS_INDICES */ + 1710, /* GL_TEXTURE_INDEX_SIZE_EXT */ 145, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1145, /* GL_POINT_SIZE_MIN */ - 1141, /* GL_POINT_SIZE_MAX */ - 1135, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1131, /* GL_POINT_DISTANCE_ATTENUATION */ + 1158, /* GL_POINT_SIZE_MIN */ + 1154, /* GL_POINT_SIZE_MAX */ + 1148, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1144, /* GL_POINT_DISTANCE_ATTENUATION */ 127, /* GL_CLAMP_TO_BORDER */ 130, /* GL_CLAMP_TO_EDGE */ - 1709, /* GL_TEXTURE_MIN_LOD */ - 1707, /* GL_TEXTURE_MAX_LOD */ - 1612, /* GL_TEXTURE_BASE_LEVEL */ - 1706, /* GL_TEXTURE_MAX_LEVEL */ - 615, /* GL_IGNORE_BORDER_HP */ + 1731, /* GL_TEXTURE_MIN_LOD */ + 1729, /* GL_TEXTURE_MAX_LOD */ + 1634, /* GL_TEXTURE_BASE_LEVEL */ + 1728, /* GL_TEXTURE_MAX_LEVEL */ + 624, /* GL_IGNORE_BORDER_HP */ 276, /* GL_CONSTANT_BORDER_HP */ - 1323, /* GL_REPLICATE_BORDER_HP */ + 1341, /* GL_REPLICATE_BORDER_HP */ 282, /* GL_CONVOLUTION_BORDER_COLOR */ - 1042, /* GL_OCCLUSION_TEST_HP */ - 1043, /* GL_OCCLUSION_TEST_RESULT_HP */ - 687, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1627, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1629, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1631, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1632, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1630, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1628, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 850, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 851, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1208, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1210, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1207, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1209, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1696, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1697, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1695, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 585, /* GL_GENERATE_MIPMAP */ - 586, /* GL_GENERATE_MIPMAP_HINT */ - 527, /* GL_FOG_OFFSET_SGIX */ - 528, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1641, /* GL_TEXTURE_COMPARE_SGIX */ - 1640, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1692, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1684, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 358, /* GL_DEPTH_COMPONENT16 */ - 361, /* GL_DEPTH_COMPONENT24 */ - 364, /* GL_DEPTH_COMPONENT32 */ + 1055, /* GL_OCCLUSION_TEST_HP */ + 1056, /* GL_OCCLUSION_TEST_RESULT_HP */ + 697, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1649, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1651, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1653, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1654, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1652, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1650, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 860, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 861, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1221, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1223, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1220, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1222, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1718, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1719, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1717, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 594, /* GL_GENERATE_MIPMAP */ + 595, /* GL_GENERATE_MIPMAP_HINT */ + 532, /* GL_FOG_OFFSET_SGIX */ + 533, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1663, /* GL_TEXTURE_COMPARE_SGIX */ + 1662, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1714, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1706, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 360, /* GL_DEPTH_COMPONENT16 */ + 363, /* GL_DEPTH_COMPONENT24 */ + 366, /* GL_DEPTH_COMPONENT32 */ 306, /* GL_CULL_VERTEX_EXT */ 308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1848, /* GL_WRAP_BORDER_SUN */ - 1634, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 680, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1422, /* GL_SINGLE_COLOR */ - 1408, /* GL_SEPARATE_SPECULAR_COLOR */ - 1417, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 538, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - 539, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - 546, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - 541, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - 537, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - 536, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - 540, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - 547, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - 558, /* GL_FRAMEBUFFER_DEFAULT */ - 571, /* GL_FRAMEBUFFER_UNDEFINED */ - 371, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 621, /* GL_INDEX */ - 1758, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1773, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1774, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1771, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1769, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1766, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1764, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1704, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1705, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1703, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 943, /* GL_MIRRORED_REPEAT */ - 1364, /* GL_RGB_S3TC */ - 1339, /* GL_RGB4_S3TC */ - 1362, /* GL_RGBA_S3TC */ - 1356, /* GL_RGBA4_S3TC */ - 1360, /* GL_RGBA_DXT5_S3TC */ - 1354, /* GL_RGBA4_DXT5_S3TC */ + 1872, /* GL_WRAP_BORDER_SUN */ + 1656, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 690, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1440, /* GL_SINGLE_COLOR */ + 1426, /* GL_SEPARATE_SPECULAR_COLOR */ + 1435, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 543, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 544, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 551, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 546, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 542, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 541, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 545, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 552, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 564, /* GL_FRAMEBUFFER_DEFAULT */ + 580, /* GL_FRAMEBUFFER_UNDEFINED */ + 373, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 630, /* GL_INDEX */ + 1781, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1797, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1798, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1795, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1793, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1790, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1788, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1726, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1727, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1725, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 956, /* GL_MIRRORED_REPEAT */ + 1382, /* GL_RGB_S3TC */ + 1357, /* GL_RGB4_S3TC */ + 1380, /* GL_RGBA_S3TC */ + 1374, /* GL_RGBA4_S3TC */ + 1378, /* GL_RGBA_DXT5_S3TC */ + 1372, /* GL_RGBA4_DXT5_S3TC */ 264, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ 259, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ 260, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ 261, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1004, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1003, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 688, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 514, /* GL_FOG_COORDINATE_SOURCE */ - 506, /* GL_FOG_COORD */ - 530, /* GL_FRAGMENT_DEPTH */ + 1017, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 1016, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 698, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 519, /* GL_FOG_COORDINATE_SOURCE */ + 511, /* GL_FOG_COORD */ + 535, /* GL_FRAGMENT_DEPTH */ 312, /* GL_CURRENT_FOG_COORD */ - 513, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 512, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 511, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 508, /* GL_FOG_COORDINATE_ARRAY */ + 518, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 517, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 516, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 513, /* GL_FOG_COORDINATE_ARRAY */ 199, /* GL_COLOR_SUM */ 332, /* GL_CURRENT_SECONDARY_COLOR */ - 1401, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1403, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1402, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1400, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1397, /* GL_SECONDARY_COLOR_ARRAY */ + 1419, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1421, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1420, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1418, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1415, /* GL_SECONDARY_COLOR_ARRAY */ 330, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1541, /* GL_TEXTURE0 */ - 1543, /* GL_TEXTURE1 */ - 1565, /* GL_TEXTURE2 */ - 1587, /* GL_TEXTURE3 */ - 1593, /* GL_TEXTURE4 */ - 1595, /* GL_TEXTURE5 */ - 1597, /* GL_TEXTURE6 */ - 1599, /* GL_TEXTURE7 */ - 1601, /* GL_TEXTURE8 */ - 1603, /* GL_TEXTURE9 */ - 1544, /* GL_TEXTURE10 */ - 1546, /* GL_TEXTURE11 */ - 1548, /* GL_TEXTURE12 */ - 1550, /* GL_TEXTURE13 */ - 1552, /* GL_TEXTURE14 */ - 1554, /* GL_TEXTURE15 */ - 1556, /* GL_TEXTURE16 */ - 1558, /* GL_TEXTURE17 */ - 1560, /* GL_TEXTURE18 */ - 1562, /* GL_TEXTURE19 */ - 1566, /* GL_TEXTURE20 */ - 1568, /* GL_TEXTURE21 */ - 1570, /* GL_TEXTURE22 */ - 1572, /* GL_TEXTURE23 */ - 1574, /* GL_TEXTURE24 */ - 1576, /* GL_TEXTURE25 */ - 1578, /* GL_TEXTURE26 */ - 1580, /* GL_TEXTURE27 */ - 1582, /* GL_TEXTURE28 */ - 1584, /* GL_TEXTURE29 */ - 1588, /* GL_TEXTURE30 */ - 1590, /* GL_TEXTURE31 */ + 1563, /* GL_TEXTURE0 */ + 1565, /* GL_TEXTURE1 */ + 1587, /* GL_TEXTURE2 */ + 1609, /* GL_TEXTURE3 */ + 1615, /* GL_TEXTURE4 */ + 1617, /* GL_TEXTURE5 */ + 1619, /* GL_TEXTURE6 */ + 1621, /* GL_TEXTURE7 */ + 1623, /* GL_TEXTURE8 */ + 1625, /* GL_TEXTURE9 */ + 1566, /* GL_TEXTURE10 */ + 1568, /* GL_TEXTURE11 */ + 1570, /* GL_TEXTURE12 */ + 1572, /* GL_TEXTURE13 */ + 1574, /* GL_TEXTURE14 */ + 1576, /* GL_TEXTURE15 */ + 1578, /* GL_TEXTURE16 */ + 1580, /* GL_TEXTURE17 */ + 1582, /* GL_TEXTURE18 */ + 1584, /* GL_TEXTURE19 */ + 1588, /* GL_TEXTURE20 */ + 1590, /* GL_TEXTURE21 */ + 1592, /* GL_TEXTURE22 */ + 1594, /* GL_TEXTURE23 */ + 1596, /* GL_TEXTURE24 */ + 1598, /* GL_TEXTURE25 */ + 1600, /* GL_TEXTURE26 */ + 1602, /* GL_TEXTURE27 */ + 1604, /* GL_TEXTURE28 */ + 1606, /* GL_TEXTURE29 */ + 1610, /* GL_TEXTURE30 */ + 1612, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 133, /* GL_CLIENT_ACTIVE_TEXTURE */ - 921, /* GL_MAX_TEXTURE_UNITS */ - 1736, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1739, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1741, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1733, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1523, /* GL_SUBTRACT */ - 908, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 934, /* GL_MAX_TEXTURE_UNITS */ + 1759, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1762, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1764, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1756, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1545, /* GL_SUBTRACT */ + 919, /* GL_MAX_RENDERBUFFER_SIZE */ 247, /* GL_COMPRESSED_ALPHA */ 251, /* GL_COMPRESSED_LUMINANCE */ 252, /* GL_COMPRESSED_LUMINANCE_ALPHA */ 249, /* GL_COMPRESSED_INTENSITY */ 255, /* GL_COMPRESSED_RGB */ 256, /* GL_COMPRESSED_RGBA */ - 1648, /* GL_TEXTURE_COMPRESSION_HINT */ - 1713, /* GL_TEXTURE_RECTANGLE_ARB */ - 1620, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1267, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 906, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 370, /* GL_DEPTH_STENCIL */ - 1762, /* GL_UNSIGNED_INT_24_8 */ - 917, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1702, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 918, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1678, /* GL_TEXTURE_FILTER_CONTROL */ - 1693, /* GL_TEXTURE_LOD_BIAS */ + 1670, /* GL_TEXTURE_COMPRESSION_HINT */ + 1735, /* GL_TEXTURE_RECTANGLE_ARB */ + 1642, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1281, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 917, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 372, /* GL_DEPTH_STENCIL */ + 1785, /* GL_UNSIGNED_INT_24_8 */ + 930, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1724, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 931, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1700, /* GL_TEXTURE_FILTER_CONTROL */ + 1715, /* GL_TEXTURE_LOD_BIAS */ 232, /* GL_COMBINE4 */ - 911, /* GL_MAX_SHININESS_NV */ - 912, /* GL_MAX_SPOT_EXPONENT_NV */ - 619, /* GL_INCR_WRAP */ + 924, /* GL_MAX_SHININESS_NV */ + 925, /* GL_MAX_SPOT_EXPONENT_NV */ + 628, /* GL_INCR_WRAP */ 343, /* GL_DECR_WRAP */ - 963, /* GL_MODELVIEW1_ARB */ - 1019, /* GL_NORMAL_MAP */ - 1298, /* GL_REFLECTION_MAP */ - 1657, /* GL_TEXTURE_CUBE_MAP */ - 1618, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1665, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1659, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1667, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1661, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1669, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1663, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1265, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 862, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 998, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 522, /* GL_FOG_DISTANCE_MODE_NV */ - 474, /* GL_EYE_RADIAL_NV */ - 473, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 976, /* GL_MODELVIEW1_ARB */ + 1032, /* GL_NORMAL_MAP */ + 1314, /* GL_REFLECTION_MAP */ + 1679, /* GL_TEXTURE_CUBE_MAP */ + 1640, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1687, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1681, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1689, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1683, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1691, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1685, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1279, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 873, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 1011, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 527, /* GL_FOG_DISTANCE_MODE_NV */ + 478, /* GL_EYE_RADIAL_NV */ + 477, /* GL_EYE_PLANE_ABSOLUTE_NV */ 231, /* GL_COMBINE */ 238, /* GL_COMBINE_RGB */ 233, /* GL_COMBINE_ALPHA */ - 1365, /* GL_RGB_SCALE */ + 1383, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 647, /* GL_INTERPOLATE */ + 656, /* GL_INTERPOLATE */ 271, /* GL_CONSTANT */ - 1214, /* GL_PRIMARY_COLOR */ - 1211, /* GL_PREVIOUS */ - 1437, /* GL_SOURCE0_RGB */ - 1443, /* GL_SOURCE1_RGB */ - 1449, /* GL_SOURCE2_RGB */ - 1453, /* GL_SOURCE3_RGB_NV */ - 1434, /* GL_SOURCE0_ALPHA */ - 1440, /* GL_SOURCE1_ALPHA */ - 1446, /* GL_SOURCE2_ALPHA */ - 1452, /* GL_SOURCE3_ALPHA_NV */ - 1056, /* GL_OPERAND0_RGB */ - 1062, /* GL_OPERAND1_RGB */ - 1068, /* GL_OPERAND2_RGB */ - 1072, /* GL_OPERAND3_RGB_NV */ - 1053, /* GL_OPERAND0_ALPHA */ - 1059, /* GL_OPERAND1_ALPHA */ - 1065, /* GL_OPERAND2_ALPHA */ - 1071, /* GL_OPERAND3_ALPHA_NV */ - 1786, /* GL_VERTEX_ARRAY_BINDING */ - 1711, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - 1712, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - 1852, /* GL_YCBCR_422_APPLE */ - 1775, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1777, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1720, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - 1514, /* GL_STORAGE_PRIVATE_APPLE */ - 1513, /* GL_STORAGE_CACHED_APPLE */ - 1515, /* GL_STORAGE_SHARED_APPLE */ - 1424, /* GL_SLICE_ACCUM_SUN */ - 1273, /* GL_QUAD_MESH_SUN */ - 1745, /* GL_TRIANGLE_MESH_SUN */ - 1825, /* GL_VERTEX_PROGRAM_ARB */ - 1836, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1812, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1818, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1820, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1822, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 1227, /* GL_PRIMARY_COLOR */ + 1224, /* GL_PREVIOUS */ + 1455, /* GL_SOURCE0_RGB */ + 1461, /* GL_SOURCE1_RGB */ + 1467, /* GL_SOURCE2_RGB */ + 1471, /* GL_SOURCE3_RGB_NV */ + 1452, /* GL_SOURCE0_ALPHA */ + 1458, /* GL_SOURCE1_ALPHA */ + 1464, /* GL_SOURCE2_ALPHA */ + 1470, /* GL_SOURCE3_ALPHA_NV */ + 1069, /* GL_OPERAND0_RGB */ + 1075, /* GL_OPERAND1_RGB */ + 1081, /* GL_OPERAND2_RGB */ + 1085, /* GL_OPERAND3_RGB_NV */ + 1066, /* GL_OPERAND0_ALPHA */ + 1072, /* GL_OPERAND1_ALPHA */ + 1078, /* GL_OPERAND2_ALPHA */ + 1084, /* GL_OPERAND3_ALPHA_NV */ + 1810, /* GL_VERTEX_ARRAY_BINDING */ + 1733, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + 1734, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + 1876, /* GL_YCBCR_422_APPLE */ + 1799, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1801, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1743, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + 1536, /* GL_STORAGE_PRIVATE_APPLE */ + 1535, /* GL_STORAGE_CACHED_APPLE */ + 1537, /* GL_STORAGE_SHARED_APPLE */ + 1442, /* GL_SLICE_ACCUM_SUN */ + 1288, /* GL_QUAD_MESH_SUN */ + 1768, /* GL_TRIANGLE_MESH_SUN */ + 1849, /* GL_VERTEX_PROGRAM_ARB */ + 1860, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1836, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1842, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1844, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1846, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ 334, /* GL_CURRENT_VERTEX_ATTRIB */ - 1227, /* GL_PROGRAM_LENGTH_ARB */ - 1241, /* GL_PROGRAM_STRING_ARB */ - 985, /* GL_MODELVIEW_PROJECTION_NV */ - 614, /* GL_IDENTITY_NV */ - 661, /* GL_INVERSE_NV */ - 1738, /* GL_TRANSPOSE_NV */ - 662, /* GL_INVERSE_TRANSPOSE_NV */ - 892, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 891, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 799, /* GL_MATRIX0_NV */ - 811, /* GL_MATRIX1_NV */ - 823, /* GL_MATRIX2_NV */ - 827, /* GL_MATRIX3_NV */ - 829, /* GL_MATRIX4_NV */ - 831, /* GL_MATRIX5_NV */ - 833, /* GL_MATRIX6_NV */ - 835, /* GL_MATRIX7_NV */ + 1240, /* GL_PROGRAM_LENGTH_ARB */ + 1254, /* GL_PROGRAM_STRING_ARB */ + 998, /* GL_MODELVIEW_PROJECTION_NV */ + 623, /* GL_IDENTITY_NV */ + 670, /* GL_INVERSE_NV */ + 1761, /* GL_TRANSPOSE_NV */ + 671, /* GL_INVERSE_TRANSPOSE_NV */ + 903, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 902, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 809, /* GL_MATRIX0_NV */ + 821, /* GL_MATRIX1_NV */ + 833, /* GL_MATRIX2_NV */ + 837, /* GL_MATRIX3_NV */ + 839, /* GL_MATRIX4_NV */ + 841, /* GL_MATRIX5_NV */ + 843, /* GL_MATRIX6_NV */ + 845, /* GL_MATRIX7_NV */ 318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 315, /* GL_CURRENT_MATRIX_ARB */ - 1828, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1831, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1239, /* GL_PROGRAM_PARAMETER_NV */ - 1816, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1243, /* GL_PROGRAM_TARGET_NV */ - 1240, /* GL_PROGRAM_RESIDENT_NV */ - 1730, /* GL_TRACK_MATRIX_NV */ - 1731, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1826, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1221, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 355, /* GL_DEPTH_CLAMP_NV */ - 1794, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1801, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1802, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1803, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1804, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1805, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1806, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1807, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1808, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1809, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1795, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1796, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1797, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1798, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1799, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1800, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 747, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 754, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 755, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 756, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 757, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 748, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 749, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 750, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 751, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 752, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 753, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 774, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 781, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 782, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 783, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 784, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1220, /* GL_PROGRAM_BINDING_ARB */ - 788, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 789, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 775, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 776, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 777, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 778, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 779, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 780, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1646, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1643, /* GL_TEXTURE_COMPRESSED */ - 1024, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 1852, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1855, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1252, /* GL_PROGRAM_PARAMETER_NV */ + 1840, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1256, /* GL_PROGRAM_TARGET_NV */ + 1253, /* GL_PROGRAM_RESIDENT_NV */ + 1753, /* GL_TRACK_MATRIX_NV */ + 1754, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1850, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1234, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 356, /* GL_DEPTH_CLAMP */ + 1818, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1825, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1826, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1827, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1828, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1829, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1830, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1831, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1832, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1833, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1819, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1820, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1821, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1822, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1823, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1824, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 757, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 764, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 765, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 766, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 767, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 768, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 769, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 770, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 771, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 772, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 759, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 760, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 761, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 762, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 763, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 784, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 791, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 792, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 793, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 794, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 795, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 796, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1233, /* GL_PROGRAM_BINDING_ARB */ + 798, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 799, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 786, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 787, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 788, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 789, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 790, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1668, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1665, /* GL_TEXTURE_COMPRESSED */ + 1037, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ 269, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 933, /* GL_MAX_VERTEX_UNITS_ARB */ + 946, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1847, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1824, /* GL_VERTEX_BLEND_ARB */ + 1871, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1848, /* GL_VERTEX_BLEND_ARB */ 336, /* GL_CURRENT_WEIGHT_ARB */ - 1846, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1845, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1844, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1843, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1840, /* GL_WEIGHT_ARRAY_ARB */ - 383, /* GL_DOT3_RGB */ - 384, /* GL_DOT3_RGBA */ + 1870, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1869, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1868, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1867, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1864, /* GL_WEIGHT_ARRAY_ARB */ + 386, /* GL_DOT3_RGB */ + 387, /* GL_DOT3_RGBA */ 263, /* GL_COMPRESSED_RGB_FXT1_3DFX */ 258, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 993, /* GL_MULTISAMPLE_3DFX */ - 1386, /* GL_SAMPLE_BUFFERS_3DFX */ - 1377, /* GL_SAMPLES_3DFX */ - 974, /* GL_MODELVIEW2_ARB */ - 977, /* GL_MODELVIEW3_ARB */ - 978, /* GL_MODELVIEW4_ARB */ - 979, /* GL_MODELVIEW5_ARB */ - 980, /* GL_MODELVIEW6_ARB */ - 981, /* GL_MODELVIEW7_ARB */ - 982, /* GL_MODELVIEW8_ARB */ - 983, /* GL_MODELVIEW9_ARB */ - 953, /* GL_MODELVIEW10_ARB */ - 954, /* GL_MODELVIEW11_ARB */ - 955, /* GL_MODELVIEW12_ARB */ - 956, /* GL_MODELVIEW13_ARB */ - 957, /* GL_MODELVIEW14_ARB */ - 958, /* GL_MODELVIEW15_ARB */ - 959, /* GL_MODELVIEW16_ARB */ - 960, /* GL_MODELVIEW17_ARB */ - 961, /* GL_MODELVIEW18_ARB */ - 962, /* GL_MODELVIEW19_ARB */ - 964, /* GL_MODELVIEW20_ARB */ - 965, /* GL_MODELVIEW21_ARB */ - 966, /* GL_MODELVIEW22_ARB */ - 967, /* GL_MODELVIEW23_ARB */ - 968, /* GL_MODELVIEW24_ARB */ - 969, /* GL_MODELVIEW25_ARB */ - 970, /* GL_MODELVIEW26_ARB */ - 971, /* GL_MODELVIEW27_ARB */ - 972, /* GL_MODELVIEW28_ARB */ - 973, /* GL_MODELVIEW29_ARB */ - 975, /* GL_MODELVIEW30_ARB */ - 976, /* GL_MODELVIEW31_ARB */ - 388, /* GL_DOT3_RGB_EXT */ - 386, /* GL_DOT3_RGBA_EXT */ - 947, /* GL_MIRROR_CLAMP_EXT */ - 950, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 988, /* GL_MODULATE_ADD_ATI */ - 989, /* GL_MODULATE_SIGNED_ADD_ATI */ - 990, /* GL_MODULATE_SUBTRACT_ATI */ - 1853, /* GL_YCBCR_MESA */ - 1080, /* GL_PACK_INVERT_MESA */ + 1006, /* GL_MULTISAMPLE_3DFX */ + 1404, /* GL_SAMPLE_BUFFERS_3DFX */ + 1395, /* GL_SAMPLES_3DFX */ + 987, /* GL_MODELVIEW2_ARB */ + 990, /* GL_MODELVIEW3_ARB */ + 991, /* GL_MODELVIEW4_ARB */ + 992, /* GL_MODELVIEW5_ARB */ + 993, /* GL_MODELVIEW6_ARB */ + 994, /* GL_MODELVIEW7_ARB */ + 995, /* GL_MODELVIEW8_ARB */ + 996, /* GL_MODELVIEW9_ARB */ + 966, /* GL_MODELVIEW10_ARB */ + 967, /* GL_MODELVIEW11_ARB */ + 968, /* GL_MODELVIEW12_ARB */ + 969, /* GL_MODELVIEW13_ARB */ + 970, /* GL_MODELVIEW14_ARB */ + 971, /* GL_MODELVIEW15_ARB */ + 972, /* GL_MODELVIEW16_ARB */ + 973, /* GL_MODELVIEW17_ARB */ + 974, /* GL_MODELVIEW18_ARB */ + 975, /* GL_MODELVIEW19_ARB */ + 977, /* GL_MODELVIEW20_ARB */ + 978, /* GL_MODELVIEW21_ARB */ + 979, /* GL_MODELVIEW22_ARB */ + 980, /* GL_MODELVIEW23_ARB */ + 981, /* GL_MODELVIEW24_ARB */ + 982, /* GL_MODELVIEW25_ARB */ + 983, /* GL_MODELVIEW26_ARB */ + 984, /* GL_MODELVIEW27_ARB */ + 985, /* GL_MODELVIEW28_ARB */ + 986, /* GL_MODELVIEW29_ARB */ + 988, /* GL_MODELVIEW30_ARB */ + 989, /* GL_MODELVIEW31_ARB */ + 391, /* GL_DOT3_RGB_EXT */ + 389, /* GL_DOT3_RGBA_EXT */ + 960, /* GL_MIRROR_CLAMP_EXT */ + 963, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 1001, /* GL_MODULATE_ADD_ATI */ + 1002, /* GL_MODULATE_SIGNED_ADD_ATI */ + 1003, /* GL_MODULATE_SUBTRACT_ATI */ + 1877, /* GL_YCBCR_MESA */ + 1093, /* GL_PACK_INVERT_MESA */ 339, /* GL_DEBUG_OBJECT_MESA */ 340, /* GL_DEBUG_PRINT_MESA */ 338, /* GL_DEBUG_ASSERT_MESA */ @@ -4752,292 +4800,292 @@ static const unsigned reduced_enums[1347] = 117, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ 115, /* GL_BUMP_NUM_TEX_UNITS_ATI */ 119, /* GL_BUMP_TEX_UNITS_ATI */ - 447, /* GL_DUDV_ATI */ - 446, /* GL_DU8DV8_ATI */ + 451, /* GL_DUDV_ATI */ + 450, /* GL_DU8DV8_ATI */ 114, /* GL_BUMP_ENVMAP_ATI */ 118, /* GL_BUMP_TARGET_ATI */ - 1485, /* GL_STENCIL_BACK_FUNC */ - 1483, /* GL_STENCIL_BACK_FAIL */ - 1487, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1489, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 531, /* GL_FRAGMENT_PROGRAM_ARB */ - 1218, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1246, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1245, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1230, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1236, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1235, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 881, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 904, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 903, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 894, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 900, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 899, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 864, /* GL_MAX_DRAW_BUFFERS */ - 392, /* GL_DRAW_BUFFER0 */ - 395, /* GL_DRAW_BUFFER1 */ - 416, /* GL_DRAW_BUFFER2 */ - 419, /* GL_DRAW_BUFFER3 */ - 422, /* GL_DRAW_BUFFER4 */ - 425, /* GL_DRAW_BUFFER5 */ - 428, /* GL_DRAW_BUFFER6 */ - 431, /* GL_DRAW_BUFFER7 */ - 434, /* GL_DRAW_BUFFER8 */ - 437, /* GL_DRAW_BUFFER9 */ - 396, /* GL_DRAW_BUFFER10 */ - 399, /* GL_DRAW_BUFFER11 */ - 402, /* GL_DRAW_BUFFER12 */ - 405, /* GL_DRAW_BUFFER13 */ - 408, /* GL_DRAW_BUFFER14 */ - 411, /* GL_DRAW_BUFFER15 */ + 1503, /* GL_STENCIL_BACK_FUNC */ + 1501, /* GL_STENCIL_BACK_FAIL */ + 1505, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1507, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 536, /* GL_FRAGMENT_PROGRAM_ARB */ + 1231, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1259, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1258, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1243, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1249, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1248, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 892, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 915, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 914, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 905, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 911, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 910, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 875, /* GL_MAX_DRAW_BUFFERS */ + 395, /* GL_DRAW_BUFFER0 */ + 398, /* GL_DRAW_BUFFER1 */ + 419, /* GL_DRAW_BUFFER2 */ + 422, /* GL_DRAW_BUFFER3 */ + 425, /* GL_DRAW_BUFFER4 */ + 428, /* GL_DRAW_BUFFER5 */ + 431, /* GL_DRAW_BUFFER6 */ + 434, /* GL_DRAW_BUFFER7 */ + 437, /* GL_DRAW_BUFFER8 */ + 440, /* GL_DRAW_BUFFER9 */ + 399, /* GL_DRAW_BUFFER10 */ + 402, /* GL_DRAW_BUFFER11 */ + 405, /* GL_DRAW_BUFFER12 */ + 408, /* GL_DRAW_BUFFER13 */ + 411, /* GL_DRAW_BUFFER14 */ + 414, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 844, /* GL_MATRIX_PALETTE_ARB */ - 875, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 878, /* GL_MAX_PALETTE_MATRICES_ARB */ + 854, /* GL_MATRIX_PALETTE_ARB */ + 886, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 889, /* GL_MAX_PALETTE_MATRICES_ARB */ 321, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 838, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 848, /* GL_MATRIX_INDEX_ARRAY_ARB */ 316, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 840, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 842, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 841, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 839, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1673, /* GL_TEXTURE_DEPTH_SIZE */ - 376, /* GL_DEPTH_TEXTURE_MODE */ - 1638, /* GL_TEXTURE_COMPARE_MODE */ - 1636, /* GL_TEXTURE_COMPARE_FUNC */ + 850, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 852, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 851, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 849, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1695, /* GL_TEXTURE_DEPTH_SIZE */ + 379, /* GL_DEPTH_TEXTURE_MODE */ + 1660, /* GL_TEXTURE_COMPARE_MODE */ + 1658, /* GL_TEXTURE_COMPARE_FUNC */ 242, /* GL_COMPARE_R_TO_TEXTURE */ - 1152, /* GL_POINT_SPRITE */ + 1165, /* GL_POINT_SPRITE */ 296, /* GL_COORD_REPLACE */ - 1156, /* GL_POINT_SPRITE_R_MODE_NV */ - 1275, /* GL_QUERY_COUNTER_BITS */ + 1169, /* GL_POINT_SPRITE_R_MODE_NV */ + 1290, /* GL_QUERY_COUNTER_BITS */ 323, /* GL_CURRENT_QUERY */ - 1277, /* GL_QUERY_RESULT */ - 1279, /* GL_QUERY_RESULT_AVAILABLE */ - 927, /* GL_MAX_VERTEX_ATTRIBS */ - 1814, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 374, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 373, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 913, /* GL_MAX_TEXTURE_COORDS */ - 915, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1223, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1225, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1224, /* GL_PROGRAM_FORMAT_ARB */ - 1722, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 353, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 352, /* GL_DEPTH_BOUNDS_EXT */ + 1292, /* GL_QUERY_RESULT */ + 1294, /* GL_QUERY_RESULT_AVAILABLE */ + 940, /* GL_MAX_VERTEX_ATTRIBS */ + 1838, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 377, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 376, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 926, /* GL_MAX_TEXTURE_COORDS */ + 928, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1236, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1238, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1237, /* GL_PROGRAM_FORMAT_ARB */ + 1745, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 354, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 353, /* GL_DEPTH_BOUNDS_EXT */ 53, /* GL_ARRAY_BUFFER */ - 460, /* GL_ELEMENT_ARRAY_BUFFER */ + 464, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ - 461, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1788, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1014, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 465, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1812, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1027, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 149, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 623, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1651, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 456, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1398, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 509, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1841, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1810, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1226, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 887, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1232, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 896, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1244, /* GL_PROGRAM_TEMPORARIES_ARB */ - 902, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1234, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 898, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1238, /* GL_PROGRAM_PARAMETERS_ARB */ - 901, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1233, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 897, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1219, /* GL_PROGRAM_ATTRIBS_ARB */ - 882, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1231, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 895, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1217, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 880, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1229, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 893, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 888, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 884, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1247, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1735, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1288, /* GL_READ_ONLY */ - 1849, /* GL_WRITE_ONLY */ - 1290, /* GL_READ_WRITE */ + 632, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1673, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 460, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1416, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 514, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1865, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1834, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1239, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 898, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1245, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 907, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1257, /* GL_PROGRAM_TEMPORARIES_ARB */ + 913, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1247, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 909, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1251, /* GL_PROGRAM_PARAMETERS_ARB */ + 912, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1246, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 908, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1232, /* GL_PROGRAM_ATTRIBS_ARB */ + 893, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1244, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 906, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1230, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 891, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1242, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 904, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 899, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 895, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1260, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1758, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1304, /* GL_READ_ONLY */ + 1873, /* GL_WRITE_ONLY */ + 1306, /* GL_READ_WRITE */ 102, /* GL_BUFFER_ACCESS */ 105, /* GL_BUFFER_MAPPED */ 107, /* GL_BUFFER_MAP_POINTER */ - 1729, /* GL_TIME_ELAPSED_EXT */ - 798, /* GL_MATRIX0_ARB */ - 810, /* GL_MATRIX1_ARB */ - 822, /* GL_MATRIX2_ARB */ - 826, /* GL_MATRIX3_ARB */ - 828, /* GL_MATRIX4_ARB */ - 830, /* GL_MATRIX5_ARB */ - 832, /* GL_MATRIX6_ARB */ - 834, /* GL_MATRIX7_ARB */ - 836, /* GL_MATRIX8_ARB */ - 837, /* GL_MATRIX9_ARB */ - 800, /* GL_MATRIX10_ARB */ - 801, /* GL_MATRIX11_ARB */ - 802, /* GL_MATRIX12_ARB */ - 803, /* GL_MATRIX13_ARB */ - 804, /* GL_MATRIX14_ARB */ - 805, /* GL_MATRIX15_ARB */ - 806, /* GL_MATRIX16_ARB */ - 807, /* GL_MATRIX17_ARB */ - 808, /* GL_MATRIX18_ARB */ - 809, /* GL_MATRIX19_ARB */ - 812, /* GL_MATRIX20_ARB */ - 813, /* GL_MATRIX21_ARB */ - 814, /* GL_MATRIX22_ARB */ - 815, /* GL_MATRIX23_ARB */ - 816, /* GL_MATRIX24_ARB */ - 817, /* GL_MATRIX25_ARB */ - 818, /* GL_MATRIX26_ARB */ - 819, /* GL_MATRIX27_ARB */ - 820, /* GL_MATRIX28_ARB */ - 821, /* GL_MATRIX29_ARB */ - 824, /* GL_MATRIX30_ARB */ - 825, /* GL_MATRIX31_ARB */ - 1518, /* GL_STREAM_DRAW */ - 1520, /* GL_STREAM_READ */ - 1516, /* GL_STREAM_COPY */ - 1476, /* GL_STATIC_DRAW */ - 1478, /* GL_STATIC_READ */ - 1474, /* GL_STATIC_COPY */ - 450, /* GL_DYNAMIC_DRAW */ - 452, /* GL_DYNAMIC_READ */ - 448, /* GL_DYNAMIC_COPY */ - 1120, /* GL_PIXEL_PACK_BUFFER */ - 1124, /* GL_PIXEL_UNPACK_BUFFER */ - 1121, /* GL_PIXEL_PACK_BUFFER_BINDING */ - 1125, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 1752, /* GL_TIME_ELAPSED_EXT */ + 808, /* GL_MATRIX0_ARB */ + 820, /* GL_MATRIX1_ARB */ + 832, /* GL_MATRIX2_ARB */ + 836, /* GL_MATRIX3_ARB */ + 838, /* GL_MATRIX4_ARB */ + 840, /* GL_MATRIX5_ARB */ + 842, /* GL_MATRIX6_ARB */ + 844, /* GL_MATRIX7_ARB */ + 846, /* GL_MATRIX8_ARB */ + 847, /* GL_MATRIX9_ARB */ + 810, /* GL_MATRIX10_ARB */ + 811, /* GL_MATRIX11_ARB */ + 812, /* GL_MATRIX12_ARB */ + 813, /* GL_MATRIX13_ARB */ + 814, /* GL_MATRIX14_ARB */ + 815, /* GL_MATRIX15_ARB */ + 816, /* GL_MATRIX16_ARB */ + 817, /* GL_MATRIX17_ARB */ + 818, /* GL_MATRIX18_ARB */ + 819, /* GL_MATRIX19_ARB */ + 822, /* GL_MATRIX20_ARB */ + 823, /* GL_MATRIX21_ARB */ + 824, /* GL_MATRIX22_ARB */ + 825, /* GL_MATRIX23_ARB */ + 826, /* GL_MATRIX24_ARB */ + 827, /* GL_MATRIX25_ARB */ + 828, /* GL_MATRIX26_ARB */ + 829, /* GL_MATRIX27_ARB */ + 830, /* GL_MATRIX28_ARB */ + 831, /* GL_MATRIX29_ARB */ + 834, /* GL_MATRIX30_ARB */ + 835, /* GL_MATRIX31_ARB */ + 1540, /* GL_STREAM_DRAW */ + 1542, /* GL_STREAM_READ */ + 1538, /* GL_STREAM_COPY */ + 1494, /* GL_STATIC_DRAW */ + 1496, /* GL_STATIC_READ */ + 1492, /* GL_STATIC_COPY */ + 454, /* GL_DYNAMIC_DRAW */ + 456, /* GL_DYNAMIC_READ */ + 452, /* GL_DYNAMIC_COPY */ + 1133, /* GL_PIXEL_PACK_BUFFER */ + 1137, /* GL_PIXEL_UNPACK_BUFFER */ + 1134, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1138, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ 347, /* GL_DEPTH24_STENCIL8 */ - 1719, /* GL_TEXTURE_STENCIL_SIZE */ - 1671, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - 883, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 886, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 890, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 889, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 847, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1509, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1741, /* GL_TEXTURE_STENCIL_SIZE */ + 1693, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + 894, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 897, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 901, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 900, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 857, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1531, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 948, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1379, /* GL_SAMPLES_PASSED */ + 961, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1397, /* GL_SAMPLES_PASSED */ 109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ 104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */ - 532, /* GL_FRAGMENT_SHADER */ - 1834, /* GL_VERTEX_SHADER */ - 1237, /* GL_PROGRAM_OBJECT_ARB */ - 1411, /* GL_SHADER_OBJECT_ARB */ - 871, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 931, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 925, /* GL_MAX_VARYING_FLOATS */ - 929, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 856, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1040, /* GL_OBJECT_TYPE_ARB */ - 1413, /* GL_SHADER_TYPE */ - 497, /* GL_FLOAT_VEC2 */ - 499, /* GL_FLOAT_VEC3 */ - 501, /* GL_FLOAT_VEC4 */ - 650, /* GL_INT_VEC2 */ - 652, /* GL_INT_VEC3 */ - 654, /* GL_INT_VEC4 */ + 537, /* GL_FRAGMENT_SHADER */ + 1858, /* GL_VERTEX_SHADER */ + 1250, /* GL_PROGRAM_OBJECT_ARB */ + 1429, /* GL_SHADER_OBJECT_ARB */ + 882, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 944, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 938, /* GL_MAX_VARYING_FLOATS */ + 942, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 867, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1053, /* GL_OBJECT_TYPE_ARB */ + 1431, /* GL_SHADER_TYPE */ + 502, /* GL_FLOAT_VEC2 */ + 504, /* GL_FLOAT_VEC3 */ + 506, /* GL_FLOAT_VEC4 */ + 659, /* GL_INT_VEC2 */ + 661, /* GL_INT_VEC3 */ + 663, /* GL_INT_VEC4 */ 94, /* GL_BOOL */ 96, /* GL_BOOL_VEC2 */ 98, /* GL_BOOL_VEC3 */ 100, /* GL_BOOL_VEC4 */ - 485, /* GL_FLOAT_MAT2 */ - 489, /* GL_FLOAT_MAT3 */ - 493, /* GL_FLOAT_MAT4 */ - 1370, /* GL_SAMPLER_1D */ - 1372, /* GL_SAMPLER_2D */ - 1374, /* GL_SAMPLER_3D */ - 1375, /* GL_SAMPLER_CUBE */ - 1371, /* GL_SAMPLER_1D_SHADOW */ - 1373, /* GL_SAMPLER_2D_SHADOW */ - 487, /* GL_FLOAT_MAT2x3 */ - 488, /* GL_FLOAT_MAT2x4 */ - 491, /* GL_FLOAT_MAT3x2 */ - 492, /* GL_FLOAT_MAT3x4 */ - 495, /* GL_FLOAT_MAT4x2 */ - 496, /* GL_FLOAT_MAT4x3 */ + 490, /* GL_FLOAT_MAT2 */ + 494, /* GL_FLOAT_MAT3 */ + 498, /* GL_FLOAT_MAT4 */ + 1388, /* GL_SAMPLER_1D */ + 1390, /* GL_SAMPLER_2D */ + 1392, /* GL_SAMPLER_3D */ + 1393, /* GL_SAMPLER_CUBE */ + 1389, /* GL_SAMPLER_1D_SHADOW */ + 1391, /* GL_SAMPLER_2D_SHADOW */ + 492, /* GL_FLOAT_MAT2x3 */ + 493, /* GL_FLOAT_MAT2x4 */ + 496, /* GL_FLOAT_MAT3x2 */ + 497, /* GL_FLOAT_MAT3x4 */ + 500, /* GL_FLOAT_MAT4x2 */ + 501, /* GL_FLOAT_MAT4x3 */ 345, /* GL_DELETE_STATUS */ 246, /* GL_COMPILE_STATUS */ - 705, /* GL_LINK_STATUS */ - 1782, /* GL_VALIDATE_STATUS */ - 635, /* GL_INFO_LOG_LENGTH */ + 715, /* GL_LINK_STATUS */ + 1806, /* GL_VALIDATE_STATUS */ + 644, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1412, /* GL_SHADER_SOURCE_LENGTH */ + 1430, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 534, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1415, /* GL_SHADING_LANGUAGE_VERSION */ + 539, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1433, /* GL_SHADING_LANGUAGE_VERSION */ 322, /* GL_CURRENT_PROGRAM */ - 1089, /* GL_PALETTE4_RGB8_OES */ - 1091, /* GL_PALETTE4_RGBA8_OES */ - 1087, /* GL_PALETTE4_R5_G6_B5_OES */ - 1090, /* GL_PALETTE4_RGBA4_OES */ - 1088, /* GL_PALETTE4_RGB5_A1_OES */ - 1094, /* GL_PALETTE8_RGB8_OES */ - 1096, /* GL_PALETTE8_RGBA8_OES */ - 1092, /* GL_PALETTE8_R5_G6_B5_OES */ - 1095, /* GL_PALETTE8_RGBA4_OES */ - 1093, /* GL_PALETTE8_RGB5_A1_OES */ - 617, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 616, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1767, /* GL_UNSIGNED_NORMALIZED */ - 1606, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1258, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1608, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1261, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1614, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1616, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 1468, /* GL_SRGB */ - 1469, /* GL_SRGB8 */ - 1471, /* GL_SRGB_ALPHA */ - 1470, /* GL_SRGB8_ALPHA8 */ - 1428, /* GL_SLUMINANCE_ALPHA */ - 1427, /* GL_SLUMINANCE8_ALPHA8 */ - 1425, /* GL_SLUMINANCE */ - 1426, /* GL_SLUMINANCE8 */ + 1102, /* GL_PALETTE4_RGB8_OES */ + 1104, /* GL_PALETTE4_RGBA8_OES */ + 1100, /* GL_PALETTE4_R5_G6_B5_OES */ + 1103, /* GL_PALETTE4_RGBA4_OES */ + 1101, /* GL_PALETTE4_RGB5_A1_OES */ + 1107, /* GL_PALETTE8_RGB8_OES */ + 1109, /* GL_PALETTE8_RGBA8_OES */ + 1105, /* GL_PALETTE8_R5_G6_B5_OES */ + 1108, /* GL_PALETTE8_RGBA4_OES */ + 1106, /* GL_PALETTE8_RGB5_A1_OES */ + 626, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 625, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1791, /* GL_UNSIGNED_NORMALIZED */ + 1628, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1272, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1630, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1275, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1636, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1638, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1486, /* GL_SRGB */ + 1487, /* GL_SRGB8 */ + 1489, /* GL_SRGB_ALPHA */ + 1488, /* GL_SRGB8_ALPHA8 */ + 1446, /* GL_SLUMINANCE_ALPHA */ + 1445, /* GL_SLUMINANCE8_ALPHA8 */ + 1443, /* GL_SLUMINANCE */ + 1444, /* GL_SLUMINANCE8 */ 267, /* GL_COMPRESSED_SRGB */ 268, /* GL_COMPRESSED_SRGB_ALPHA */ 265, /* GL_COMPRESSED_SLUMINANCE */ 266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1154, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 713, /* GL_LOWER_LEFT */ - 1779, /* GL_UPPER_LEFT */ - 1491, /* GL_STENCIL_BACK_REF */ - 1492, /* GL_STENCIL_BACK_VALUE_MASK */ - 1493, /* GL_STENCIL_BACK_WRITEMASK */ - 441, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1304, /* GL_RENDERBUFFER_BINDING_EXT */ - 1285, /* GL_READ_FRAMEBUFFER */ - 440, /* GL_DRAW_FRAMEBUFFER */ - 1286, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 1314, /* GL_RENDERBUFFER_SAMPLES */ - 544, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - 542, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - 553, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - 549, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - 551, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - 556, /* GL_FRAMEBUFFER_COMPLETE */ - 560, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - 566, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - 564, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 562, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 565, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 563, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 569, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 572, /* GL_FRAMEBUFFER_UNSUPPORTED */ - 570, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 853, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 1167, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 723, /* GL_LOWER_LEFT */ + 1803, /* GL_UPPER_LEFT */ + 1509, /* GL_STENCIL_BACK_REF */ + 1510, /* GL_STENCIL_BACK_VALUE_MASK */ + 1511, /* GL_STENCIL_BACK_WRITEMASK */ + 444, /* GL_DRAW_FRAMEBUFFER_BINDING */ + 1320, /* GL_RENDERBUFFER_BINDING */ + 1300, /* GL_READ_FRAMEBUFFER */ + 443, /* GL_DRAW_FRAMEBUFFER */ + 1301, /* GL_READ_FRAMEBUFFER_BINDING */ + 1331, /* GL_RENDERBUFFER_SAMPLES */ + 549, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 547, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 558, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 554, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 556, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 562, /* GL_FRAMEBUFFER_COMPLETE */ + 566, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 573, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 571, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 568, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 572, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 569, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ + 577, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ + 581, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 579, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 863, /* GL_MAX_COLOR_ATTACHMENTS */ 155, /* GL_COLOR_ATTACHMENT0 */ 157, /* GL_COLOR_ATTACHMENT1 */ 171, /* GL_COLOR_ATTACHMENT2 */ @@ -5054,57 +5102,57 @@ static const unsigned reduced_enums[1347] = 164, /* GL_COLOR_ATTACHMENT13 */ 166, /* GL_COLOR_ATTACHMENT14 */ 168, /* GL_COLOR_ATTACHMENT15 */ - 348, /* GL_DEPTH_ATTACHMENT */ - 1481, /* GL_STENCIL_ATTACHMENT */ - 535, /* GL_FRAMEBUFFER */ - 1302, /* GL_RENDERBUFFER */ - 1316, /* GL_RENDERBUFFER_WIDTH */ - 1309, /* GL_RENDERBUFFER_HEIGHT */ - 1311, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1504, /* GL_STENCIL_INDEX_EXT */ - 1501, /* GL_STENCIL_INDEX1_EXT */ - 1502, /* GL_STENCIL_INDEX4_EXT */ - 1503, /* GL_STENCIL_INDEX8_EXT */ - 1500, /* GL_STENCIL_INDEX16_EXT */ - 1313, /* GL_RENDERBUFFER_RED_SIZE */ - 1308, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1305, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1303, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1306, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1315, /* GL_RENDERBUFFER_STENCIL_SIZE */ - 568, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 909, /* GL_MAX_SAMPLES */ - 1272, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - 482, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - 665, /* GL_LAST_VERTEX_CONVENTION_EXT */ - 1251, /* GL_PROVOKING_VERTEX_EXT */ + 349, /* GL_DEPTH_ATTACHMENT */ + 1499, /* GL_STENCIL_ATTACHMENT */ + 540, /* GL_FRAMEBUFFER */ + 1318, /* GL_RENDERBUFFER */ + 1334, /* GL_RENDERBUFFER_WIDTH */ + 1326, /* GL_RENDERBUFFER_HEIGHT */ + 1328, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1526, /* GL_STENCIL_INDEX_EXT */ + 1518, /* GL_STENCIL_INDEX1 */ + 1522, /* GL_STENCIL_INDEX4 */ + 1524, /* GL_STENCIL_INDEX8 */ + 1519, /* GL_STENCIL_INDEX16 */ + 1330, /* GL_RENDERBUFFER_RED_SIZE */ + 1325, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1322, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1319, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1323, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1333, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 575, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 921, /* GL_MAX_SAMPLES */ + 1286, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + 486, /* GL_FIRST_VERTEX_CONVENTION */ + 674, /* GL_LAST_VERTEX_CONVENTION */ + 1264, /* GL_PROVOKING_VERTEX */ 302, /* GL_COPY_READ_BUFFER */ 303, /* GL_COPY_WRITE_BUFFER */ - 1363, /* GL_RGBA_SNORM */ - 1359, /* GL_RGBA8_SNORM */ - 1421, /* GL_SIGNED_NORMALIZED */ - 910, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - 1039, /* GL_OBJECT_TYPE */ - 1525, /* GL_SYNC_CONDITION */ - 1530, /* GL_SYNC_STATUS */ - 1527, /* GL_SYNC_FLAGS */ - 1526, /* GL_SYNC_FENCE */ - 1529, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - 1756, /* GL_UNSIGNALED */ - 1420, /* GL_SIGNALED */ + 1381, /* GL_RGBA_SNORM */ + 1377, /* GL_RGBA8_SNORM */ + 1439, /* GL_SIGNED_NORMALIZED */ + 923, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + 1052, /* GL_OBJECT_TYPE */ + 1547, /* GL_SYNC_CONDITION */ + 1552, /* GL_SYNC_STATUS */ + 1549, /* GL_SYNC_FLAGS */ + 1548, /* GL_SYNC_FENCE */ + 1551, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + 1779, /* GL_UNSIGNALED */ + 1438, /* GL_SIGNALED */ 46, /* GL_ALREADY_SIGNALED */ - 1727, /* GL_TIMEOUT_EXPIRED */ + 1750, /* GL_TIMEOUT_EXPIRED */ 270, /* GL_CONDITION_SATISFIED */ - 1839, /* GL_WAIT_FAILED */ - 467, /* GL_EVAL_BIT */ - 1283, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 707, /* GL_LIST_BIT */ - 1622, /* GL_TEXTURE_BIT */ - 1394, /* GL_SCISSOR_BIT */ + 1863, /* GL_WAIT_FAILED */ + 471, /* GL_EVAL_BIT */ + 1298, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 717, /* GL_LIST_BIT */ + 1644, /* GL_TEXTURE_BIT */ + 1412, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 995, /* GL_MULTISAMPLE_BIT */ + 1008, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ - 1728, /* GL_TIMEOUT_IGNORED */ + 1751, /* GL_TIMEOUT_IGNORED */ }; typedef int (*cfunc)(const void *, const void *); diff --git a/mesalib/src/mesa/main/eval.c b/mesalib/src/mesa/main/eval.c index 3f89f9c1e..95d6e2318 100644 --- a/mesalib/src/mesa/main/eval.c +++ b/mesalib/src/mesa/main/eval.c @@ -44,6 +44,10 @@ #include "eval.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_evaluators /* @@ -417,7 +421,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ) { @@ -425,7 +429,7 @@ _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) { @@ -516,7 +520,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, @@ -527,7 +531,7 @@ _mesa_Map2f( GLenum target, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, @@ -539,7 +543,7 @@ _mesa_Map2d( GLenum target, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) { GET_CURRENT_CONTEXT(ctx); @@ -604,7 +608,7 @@ _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); @@ -669,7 +673,7 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) { GET_CURRENT_CONTEXT(ctx); @@ -735,7 +739,7 @@ _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { GET_CURRENT_CONTEXT(ctx); @@ -753,14 +757,14 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) { @@ -788,7 +792,7 @@ _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { @@ -797,6 +801,41 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, } +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); +} + + +#endif /* FEATURE_evaluators */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/mesalib/src/mesa/main/eval.h b/mesalib/src/mesa/main/eval.h index b3ff0a96f..ffd1bab76 100644 --- a/mesalib/src/mesa/main/eval.h +++ b/mesalib/src/mesa/main/eval.h @@ -37,13 +37,22 @@ #define EVAL_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL -extern void _mesa_init_eval( GLcontext *ctx ); -extern void _mesa_free_eval_data( GLcontext *ctx ); +#if FEATURE_evaluators +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ + (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \ + (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \ + (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \ + (vfmt)->EvalPoint1 = impl ## EvalPoint1; \ + (vfmt)->EvalPoint2 = impl ## EvalPoint2; \ + (vfmt)->EvalMesh1 = impl ## EvalMesh1; \ + (vfmt)->EvalMesh2 = impl ## EvalMesh2; \ + } while (0) extern GLuint _mesa_evaluator_components( GLenum target ); @@ -70,59 +79,32 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, GLint vstride, GLint vorder, const GLdouble *points ); +extern void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); +extern void +_mesa_init_eval_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points ); - -extern 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 ); - -extern void GLAPIENTRY -_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble *points ); - -extern 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 ); - -extern void GLAPIENTRY -_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); +#else /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); +static INLINE void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -extern void GLAPIENTRY -_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); +static INLINE void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); +#endif /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); - -extern void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); - -#else - -/** No-op */ -#define _mesa_init_eval( c ) ((void)0) - -/** No-op */ -#define _mesa_free_eval_data( c ) ((void)0) +extern void _mesa_init_eval( GLcontext *ctx ); +extern void _mesa_free_eval_data( GLcontext *ctx ); -#endif -#endif +#endif /* EVAL_H */ diff --git a/mesalib/src/mesa/main/execmem.c b/mesalib/src/mesa/main/execmem.c index 57c1e117c..4c6139985 100644 --- a/mesalib/src/mesa/main/execmem.c +++ b/mesalib/src/mesa/main/execmem.c @@ -80,11 +80,10 @@ init_heap(void) exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - return (exec_mem != NULL); + return (exec_mem != MAP_FAILED); } diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index e3070b154..2138bfe40 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -47,7 +47,9 @@ static const struct { } default_extensions[] = { { OFF, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, + { OFF, "GL_ARB_depth_clamp", F(ARB_depth_clamp) }, { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, + { OFF, "GL_ARB_draw_elements_base_vertex", F(ARB_draw_elements_base_vertex) }, { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, @@ -61,6 +63,7 @@ static const struct { { OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) }, { OFF, "GL_ARB_point_parameters", F(EXT_point_parameters) }, { OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) }, + { OFF, "GL_ARB_provoking_vertex", F(EXT_provoking_vertex) }, { OFF, "GL_ARB_seamless_cube_map", F(ARB_seamless_cube_map) }, { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, @@ -101,8 +104,9 @@ static const struct { { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, { ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) }, - { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, { OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) }, + { OFF, "GL_EXT_framebuffer_multisample", F(EXT_framebuffer_multisample) }, + { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, { OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) }, { OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) }, { OFF, "GL_EXT_histogram", F(EXT_histogram) }, @@ -162,8 +166,11 @@ static const struct { { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) }, { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, { OFF, "GL_NV_blend_square", F(NV_blend_square) }, + { OFF, "GL_NV_depth_clamp", F(ARB_depth_clamp) }, { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, + { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, + { OFF, "GL_NV_packed_depth_stencil", F(EXT_packed_depth_stencil) }, { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, @@ -192,8 +199,10 @@ void _mesa_enable_sw_extensions(GLcontext *ctx) { ctx->Extensions.ARB_copy_buffer = GL_TRUE; + ctx->Extensions.ARB_depth_clamp = GL_TRUE; ctx->Extensions.ARB_depth_texture = GL_TRUE; /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ + ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; #if FEATURE_ARB_fragment_program ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; @@ -208,7 +217,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj ctx->Extensions.ARB_occlusion_query = GL_TRUE; #endif ctx->Extensions.ARB_point_sprite = GL_TRUE; @@ -266,6 +275,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_EXT_framebuffer_blit ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; +#endif +#if FEATURE_ARB_framebuffer_object + ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; #endif ctx->Extensions.EXT_histogram = GL_TRUE; /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ @@ -308,6 +320,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_NV_fragment_program ctx->Extensions.NV_fragment_program = GL_TRUE; +#endif +#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program + ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_color_table = GL_TRUE; diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index ed1db0fec..7b3599f93 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -34,7 +34,9 @@ #include "buffers.h" #include "context.h" +#include "enums.h" #include "fbobject.h" +#include "formats.h" #include "framebuffer.h" #include "hash.h" #include "macros.h" @@ -44,6 +46,14 @@ #include "teximage.h" #include "texobj.h" #include "texstore.h" +#include "texstate.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 /** @@ -223,9 +233,13 @@ _mesa_set_texture_attachment(GLcontext *ctx, 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); @@ -234,12 +248,7 @@ _mesa_set_texture_attachment(GLcontext *ctx, /* always update these fields */ att->TextureLevel = level; - if (IS_CUBE_FACE(texTarget)) { - att->CubeMapFace = texTarget - GL_TEXTURE_CUBE_MAP_POSITIVE_X; - } - else { - att->CubeMapFace = 0; - } + att->CubeMapFace = _mesa_tex_target_to_face(texTarget); att->Zoffset = zoffset; att->Complete = GL_FALSE; @@ -308,14 +317,31 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, static void att_incomplete(const char *msg) { -#if 0 - _mesa_printf("attachment incomplete: %s\n", 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 +} + + + + /** * Test if an attachment point is complete and update its Complete field. * \param format if GL_COLOR, this is a color attachment point, @@ -335,6 +361,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, 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"); @@ -361,26 +388,28 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, return; } + baseFormat = _mesa_get_format_base_format(texImage->TexFormat); + if (format == GL_COLOR) { - if (texImage->TexFormat->BaseFormat != GL_RGB && - texImage->TexFormat->BaseFormat != GL_RGBA) { + if (baseFormat != GL_RGB && + baseFormat != GL_RGBA) { att_incomplete("bad format"); att->Complete = GL_FALSE; return; } - if (texImage->TexFormat->TexelBytes == 0) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { att_incomplete("compressed internalformat"); att->Complete = GL_FALSE; return; } } else if (format == GL_DEPTH) { - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) { + if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } else if (ctx->Extensions.EXT_packed_depth_stencil && ctx->Extensions.ARB_depth_texture && - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -391,10 +420,9 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } else { ASSERT(format == GL_STENCIL); - ASSERT(att->Renderbuffer->StencilBits); if (ctx->Extensions.EXT_packed_depth_stencil && ctx->Extensions.ARB_depth_texture && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -406,6 +434,9 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } } 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 || @@ -415,24 +446,19 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, return; } if (format == GL_COLOR) { - if (att->Renderbuffer->_BaseFormat != GL_RGB && - att->Renderbuffer->_BaseFormat != GL_RGBA) { + if (baseFormat != GL_RGB && + baseFormat != GL_RGBA) { att_incomplete("bad renderbuffer color format"); att->Complete = GL_FALSE; return; } - ASSERT(att->Renderbuffer->RedBits); - ASSERT(att->Renderbuffer->GreenBits); - ASSERT(att->Renderbuffer->BlueBits); } else if (format == GL_DEPTH) { - if (att->Renderbuffer->_BaseFormat == GL_DEPTH_COMPONENT) { - ASSERT(att->Renderbuffer->DepthBits); + if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } else if (ctx->Extensions.EXT_packed_depth_stencil && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - ASSERT(att->Renderbuffer->DepthBits); + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -443,13 +469,11 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } else { assert(format == GL_STENCIL); - if (att->Renderbuffer->_BaseFormat == GL_STENCIL_INDEX) { - ASSERT(att->Renderbuffer->StencilBits); + if (baseFormat == GL_STENCIL_INDEX) { /* OK */ } else if (ctx->Extensions.EXT_packed_depth_stencil && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - ASSERT(att->Renderbuffer->StencilBits); + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -467,20 +491,6 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } -/** - * Helpful for debugging - */ -static void -fbo_incomplete(const char *msg, int index) -{ - (void) msg; - (void) index; - /* - _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index); - */ -} - - /** * Test if the given framebuffer object is complete and update its * Status field with the results. @@ -644,6 +654,8 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) return; } } +#else + (void) j; #endif if (numImages == 0) { @@ -704,18 +716,13 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) ASSERT_OUTSIDE_BEGIN_END(ctx); if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glBindRenderbufferEXT(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glBindRenderbufferEXT(target)"); return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: + /* No need to flush here since the render buffer binding has no + * effect on rendering state. */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - if (renderbuffer) { newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); @@ -969,42 +976,27 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, } /* These MUST get set by the AllocStorage func */ - rb->_ActualFormat = 0; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; + 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->_ActualFormat); + assert(rb->Format != MESA_FORMAT_NONE); assert(rb->Width == (GLuint) width); assert(rb->Height == (GLuint) height); - assert(rb->RedBits || rb->GreenBits || rb->BlueBits || rb->AlphaBits || - rb->DepthBits || rb->StencilBits || rb->IndexBits); rb->InternalFormat = internalFormat; - rb->_BaseFormat = baseFormat; + rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + 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->_ActualFormat = GL_NONE; rb->_BaseFormat = GL_NONE; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = rb->NumSamples = 0; } @@ -1017,6 +1009,53 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, } +/** + * 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: + case GL_RENDERBUFFER_GREEN_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + 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) + 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) @@ -1060,7 +1099,9 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) return; } - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* No need to flush here since we're just quering state which is + * not effected by rendering. + */ switch (pname) { case GL_RENDERBUFFER_WIDTH_EXT: @@ -1073,22 +1114,12 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) *params = rb->InternalFormat; return; case GL_RENDERBUFFER_RED_SIZE_EXT: - *params = rb->RedBits; - break; case GL_RENDERBUFFER_GREEN_SIZE_EXT: - *params = rb->GreenBits; - break; case GL_RENDERBUFFER_BLUE_SIZE_EXT: - *params = rb->BlueBits; - break; case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - *params = rb->AlphaBits; - break; case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - *params = rb->DepthBits; - break; case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - *params = rb->StencilBits; + *params = get_component_bits(pname, rb->_BaseFormat, rb->Format); break; case GL_RENDERBUFFER_SAMPLES: if (ctx->Extensions.ARB_framebuffer_object) { @@ -1118,16 +1149,25 @@ _mesa_IsFramebufferEXT(GLuint framebuffer) } +/** + * 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(GLcontext *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; struct gl_texture_object *texObj = att->Texture; if (texObj - && att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { + && texObj->Image[att->CubeMapFace][att->TextureLevel]) { ctx->Driver.RenderTexture(ctx, fb, att); } } @@ -1142,6 +1182,9 @@ check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) static void check_end_texture_render(GLcontext *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++) { @@ -1157,7 +1200,8 @@ check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) void GLAPIENTRY _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) { - struct gl_framebuffer *newFb, *newFbread; + struct gl_framebuffer *newDrawFb, *newReadFb; + struct gl_framebuffer *oldDrawFb, *oldReadFb; GLboolean bindReadBuf, bindDrawBuf; GET_CURRENT_CONTEXT(ctx); @@ -1204,76 +1248,90 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } - if (framebuffer) { /* Binding a user-created framebuffer object */ - newFb = _mesa_lookup_framebuffer(ctx, framebuffer); - if (newFb == &DummyFramebuffer) { + newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer); + if (newDrawFb == &DummyFramebuffer) { /* ID was reserved, but no real framebuffer object made yet */ - newFb = NULL; + newDrawFb = NULL; } - else if (!newFb && ctx->Extensions.ARB_framebuffer_object) { + 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 (!newFb) { + if (!newDrawFb) { /* create new framebuffer object */ - newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); - if (!newFb) { + newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); + if (!newDrawFb) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT"); return; } - _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb); + _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb); } - newFbread = newFb; + newReadFb = newDrawFb; } else { /* Binding the window system framebuffer (which was originally set * with MakeCurrent). */ - newFb = ctx->WinSysDrawBuffer; - newFbread = ctx->WinSysReadBuffer; + newDrawFb = ctx->WinSysDrawBuffer; + newReadFb = ctx->WinSysReadBuffer; } - ASSERT(newFb); - ASSERT(newFb != &DummyFramebuffer); + 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) { - if (ctx->ReadBuffer == newFbread) - bindReadBuf = GL_FALSE; /* no change */ - else - _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread); + 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) { - /* check if old FB had any texture attachments */ - if (ctx->DrawBuffer->Name != 0) { - check_end_texture_render(ctx, ctx->DrawBuffer); - } + FLUSH_VERTICES(ctx, _NEW_BUFFERS); - if (ctx->DrawBuffer == newFb) - bindDrawBuf = GL_FALSE; /* no change */ - else - _mesa_reference_framebuffer(&ctx->DrawBuffer, newFb); + /* check if old read/draw buffers were render-to-texture */ + if (!bindReadBuf) + check_end_texture_render(ctx, oldReadFb); - if (newFb->Name != 0) { - /* check if newly bound framebuffer has any texture attachments */ - check_begin_texture_render(ctx, newFb); - } + 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, newFb, newFbread); + ctx->Driver.BindFramebuffer(ctx, target, newDrawFb, newReadFb); } } @@ -1285,12 +1343,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); for (i = 0; i < n; i++) { if (framebuffers[i] > 0) { @@ -1395,7 +1448,7 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) return GL_FRAMEBUFFER_COMPLETE_EXT; } - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* No need to flush here */ if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) { _mesa_test_framebuffer_completeness(ctx, buffer); @@ -1511,12 +1564,7 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); _glthread_LOCK_MUTEX(fb->Mutex); if (texObj) { @@ -1664,7 +1712,8 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, att = _mesa_get_attachment(ctx, fb, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(attachment)"); + "glFramebufferRenderbufferEXT(invalid attachment %s)", + _mesa_lookup_enum_by_nr(attachment)); return; } @@ -1672,7 +1721,8 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); if (!rb) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(renderbuffer)"); + "glFramebufferRenderbufferEXT(non-existant" + " renderbuffer %u)", renderbuffer); return; } } @@ -1683,7 +1733,9 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { /* make sure the renderbuffer is a depth/stencil format */ - if (rb->_BaseFormat != GL_DEPTH_STENCIL) { + const GLenum baseFormat = + _mesa_get_format_base_format(att->Renderbuffer->Format); + if (baseFormat != GL_DEPTH_STENCIL) { _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT(renderbuffer" " is not DEPTH_STENCIL format)"); @@ -1692,12 +1744,7 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); assert(ctx->Driver.FramebufferRenderbuffer); ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); @@ -1773,12 +1820,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); + /* No need to flush here */ switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: @@ -1839,7 +1881,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, "glGetFramebufferAttachmentParameterivEXT(pname)"); } else { - *params = att->Renderbuffer->ColorEncoding; + *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format); } return; case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: @@ -1849,61 +1891,44 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; } else { - *params = att->Renderbuffer->ComponentType; + 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: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->RedBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->GreenBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->BlueBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->AlphaBits; - } - return; 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 { - *params = att->Renderbuffer->DepthBits; + 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; + } } - return; - case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + else if (att->Renderbuffer) { + *params = get_component_bits(pname, att->Renderbuffer->_BaseFormat, + att->Renderbuffer->Format); } else { - *params = att->Renderbuffer->StencilBits; + *params = 0; } return; default: @@ -1917,7 +1942,6 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, void GLAPIENTRY _mesa_GenerateMipmapEXT(GLenum target) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); @@ -1936,18 +1960,22 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); + + if (texObj->BaseLevel >= texObj->MaxLevel) { + /* nothing to do */ + return; + } _mesa_lock_texture(ctx, texObj); if (target == GL_TEXTURE_CUBE_MAP) { - int face; - + GLuint face; for (face = 0; face < 6; face++) ctx->Driver.GenerateMipmap(ctx, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, texObj); - } else { + } + else { ctx->Driver.GenerateMipmap(ctx, target, texObj); } _mesa_unlock_texture(ctx, texObj); @@ -1955,6 +1983,20 @@ _mesa_GenerateMipmapEXT(GLenum target) #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. * @@ -2030,7 +2072,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; if (!readRb || !drawRb || - readRb->StencilBits != drawRb->StencilBits) { + _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; @@ -2042,7 +2085,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; if (!readRb || !drawRb || - readRb->DepthBits != drawRb->DepthBits) { + _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; @@ -2070,7 +2114,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, /* color formats must match */ if (colorReadRb && colorDrawRb && - colorReadRb->_ActualFormat != colorDrawRb->_ActualFormat) { + colorReadRb->Format != colorDrawRb->Format) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(bad src/dst multisample pixel formats"); return; @@ -2082,6 +2126,44 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } + /* Debug code */ + if (DEBUG_BLIT) { + _mesa_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); + _mesa_printf(" Src FBO %u RB %u (%dx%d) ", + readFb->Name, colorReadRb->Name, + colorReadRb->Width, colorReadRb->Height); + if (att && att->Texture) { + _mesa_printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); + } + _mesa_printf("\n"); + + att = find_attachment(drawFb, colorDrawRb); + _mesa_printf(" Dst FBO %u RB %u (%dx%d) ", + drawFb->Name, colorDrawRb->Name, + colorDrawRb->Width, colorDrawRb->Height); + if (att && att->Texture) { + _mesa_printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); + } + _mesa_printf("\n"); + } + } + ASSERT(ctx->Driver.BlitFramebuffer); ctx->Driver.BlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1, diff --git a/mesalib/src/mesa/main/feedback.c b/mesalib/src/mesa/main/feedback.c index 818a80454..fcdbb75fc 100644 --- a/mesalib/src/mesa/main/feedback.c +++ b/mesalib/src/mesa/main/feedback.c @@ -36,9 +36,10 @@ #include "feedback.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" -#if _HAVE_FULL_GL +#if FEATURE_feedback #define FB_3D 0x01 @@ -49,7 +50,7 @@ -void GLAPIENTRY +static void GLAPIENTRY _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -103,7 +104,7 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PassThrough( GLfloat token ) { GET_CURRENT_CONTEXT(ctx); @@ -153,9 +154,6 @@ _mesa_feedback_vertex(GLcontext *ctx, } -#endif /* _HAVE_FULL_GL */ - - /**********************************************************************/ /** \name Selection */ /*@{*/ @@ -173,7 +171,7 @@ _mesa_feedback_vertex(GLcontext *ctx, * Verifies we're not in selection mode, flushes the vertices and initialize * the fields in __GLcontextRec::Select with the given buffer. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -280,7 +278,7 @@ write_hit_record(GLcontext *ctx) * the hit record data in gl_selection. Marks new render mode in * __GLcontextRec::NewState. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_InitNames( void ) { GET_CURRENT_CONTEXT(ctx); @@ -311,7 +309,7 @@ _mesa_InitNames( void ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_LoadName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -350,7 +348,7 @@ _mesa_LoadName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PushName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -381,7 +379,7 @@ _mesa_PushName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PopName( void ) { GET_CURRENT_CONTEXT(ctx); @@ -424,7 +422,7 @@ _mesa_PopName( void ) * __GLcontextRec::RenderMode and notifies the driver via the * dd_function_table::RenderMode callback. */ -GLint GLAPIENTRY +static GLint GLAPIENTRY _mesa_RenderMode( GLenum mode ) { GET_CURRENT_CONTEXT(ctx); @@ -507,6 +505,23 @@ _mesa_RenderMode( GLenum mode ) /*@}*/ +void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ + SET_InitNames(disp, _mesa_InitNames); + SET_FeedbackBuffer(disp, _mesa_FeedbackBuffer); + SET_LoadName(disp, _mesa_LoadName); + SET_PassThrough(disp, _mesa_PassThrough); + SET_PopName(disp, _mesa_PopName); + SET_PushName(disp, _mesa_PushName); + SET_SelectBuffer(disp, _mesa_SelectBuffer); + SET_RenderMode(disp, _mesa_RenderMode); +} + + +#endif /* FEATURE_feedback */ + + /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/mesalib/src/mesa/main/feedback.h b/mesalib/src/mesa/main/feedback.h index 72c2acd5e..7a648f444 100644 --- a/mesalib/src/mesa/main/feedback.h +++ b/mesalib/src/mesa/main/feedback.h @@ -27,11 +27,15 @@ #define FEEDBACK_H -#include "mtypes.h" +#include "main/mtypes.h" -extern void -_mesa_init_feedback( GLcontext *ctx ); +#if FEATURE_feedback + +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RenderMode = impl ## RenderMode; \ + } while (0) extern void _mesa_feedback_vertex( GLcontext *ctx, @@ -55,29 +59,47 @@ extern void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ); -extern void GLAPIENTRY -_mesa_PassThrough( GLfloat token ); +extern void +_mesa_init_feedback_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_feedback */ -extern void GLAPIENTRY -_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); +static INLINE void +_mesa_feedback_vertex( GLcontext *ctx, + const GLfloat win[4], + const GLfloat color[4], + GLfloat index, + const GLfloat texcoord[4] ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_InitNames( void ); -extern void GLAPIENTRY -_mesa_LoadName( GLuint name ); +static INLINE void +_mesa_feedback_token( GLcontext *ctx, GLfloat token ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PushName( GLuint name ); +static INLINE void +_mesa_update_hitflag( GLcontext *ctx, GLfloat z ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PopName( void ); +static INLINE void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ +} -extern GLint GLAPIENTRY -_mesa_RenderMode( GLenum mode ); +#endif /* FEATURE_feedback */ +extern void +_mesa_init_feedback( GLcontext *ctx ); -#endif +#endif /* FEEDBACK_H */ diff --git a/mesalib/src/mesa/main/ffvertex_prog.c b/mesalib/src/mesa/main/ffvertex_prog.c index 356476e35..fe2416d89 100644 --- a/mesalib/src/mesa/main/ffvertex_prog.c +++ b/mesalib/src/mesa/main/ffvertex_prog.c @@ -438,7 +438,7 @@ static struct ureg register_input( struct tnl_program *p, GLuint input ) */ static struct ureg register_output( struct tnl_program *p, GLuint output ) { - p->program->Base.OutputsWritten |= (1<program->Base.OutputsWritten |= BITFIELD64_BIT(output); return make_ureg(PROGRAM_OUTPUT, output); } diff --git a/mesalib/src/mesa/main/fog.c b/mesalib/src/mesa/main/fog.c index 4323d3db8..269ff3f8b 100644 --- a/mesalib/src/mesa/main/fog.c +++ b/mesalib/src/mesa/main/fog.c @@ -34,15 +34,20 @@ void GLAPIENTRY _mesa_Fogf(GLenum pname, GLfloat param) { - _mesa_Fogfv(pname, ¶m); + 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 = (GLfloat) param; - _mesa_Fogfv(pname, &fparam); + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c new file mode 100644 index 000000000..329b79507 --- /dev/null +++ b/mesalib/src/mesa/main/formats.c @@ -0,0 +1,1158 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-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. + */ + + +#include "imports.h" +#include "formats.h" +#include "config.h" +#include "texstore.h" + + +/** + * Information about texture formats. + */ +struct gl_format_info +{ + gl_format Name; + + /** text name for debugging */ + const char *StrName; + + /** + * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, + * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, + * GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL. + */ + GLenum BaseFormat; + + /** + * Logical data type: one of GL_UNSIGNED_NORMALIZED, GL_SIGNED_NORMALED, + * GL_UNSIGNED_INT, GL_SIGNED_INT, GL_FLOAT. + */ + GLenum DataType; + + GLubyte RedBits; + GLubyte GreenBits; + GLubyte BlueBits; + GLubyte AlphaBits; + GLubyte LuminanceBits; + GLubyte IntensityBits; + GLubyte IndexBits; + GLubyte DepthBits; + GLubyte StencilBits; + + /** + * To describe compressed formats. If not compressed, Width=Height=1. + */ + GLubyte BlockWidth, BlockHeight; + GLubyte BytesPerBlock; +}; + + +/** + * Info about each format. + * These must be in the same order as the MESA_FORMAT_* enums so that + * we can do lookups without searching. + */ +static struct gl_format_info format_info[MESA_FORMAT_COUNT] = +{ + { + MESA_FORMAT_NONE, /* Name */ + "MESA_FORMAT_NONE", /* StrName */ + GL_NONE, /* BaseFormat */ + GL_NONE, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 0, 0, 0 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGBA8888, /* Name */ + "MESA_FORMAT_RGBA8888", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGBA8888_REV, /* Name */ + "MESA_FORMAT_RGBA8888_REV", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB8888, /* Name */ + "MESA_FORMAT_ARGB8888", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB8888_REV, /* Name */ + "MESA_FORMAT_ARGB8888_REV", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_XRGB8888, /* Name */ + "MESA_FORMAT_XRGB8888", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_XRGB8888_REV, /* Name */ + "MESA_FORMAT_XRGB8888_REV", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB888, /* Name */ + "MESA_FORMAT_RGB888", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 3 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_BGR888, /* Name */ + "MESA_FORMAT_BGR888", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 3 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB565, /* Name */ + "MESA_FORMAT_RGB565", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB565_REV, /* Name */ + "MESA_FORMAT_RGB565_REV", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB4444, /* Name */ + "MESA_FORMAT_ARGB4444", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB4444_REV, /* Name */ + "MESA_FORMAT_ARGB4444_REV", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGBA5551, /* Name */ + "MESA_FORMAT_RGBA5551", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB1555, /* Name */ + "MESA_FORMAT_ARGB1555", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB1555_REV, /* Name */ + "MESA_FORMAT_ARGB1555_REV", /* StrName */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL88, /* Name */ + "MESA_FORMAT_AL88", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ + 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL88_REV, /* Name */ + "MESA_FORMAT_AL88_REV", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ + 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL1616, /* Name */ + "MESA_FORMAT_AL1616", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL1616_REV, /* Name */ + "MESA_FORMAT_AL1616_REV", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB332, /* Name */ + "MESA_FORMAT_RGB332", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 3, 3, 2, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_A8, /* Name */ + "MESA_FORMAT_A8", /* StrName */ + GL_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_L8, /* Name */ + "MESA_FORMAT_L8", /* StrName */ + GL_LUMINANCE, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_I8, /* Name */ + "MESA_FORMAT_I8", /* StrName */ + GL_INTENSITY, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 8, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_CI8, /* Name */ + "MESA_FORMAT_CI8", /* StrName */ + GL_COLOR_INDEX, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 8, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_YCBCR, /* Name */ + "MESA_FORMAT_YCBCR", /* StrName */ + GL_YCBCR_MESA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_YCBCR_REV, /* Name */ + "MESA_FORMAT_YCBCR_REV", /* StrName */ + GL_YCBCR_MESA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z24_S8, /* Name */ + "MESA_FORMAT_Z24_S8", /* StrName */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_S8_Z24, /* Name */ + "MESA_FORMAT_S8_Z24", /* StrName */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z16, /* Name */ + "MESA_FORMAT_Z16", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 16, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_X8_Z24, /* Name */ + "MESA_FORMAT_X8_Z24", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z24_X8, /* Name */ + "MESA_FORMAT_Z24_X8", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z32, /* Name */ + "MESA_FORMAT_Z32", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_S8, /* Name */ + "MESA_FORMAT_S8", /* StrName */ + GL_STENCIL_INDEX, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_SRGB8, + "MESA_FORMAT_SRGB8", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 1, 1, 3 + }, + { + MESA_FORMAT_SRGBA8, + "MESA_FORMAT_SRGBA8", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SARGB8, + "MESA_FORMAT_SARGB8", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SL8, + "MESA_FORMAT_SL8", + GL_LUMINANCE, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 0, + 8, 0, 0, 0, 0, + 1, 1, 1 + }, + { + MESA_FORMAT_SLA8, + "MESA_FORMAT_SLA8", + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 8, + 8, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_SRGB_DXT1, /* Name */ + "MESA_FORMAT_SRGB_DXT1", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_SRGBA_DXT1, + "MESA_FORMAT_SRGBA_DXT1", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_SRGBA_DXT3, + "MESA_FORMAT_SRGBA_DXT3", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + { + MESA_FORMAT_SRGBA_DXT5, + "MESA_FORMAT_SRGBA_DXT5", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + + { + MESA_FORMAT_RGB_FXT1, + "MESA_FORMAT_RGB_FXT1", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 0, /* approx Red/Green/BlueBits */ + 0, 0, 0, 0, 0, + 8, 4, 16 /* 16 bytes per 8x4 block */ + }, + { + MESA_FORMAT_RGBA_FXT1, + "MESA_FORMAT_RGBA_FXT1", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 1, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, + 8, 4, 16 /* 16 bytes per 8x4 block */ + }, + + { + MESA_FORMAT_RGB_DXT1, /* Name */ + "MESA_FORMAT_RGB_DXT1", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_DXT1, + "MESA_FORMAT_RGBA_DXT1", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_DXT3, + "MESA_FORMAT_RGBA_DXT3", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_DXT5, + "MESA_FORMAT_RGBA_DXT5", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_FLOAT32, + "MESA_FORMAT_RGBA_FLOAT32", + GL_RGBA, + GL_FLOAT, + 32, 32, 32, 32, + 0, 0, 0, 0, 0, + 1, 1, 16 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + "MESA_FORMAT_RGBA_FLOAT16", + GL_RGBA, + GL_FLOAT, + 16, 16, 16, 16, + 0, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_RGB_FLOAT32, + "MESA_FORMAT_RGB_FLOAT32", + GL_RGB, + GL_FLOAT, + 32, 32, 32, 0, + 0, 0, 0, 0, 0, + 1, 1, 12 + }, + { + MESA_FORMAT_RGB_FLOAT16, + "MESA_FORMAT_RGB_FLOAT16", + GL_RGB, + GL_FLOAT, + 16, 16, 16, 0, + 0, 0, 0, 0, 0, + 1, 1, 6 + }, + { + MESA_FORMAT_ALPHA_FLOAT32, + "MESA_FORMAT_ALPHA_FLOAT32", + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 32, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_ALPHA_FLOAT16, + "MESA_FORMAT_ALPHA_FLOAT16", + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 16, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT32, + "MESA_FORMAT_LUMINANCE_FLOAT32", + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 0, + 32, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT16, + "MESA_FORMAT_LUMINANCE_FLOAT16", + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 0, + 16, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32", + GL_LUMINANCE_ALPHA, + GL_FLOAT, + 0, 0, 0, 32, + 32, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16", + GL_LUMINANCE_ALPHA, + GL_FLOAT, + 0, 0, 0, 16, + 16, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_INTENSITY_FLOAT32, + "MESA_FORMAT_INTENSITY_FLOAT32", + GL_INTENSITY, + GL_FLOAT, + 0, 0, 0, 0, + 0, 32, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_INTENSITY_FLOAT16, + "MESA_FORMAT_INTENSITY_FLOAT16", + GL_INTENSITY, + GL_FLOAT, + 0, 0, 0, 0, + 0, 16, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_DUDV8, + "MESA_FORMAT_DUDV8", + GL_DUDV_ATI, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_SIGNED_RGBA8888, + "MESA_FORMAT_SIGNED_RGBA8888", + GL_RGBA, + GL_SIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SIGNED_RGBA8888_REV, + "MESA_FORMAT_SIGNED_RGBA8888_REV", + GL_RGBA, + GL_SIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SIGNED_RGBA_16, + "MESA_FORMAT_SIGNED_RGBA_16", + GL_RGBA, + GL_SIGNED_NORMALIZED, + 16, 16, 16, 16, + 0, 0, 0, 0, 0, + 1, 1, 8 + } +}; + + + +static const struct gl_format_info * +_mesa_get_format_info(gl_format format) +{ + const struct gl_format_info *info = &format_info[format]; + assert(info->Name == format); + return info; +} + + +/** Return string name of format (for debugging) */ +const char * +_mesa_get_format_name(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + ASSERT(info->BytesPerBlock); + return info->StrName; +} + + + +/** + * Return bytes needed to store a block of pixels in the given format. + * Normally, a block is 1x1 (a single pixel). But for compressed formats + * a block may be 4x4 or 8x4, etc. + */ +GLuint +_mesa_get_format_bytes(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + ASSERT(info->BytesPerBlock); + return info->BytesPerBlock; +} + + +/** + * Return bits per component for the given format. + * \param format one of MESA_FORMAT_x + * \param pname the component, such as GL_RED_BITS, GL_TEXTURE_BLUE_BITS, etc. + */ +GLint +_mesa_get_format_bits(gl_format format, GLenum pname) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + + switch (pname) { + case GL_RED_BITS: + case GL_TEXTURE_RED_SIZE: + case GL_RENDERBUFFER_RED_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + return info->RedBits; + case GL_GREEN_BITS: + case GL_TEXTURE_GREEN_SIZE: + case GL_RENDERBUFFER_GREEN_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + return info->GreenBits; + case GL_BLUE_BITS: + case GL_TEXTURE_BLUE_SIZE: + case GL_RENDERBUFFER_BLUE_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + return info->BlueBits; + case GL_ALPHA_BITS: + case GL_TEXTURE_ALPHA_SIZE: + case GL_RENDERBUFFER_ALPHA_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + return info->AlphaBits; + case GL_TEXTURE_INTENSITY_SIZE: + return info->IntensityBits; + case GL_TEXTURE_LUMINANCE_SIZE: + return info->LuminanceBits; + case GL_INDEX_BITS: + case GL_TEXTURE_INDEX_SIZE_EXT: + return info->IndexBits; + case GL_DEPTH_BITS: + case GL_TEXTURE_DEPTH_SIZE_ARB: + case GL_RENDERBUFFER_DEPTH_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + return info->DepthBits; + case GL_STENCIL_BITS: + case GL_TEXTURE_STENCIL_SIZE_EXT: + case GL_RENDERBUFFER_STENCIL_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + return info->StencilBits; + default: + _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()"); + return 0; + } +} + + +/** + * Return the data type (or more specifically, the data representation) + * for the given format. + * The return value will be one of: + * GL_UNSIGNED_NORMALIZED = unsigned int representing [0,1] + * GL_SIGNED_NORMALIZED = signed int representing [-1, 1] + * GL_UNSIGNED_INT = an ordinary unsigned integer + * GL_FLOAT = an ordinary float + */ +GLenum +_mesa_get_format_datatype(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->DataType; +} + + +/** + * Return the basic format for the given type. The result will be + * one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, + * GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, GL_DEPTH_COMPONENT, + * GL_STENCIL_INDEX, GL_DEPTH_STENCIL. + */ +GLenum +_mesa_get_format_base_format(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->BaseFormat; +} + + +/** + * Return the block size (in pixels) for the given format. Normally + * the block size is 1x1. But compressed formats will have block sizes + * of 4x4 or 8x4 pixels, etc. + * \param bw returns block width in pixels + * \param bh returns block height in pixels + */ +void +_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + *bw = info->BlockWidth; + *bh = info->BlockHeight; +} + + +/** Is the given format a compressed format? */ +GLboolean +_mesa_is_format_compressed(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->BlockWidth > 1 || info->BlockHeight > 1; +} + + +/** + * Return color encoding for given format. + * \return GL_LINEAR or GL_SRGB + */ +GLenum +_mesa_get_format_color_encoding(gl_format format) +{ + /* XXX this info should be encoded in gl_format_info */ + switch (format) { + case MESA_FORMAT_SRGB8: + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + case MESA_FORMAT_SL8: + case MESA_FORMAT_SLA8: + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: + return GL_SRGB; + default: + return GL_LINEAR; + } +} + + +/** + * Return number of bytes needed to store an image of the given size + * in the given format. + */ +GLuint +_mesa_format_image_size(gl_format format, GLsizei width, + GLsizei height, GLsizei depth) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + /* Strictly speaking, a conditional isn't needed here */ + if (info->BlockWidth > 1 || info->BlockHeight > 1) { + /* compressed format */ + const GLuint bw = info->BlockWidth, bh = info->BlockHeight; + const GLuint wblocks = (width + bw - 1) / bw; + const GLuint hblocks = (height + bh - 1) / bh; + const GLuint sz = wblocks * hblocks * info->BytesPerBlock; + return sz; + } + else { + /* non-compressed */ + const GLuint sz = width * height * depth * info->BytesPerBlock; + return sz; + } +} + + + +GLint +_mesa_format_row_stride(gl_format format, GLsizei width) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + /* Strictly speaking, a conditional isn't needed here */ + if (info->BlockWidth > 1 || info->BlockHeight > 1) { + /* compressed format */ + const GLuint bw = info->BlockWidth; + const GLuint wblocks = (width + bw - 1) / bw; + const GLint stride = wblocks * info->BytesPerBlock; + return stride; + } + else { + const GLint stride = width * info->BytesPerBlock; + return stride; + } +} + + + +/** + * Do sanity checking of the format info table. + */ +void +_mesa_test_formats(void) +{ + GLuint i; + + assert(Elements(format_info) == MESA_FORMAT_COUNT); + + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + const struct gl_format_info *info = _mesa_get_format_info(i); + assert(info); + + assert(info->Name == i); + + if (info->Name == MESA_FORMAT_NONE) + continue; + + if (info->BlockWidth == 1 && info->BlockHeight == 1) { + if (info->RedBits > 0) { + GLuint t = info->RedBits + info->GreenBits + + info->BlueBits + info->AlphaBits; + assert(t / 8 == info->BytesPerBlock); + } + } + + assert(info->DataType == GL_UNSIGNED_NORMALIZED || + info->DataType == GL_SIGNED_NORMALIZED || + info->DataType == GL_UNSIGNED_INT || + info->DataType == GL_FLOAT); + + if (info->BaseFormat == GL_RGB) { + assert(info->RedBits > 0); + assert(info->GreenBits > 0); + assert(info->BlueBits > 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_RGBA) { + assert(info->RedBits > 0); + assert(info->GreenBits > 0); + assert(info->BlueBits > 0); + assert(info->AlphaBits > 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_LUMINANCE) { + assert(info->RedBits == 0); + assert(info->GreenBits == 0); + assert(info->BlueBits == 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits > 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_INTENSITY) { + assert(info->RedBits == 0); + assert(info->GreenBits == 0); + assert(info->BlueBits == 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits > 0); + } + + } +} + + + +/** + * Return datatype and number of components per texel for the given gl_format. + * Only used for mipmap generation code. + */ +void +_mesa_format_to_type_and_comps(gl_format format, + GLenum *datatype, GLuint *comps) +{ + switch (format) { + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_XRGB8888: + *datatype = GL_UNSIGNED_BYTE; + *comps = 4; + return; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: + *datatype = GL_UNSIGNED_BYTE; + *comps = 3; + return; + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGB565_REV: + *datatype = GL_UNSIGNED_SHORT_5_6_5; + *comps = 3; + return; + + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB4444_REV: + *datatype = GL_UNSIGNED_SHORT_4_4_4_4; + *comps = 4; + return; + + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB1555_REV: + *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; + *comps = 4; + return; + + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + *datatype = GL_UNSIGNED_BYTE; + *comps = 2; + return; + + case MESA_FORMAT_AL1616: + case MESA_FORMAT_AL1616_REV: + *datatype = GL_UNSIGNED_SHORT; + *comps = 2; + return; + + case MESA_FORMAT_RGB332: + *datatype = GL_UNSIGNED_BYTE_3_3_2; + *comps = 3; + return; + + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 1; + return; + + case MESA_FORMAT_YCBCR: + case MESA_FORMAT_YCBCR_REV: + *datatype = GL_UNSIGNED_SHORT; + *comps = 2; + return; + + case MESA_FORMAT_Z24_S8: + *datatype = GL_UNSIGNED_INT; + *comps = 1; /* XXX OK? */ + return; + + case MESA_FORMAT_S8_Z24: + *datatype = GL_UNSIGNED_INT; + *comps = 1; /* XXX OK? */ + return; + + case MESA_FORMAT_Z16: + *datatype = GL_UNSIGNED_SHORT; + *comps = 1; + return; + + case MESA_FORMAT_X8_Z24: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + + case MESA_FORMAT_Z24_X8: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + + case MESA_FORMAT_Z32: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + + case MESA_FORMAT_DUDV8: + *datatype = GL_BYTE; + *comps = 2; + return; + + case MESA_FORMAT_SIGNED_RGBA8888: + case MESA_FORMAT_SIGNED_RGBA8888_REV: + *datatype = GL_BYTE; + *comps = 4; + return; + case MESA_FORMAT_SIGNED_RGBA_16: + *datatype = GL_SHORT; + *comps = 4; + return; + +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 3; + return; + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 4; + return; + case MESA_FORMAT_SL8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 1; + return; + case MESA_FORMAT_SLA8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 2; + return; +#endif + +#if FEATURE_texture_fxt1 + case MESA_FORMAT_RGB_FXT1: + case MESA_FORMAT_RGBA_FXT1: +#endif +#if FEATURE_texture_s3tc + case MESA_FORMAT_RGB_DXT1: + case MESA_FORMAT_RGBA_DXT1: + case MESA_FORMAT_RGBA_DXT3: + case MESA_FORMAT_RGBA_DXT5: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: +#endif + /* XXX generate error instead? */ + *datatype = GL_UNSIGNED_BYTE; + *comps = 0; + return; +#endif + + case MESA_FORMAT_RGBA_FLOAT32: + *datatype = GL_FLOAT; + *comps = 4; + return; + case MESA_FORMAT_RGBA_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 4; + return; + case MESA_FORMAT_RGB_FLOAT32: + *datatype = GL_FLOAT; + *comps = 3; + return; + case MESA_FORMAT_RGB_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 3; + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + *datatype = GL_FLOAT; + *comps = 2; + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 2; + return; + case MESA_FORMAT_ALPHA_FLOAT32: + case MESA_FORMAT_LUMINANCE_FLOAT32: + case MESA_FORMAT_INTENSITY_FLOAT32: + *datatype = GL_FLOAT; + *comps = 1; + return; + case MESA_FORMAT_ALPHA_FLOAT16: + case MESA_FORMAT_LUMINANCE_FLOAT16: + case MESA_FORMAT_INTENSITY_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 1; + return; + + default: + _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps"); + *datatype = 0; + *comps = 1; + } +} diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h new file mode 100644 index 000000000..0eeeb8b2b --- /dev/null +++ b/mesalib/src/mesa/main/formats.h @@ -0,0 +1,185 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-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. + */ + +/* + * Authors: + * Brian Paul + */ + + +#ifndef FORMATS_H +#define FORMATS_H + + +#include "main/mtypes.h" + + + +/** + * Mesa texture/renderbuffer image formats. + */ +typedef enum +{ + MESA_FORMAT_NONE = 0, + + /** + * \name Basic hardware formats + */ + /*@{*/ + /* msb <------ TEXEL BITS -----------> lsb */ + /* ---- ---- ---- ---- ---- ---- ---- ---- */ + MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ + MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ + MESA_FORMAT_XRGB8888, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_XRGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */ + MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ + MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ + MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ + MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ + MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ + MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ + MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ + MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ + MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ + MESA_FORMAT_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ + MESA_FORMAT_AL1616_REV, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ + MESA_FORMAT_RGB332, /* RRRG GGBB */ + MESA_FORMAT_A8, /* AAAA AAAA */ + MESA_FORMAT_L8, /* LLLL LLLL */ + MESA_FORMAT_I8, /* IIII IIII */ + MESA_FORMAT_CI8, /* CCCC CCCC */ + MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ + MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ + MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ + MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_X8_Z24, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z24_X8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */ + MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_S8, /* SSSS SSSS */ + /*@}*/ + + /** + * \name 8-bit/channel sRGB formats + */ + /*@{*/ + MESA_FORMAT_SRGB8, + MESA_FORMAT_SRGBA8, + MESA_FORMAT_SARGB8, + MESA_FORMAT_SL8, + MESA_FORMAT_SLA8, + MESA_FORMAT_SRGB_DXT1, + MESA_FORMAT_SRGBA_DXT1, + MESA_FORMAT_SRGBA_DXT3, + MESA_FORMAT_SRGBA_DXT5, + /*@}*/ + + /** + * \name Compressed texture formats. + */ + /*@{*/ + MESA_FORMAT_RGB_FXT1, + MESA_FORMAT_RGBA_FXT1, + MESA_FORMAT_RGB_DXT1, + MESA_FORMAT_RGBA_DXT1, + MESA_FORMAT_RGBA_DXT3, + MESA_FORMAT_RGBA_DXT5, + /*@}*/ + + /** + * \name Floating point texture formats. + */ + /*@{*/ + MESA_FORMAT_RGBA_FLOAT32, + MESA_FORMAT_RGBA_FLOAT16, + MESA_FORMAT_RGB_FLOAT32, + MESA_FORMAT_RGB_FLOAT16, + MESA_FORMAT_ALPHA_FLOAT32, + MESA_FORMAT_ALPHA_FLOAT16, + MESA_FORMAT_LUMINANCE_FLOAT32, + MESA_FORMAT_LUMINANCE_FLOAT16, + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + MESA_FORMAT_INTENSITY_FLOAT32, + MESA_FORMAT_INTENSITY_FLOAT16, + /*@}*/ + + /** + * \name Signed fixed point texture formats. + */ + /*@{*/ + MESA_FORMAT_DUDV8, + MESA_FORMAT_SIGNED_RGBA8888, + MESA_FORMAT_SIGNED_RGBA8888_REV, + MESA_FORMAT_SIGNED_RGBA_16, + /*@}*/ + + MESA_FORMAT_COUNT +} gl_format; + + +extern const char * +_mesa_get_format_name(gl_format format); + +extern GLuint +_mesa_get_format_bytes(gl_format format); + +extern GLint +_mesa_get_format_bits(gl_format format, GLenum pname); + +extern GLenum +_mesa_get_format_datatype(gl_format format); + +extern GLenum +_mesa_get_format_base_format(gl_format format); + +extern void +_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh); + +extern GLboolean +_mesa_is_format_compressed(gl_format format); + +extern GLenum +_mesa_get_format_color_encoding(gl_format format); + +extern GLuint +_mesa_format_image_size(gl_format format, GLsizei width, + GLsizei height, GLsizei depth); + +extern GLint +_mesa_format_row_stride(gl_format format, GLsizei width); + +extern void +_mesa_format_to_type_and_comps(gl_format format, + GLenum *datatype, GLuint *comps); + +extern void +_mesa_test_formats(void); + +#endif /* FORMATS_H */ diff --git a/mesalib/src/mesa/main/framebuffer.c b/mesalib/src/mesa/main/framebuffer.c index dc79b8ca6..d958dbf7d 100644 --- a/mesalib/src/mesa/main/framebuffer.c +++ b/mesalib/src/mesa/main/framebuffer.c @@ -35,6 +35,7 @@ #include "buffers.h" #include "context.h" #include "depthstencil.h" +#include "formats.h" #include "macros.h" #include "mtypes.h" #include "fbobject.h" @@ -281,7 +282,6 @@ _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer *rb = att->Renderbuffer; /* only resize if size is changing */ if (rb->Width != width || rb->Height != height) { - /* could just as well pass rb->_ActualFormat here */ if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { ASSERT(rb->Width == width); ASSERT(rb->Height == height); @@ -523,19 +523,22 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) for (i = 0; i < BUFFER_COUNT; i++) { if (fb->Attachment[i].Renderbuffer) { const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; - if (rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB) { - fb->Visual.redBits = rb->RedBits; - fb->Visual.greenBits = rb->GreenBits; - fb->Visual.blueBits = rb->BlueBits; - fb->Visual.alphaBits = rb->AlphaBits; + const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); + const gl_format fmt = rb->Format; + + if (baseFormat == GL_RGBA || baseFormat == GL_RGB) { + 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.floatMode = GL_FALSE; fb->Visual.samples = rb->NumSamples; break; } - else if (rb->_BaseFormat == GL_COLOR_INDEX) { - fb->Visual.indexBits = rb->IndexBits; + else if (baseFormat == GL_COLOR_INDEX) { + fb->Visual.indexBits = _mesa_get_format_bits(fmt, GL_INDEX_BITS); fb->Visual.rgbMode = GL_FALSE; break; } @@ -543,27 +546,30 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) } 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 - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->DepthBits; + 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 - = fb->Attachment[BUFFER_STENCIL].Renderbuffer->StencilBits; + 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 - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->RedBits; - fb->Visual.accumGreenBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->GreenBits; - fb->Visual.accumBlueBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->BlueBits; - fb->Visual.accumAlphaBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->AlphaBits; + 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); @@ -592,11 +598,11 @@ _mesa_update_depth_buffer(GLcontext *ctx, depthRb = fb->Attachment[attIndex].Renderbuffer; - if (depthRb && depthRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + if (depthRb && depthRb->_BaseFormat == GL_DEPTH_STENCIL) { /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */ if (!fb->_DepthBuffer || fb->_DepthBuffer->Wrapped != depthRb - || fb->_DepthBuffer->_BaseFormat != GL_DEPTH_COMPONENT) { + || _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); @@ -633,11 +639,11 @@ _mesa_update_stencil_buffer(GLcontext *ctx, stencilRb = fb->Attachment[attIndex].Renderbuffer; - if (stencilRb && stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + if (stencilRb && stencilRb->_BaseFormat == GL_DEPTH_STENCIL) { /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */ if (!fb->_StencilBuffer || fb->_StencilBuffer->Wrapped != stencilRb - || fb->_StencilBuffer->_BaseFormat != GL_STENCIL_INDEX) { + || _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); @@ -854,30 +860,32 @@ _mesa_source_buffer_exists(GLcontext *ctx, GLenum format) if (ctx->ReadBuffer->_ColorReadBuffer == NULL) { return GL_FALSE; } - ASSERT(ctx->ReadBuffer->_ColorReadBuffer->RedBits > 0 || - ctx->ReadBuffer->_ColorReadBuffer->IndexBits > 0); + ASSERT(_mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_RED_BITS) > 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); + /*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); + /*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, @@ -932,22 +940,24 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format) if (!att[BUFFER_DEPTH].Renderbuffer) { return GL_FALSE; } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); + /*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); + /*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, @@ -959,3 +969,29 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format) /* OK */ return GL_TRUE; } + +GLenum +_mesa_get_color_read_format(GLcontext *ctx) +{ + switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { + case MESA_FORMAT_ARGB8888: + return GL_BGRA; + case MESA_FORMAT_RGB565: + return GL_BGR; + default: + return GL_RGBA; + } +} + +GLenum +_mesa_get_color_read_type(GLcontext *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; + } +} diff --git a/mesalib/src/mesa/main/framebuffer.h b/mesalib/src/mesa/main/framebuffer.h index 45a4703ba..ef21dd98e 100644 --- a/mesalib/src/mesa/main/framebuffer.h +++ b/mesalib/src/mesa/main/framebuffer.h @@ -81,5 +81,10 @@ _mesa_source_buffer_exists(GLcontext *ctx, GLenum format); extern GLboolean _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format); +extern GLenum +_mesa_get_color_read_type(GLcontext *ctx); + +extern GLenum +_mesa_get_color_read_format(GLcontext *ctx); #endif /* FRAMEBUFFER_H */ diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 604b10621..3f6b03c88 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -13,6 +13,7 @@ #include "mtypes.h" #include "state.h" #include "texcompress.h" +#include "framebuffer.h" #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) @@ -1722,6 +1723,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMin); params[1] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMax); break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetBooleanv"); + params[0] = ctx->Transform.DepthClamp; + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers); break; @@ -1763,11 +1768,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadType); + params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadFormat); + params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); @@ -3553,6 +3558,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Depth.BoundsMin; params[1] = ctx->Depth.BoundsMax; break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.DepthClamp); + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers); break; @@ -3594,11 +3603,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadType); + params[0] = (GLfloat)(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadFormat); + params[0] = (GLfloat)(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); @@ -5384,6 +5393,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Depth.BoundsMin); params[1] = IROUND(ctx->Depth.BoundsMax); break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Transform.DepthClamp); + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = ctx->Const.MaxDrawBuffers; break; @@ -5425,11 +5438,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadType; + params[0] = _mesa_get_color_read_type(ctx); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadFormat; + params[0] = _mesa_get_color_read_format(ctx); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); @@ -7216,6 +7229,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Depth.BoundsMin); params[1] = IROUND64(ctx->Depth.BoundsMax); break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetInteger64v"); + params[0] = BOOLEAN_TO_INT64(ctx->Transform.DepthClamp); + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = (GLint64)(ctx->Const.MaxDrawBuffers); break; @@ -7257,11 +7274,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = (GLint64)(ctx->Const.ColorReadType); + params[0] = (GLint64)(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = (GLint64)(ctx->Const.ColorReadFormat); + params[0] = (GLint64)(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); diff --git a/mesalib/src/mesa/main/get_gen.py b/mesalib/src/mesa/main/get_gen.py deleted file mode 100644 index c7babd1c8..000000000 --- a/mesalib/src/mesa/main/get_gen.py +++ /dev/null @@ -1,1252 +0,0 @@ -#!/usr/bin/env python - -# Mesa 3-D graphics library -# -# 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 script is used to generate the get.c file: -# python get_gen.py > get.c - - -import string - - -GLint = 1 -GLenum = 2 -GLfloat = 3 -GLdouble = 4 -GLboolean = 5 -GLfloatN = 6 # A normalized value, such as a color or depth range -GLint64 = 7 - - -TypeStrings = { - GLint : "GLint", - GLenum : "GLenum", - GLfloat : "GLfloat", - GLdouble : "GLdouble", - GLboolean : "GLboolean", - GLint64 : "GLint64" -} - - -# Each entry is a tuple of: -# - the GL state name, such as GL_CURRENT_COLOR -# - the state datatype, one of GLint, GLfloat, GLboolean or GLenum -# - list of code fragments to get the state, such as ["ctx->Foo.Bar"] -# - optional extra code or empty string. If present, "CONVERSION" will be -# replaced by ENUM_TO_FLOAT, INT_TO_FLOAT, etc. -# - optional extensions to check, or None -# -StateVars = [ - ( "GL_ACCUM_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.accumRedBits"], - "", None ), - ( "GL_ACCUM_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.accumGreenBits"], - "", None ), - ( "GL_ACCUM_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.accumBlueBits"], - "", None ), - ( "GL_ACCUM_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.accumAlphaBits"], - "", None ), - ( "GL_ACCUM_CLEAR_VALUE", GLfloatN, - [ "ctx->Accum.ClearColor[0]", - "ctx->Accum.ClearColor[1]", - "ctx->Accum.ClearColor[2]", - "ctx->Accum.ClearColor[3]" ], - "", None ), - ( "GL_ALPHA_BIAS", GLfloat, ["ctx->Pixel.AlphaBias"], "", None ), - ( "GL_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.alphaBits"], - "", None ), - ( "GL_ALPHA_SCALE", GLfloat, ["ctx->Pixel.AlphaScale"], "", None ), - ( "GL_ALPHA_TEST", GLboolean, ["ctx->Color.AlphaEnabled"], "", None ), - ( "GL_ALPHA_TEST_FUNC", GLenum, ["ctx->Color.AlphaFunc"], "", None ), - ( "GL_ALPHA_TEST_REF", GLfloatN, ["ctx->Color.AlphaRef"], "", None ), - ( "GL_ATTRIB_STACK_DEPTH", GLint, ["ctx->AttribStackDepth"], "", None ), - ( "GL_AUTO_NORMAL", GLboolean, ["ctx->Eval.AutoNormal"], "", None ), - ( "GL_AUX_BUFFERS", GLint, ["ctx->DrawBuffer->Visual.numAuxBuffers"], - "", None ), - ( "GL_BLEND", GLboolean, ["ctx->Color.BlendEnabled"], "", None ), - ( "GL_BLEND_DST", GLenum, ["ctx->Color.BlendDstRGB"], "", None ), - ( "GL_BLEND_SRC", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ), - ( "GL_BLEND_SRC_RGB_EXT", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ), - ( "GL_BLEND_DST_RGB_EXT", GLenum, ["ctx->Color.BlendDstRGB"], "", None ), - ( "GL_BLEND_SRC_ALPHA_EXT", GLenum, ["ctx->Color.BlendSrcA"], "", None ), - ( "GL_BLEND_DST_ALPHA_EXT", GLenum, ["ctx->Color.BlendDstA"], "", None ), - ( "GL_BLEND_EQUATION", GLenum, ["ctx->Color.BlendEquationRGB "], "", None), - ( "GL_BLEND_EQUATION_ALPHA_EXT", GLenum, ["ctx->Color.BlendEquationA "], - "", None ), - ( "GL_BLEND_COLOR_EXT", GLfloatN, - [ "ctx->Color.BlendColor[0]", - "ctx->Color.BlendColor[1]", - "ctx->Color.BlendColor[2]", - "ctx->Color.BlendColor[3]"], "", None ), - ( "GL_BLUE_BIAS", GLfloat, ["ctx->Pixel.BlueBias"], "", None ), - ( "GL_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.blueBits"], "", None ), - ( "GL_BLUE_SCALE", GLfloat, ["ctx->Pixel.BlueScale"], "", None ), - ( "GL_CLIENT_ATTRIB_STACK_DEPTH", GLint, - ["ctx->ClientAttribStackDepth"], "", None ), - ( "GL_CLIP_PLANE0", GLboolean, - [ "(ctx->Transform.ClipPlanesEnabled >> 0) & 1" ], "", None ), - ( "GL_CLIP_PLANE1", GLboolean, - [ "(ctx->Transform.ClipPlanesEnabled >> 1) & 1" ], "", None ), - ( "GL_CLIP_PLANE2", GLboolean, - [ "(ctx->Transform.ClipPlanesEnabled >> 2) & 1" ], "", None ), - ( "GL_CLIP_PLANE3", GLboolean, - [ "(ctx->Transform.ClipPlanesEnabled >> 3) & 1" ], "", None ), - ( "GL_CLIP_PLANE4", GLboolean, - [ "(ctx->Transform.ClipPlanesEnabled >> 4) & 1" ], "", None ), - ( "GL_CLIP_PLANE5", GLboolean, - [ "(ctx->Transform.ClipPlanesEnabled >> 5) & 1" ], "", None ), - ( "GL_COLOR_CLEAR_VALUE", GLfloatN, - [ "ctx->Color.ClearColor[0]", - "ctx->Color.ClearColor[1]", - "ctx->Color.ClearColor[2]", - "ctx->Color.ClearColor[3]" ], "", None ), - ( "GL_COLOR_MATERIAL", GLboolean, - ["ctx->Light.ColorMaterialEnabled"], "", None ), - ( "GL_COLOR_MATERIAL_FACE", GLenum, - ["ctx->Light.ColorMaterialFace"], "", None ), - ( "GL_COLOR_MATERIAL_PARAMETER", GLenum, - ["ctx->Light.ColorMaterialMode"], "", None ), - ( "GL_COLOR_WRITEMASK", GLint, - [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0", - "ctx->Color.ColorMask[GCOMP] ? 1 : 0", - "ctx->Color.ColorMask[BCOMP] ? 1 : 0", - "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ), - ( "GL_CULL_FACE", GLboolean, ["ctx->Polygon.CullFlag"], "", None ), - ( "GL_CULL_FACE_MODE", GLenum, ["ctx->Polygon.CullFaceMode"], "", None ), - ( "GL_CURRENT_COLOR", GLfloatN, - [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]", - "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]", - "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]", - "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]" ], - "FLUSH_CURRENT(ctx, 0);", None ), - ( "GL_CURRENT_INDEX", GLfloat, - [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]" ], - "FLUSH_CURRENT(ctx, 0);", None ), - ( "GL_CURRENT_NORMAL", GLfloatN, - [ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]", - "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]", - "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]"], - "FLUSH_CURRENT(ctx, 0);", None ), - ( "GL_CURRENT_RASTER_COLOR", GLfloatN, - ["ctx->Current.RasterColor[0]", - "ctx->Current.RasterColor[1]", - "ctx->Current.RasterColor[2]", - "ctx->Current.RasterColor[3]"], "", None ), - ( "GL_CURRENT_RASTER_DISTANCE", GLfloat, - ["ctx->Current.RasterDistance"], "", None ), - ( "GL_CURRENT_RASTER_INDEX", GLfloat, - ["ctx->Current.RasterIndex"], "", None ), - ( "GL_CURRENT_RASTER_POSITION", GLfloat, - ["ctx->Current.RasterPos[0]", - "ctx->Current.RasterPos[1]", - "ctx->Current.RasterPos[2]", - "ctx->Current.RasterPos[3]"], "", None ), - ( "GL_CURRENT_RASTER_SECONDARY_COLOR", GLfloatN, - ["ctx->Current.RasterSecondaryColor[0]", - "ctx->Current.RasterSecondaryColor[1]", - "ctx->Current.RasterSecondaryColor[2]", - "ctx->Current.RasterSecondaryColor[3]"], "", None ), - ( "GL_CURRENT_RASTER_TEXTURE_COORDS", GLfloat, - ["ctx->Current.RasterTexCoords[texUnit][0]", - "ctx->Current.RasterTexCoords[texUnit][1]", - "ctx->Current.RasterTexCoords[texUnit][2]", - "ctx->Current.RasterTexCoords[texUnit][3]"], - "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ), - ( "GL_CURRENT_RASTER_POSITION_VALID", GLboolean, - ["ctx->Current.RasterPosValid"], "", None ), - ( "GL_CURRENT_TEXTURE_COORDS", GLfloat, - ["ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]", - "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]", - "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]", - "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"], - """const GLuint texUnit = ctx->Texture.CurrentUnit; - FLUSH_CURRENT(ctx, 0);""", None ), - ( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ), - ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"], - "", None ), - ( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["((GLfloat) ctx->Depth.Clear)"], "", None ), - ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ), - ( "GL_DEPTH_RANGE", GLfloatN, - [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ), - ( "GL_DEPTH_SCALE", GLfloat, ["ctx->Pixel.DepthScale"], "", None ), - ( "GL_DEPTH_TEST", GLboolean, ["ctx->Depth.Test"], "", None ), - ( "GL_DEPTH_WRITEMASK", GLboolean, ["ctx->Depth.Mask"], "", None ), - ( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ), - ( "GL_DOUBLEBUFFER", GLboolean, - ["ctx->DrawBuffer->Visual.doubleBufferMode"], "", None ), - ( "GL_DRAW_BUFFER", GLenum, ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ), - ( "GL_EDGE_FLAG", GLboolean, ["(ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0)"], - "FLUSH_CURRENT(ctx, 0);", None ), - ( "GL_FEEDBACK_BUFFER_SIZE", GLint, ["ctx->Feedback.BufferSize"], "", None ), - ( "GL_FEEDBACK_BUFFER_TYPE", GLenum, ["ctx->Feedback.Type"], "", None ), - ( "GL_FOG", GLboolean, ["ctx->Fog.Enabled"], "", None ), - ( "GL_FOG_COLOR", GLfloatN, - [ "ctx->Fog.Color[0]", - "ctx->Fog.Color[1]", - "ctx->Fog.Color[2]", - "ctx->Fog.Color[3]" ], "", None ), - ( "GL_FOG_DENSITY", GLfloat, ["ctx->Fog.Density"], "", None ), - ( "GL_FOG_END", GLfloat, ["ctx->Fog.End"], "", None ), - ( "GL_FOG_HINT", GLenum, ["ctx->Hint.Fog"], "", None ), - ( "GL_FOG_INDEX", GLfloat, ["ctx->Fog.Index"], "", None ), - ( "GL_FOG_MODE", GLenum, ["ctx->Fog.Mode"], "", None ), - ( "GL_FOG_START", GLfloat, ["ctx->Fog.Start"], "", None ), - ( "GL_FRONT_FACE", GLenum, ["ctx->Polygon.FrontFace"], "", None ), - ( "GL_GREEN_BIAS", GLfloat, ["ctx->Pixel.GreenBias"], "", None ), - ( "GL_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.greenBits"], - "", None ), - ( "GL_GREEN_SCALE", GLfloat, ["ctx->Pixel.GreenScale"], "", None ), - ( "GL_INDEX_BITS", GLint, ["ctx->DrawBuffer->Visual.indexBits"], - "", None ), - ( "GL_INDEX_CLEAR_VALUE", GLint, ["ctx->Color.ClearIndex"], "", None ), - ( "GL_INDEX_MODE", GLboolean, ["!ctx->DrawBuffer->Visual.rgbMode"], - "", None ), - ( "GL_INDEX_OFFSET", GLint, ["ctx->Pixel.IndexOffset"], "", None ), - ( "GL_INDEX_SHIFT", GLint, ["ctx->Pixel.IndexShift"], "", None ), - ( "GL_INDEX_WRITEMASK", GLint, ["ctx->Color.IndexMask"], "", None ), - ( "GL_LIGHT0", GLboolean, ["ctx->Light.Light[0].Enabled"], "", None ), - ( "GL_LIGHT1", GLboolean, ["ctx->Light.Light[1].Enabled"], "", None ), - ( "GL_LIGHT2", GLboolean, ["ctx->Light.Light[2].Enabled"], "", None ), - ( "GL_LIGHT3", GLboolean, ["ctx->Light.Light[3].Enabled"], "", None ), - ( "GL_LIGHT4", GLboolean, ["ctx->Light.Light[4].Enabled"], "", None ), - ( "GL_LIGHT5", GLboolean, ["ctx->Light.Light[5].Enabled"], "", None ), - ( "GL_LIGHT6", GLboolean, ["ctx->Light.Light[6].Enabled"], "", None ), - ( "GL_LIGHT7", GLboolean, ["ctx->Light.Light[7].Enabled"], "", None ), - ( "GL_LIGHTING", GLboolean, ["ctx->Light.Enabled"], "", None ), - ( "GL_LIGHT_MODEL_AMBIENT", GLfloatN, - ["ctx->Light.Model.Ambient[0]", - "ctx->Light.Model.Ambient[1]", - "ctx->Light.Model.Ambient[2]", - "ctx->Light.Model.Ambient[3]"], "", None ), - ( "GL_LIGHT_MODEL_COLOR_CONTROL", GLenum, - ["ctx->Light.Model.ColorControl"], "", None ), - ( "GL_LIGHT_MODEL_LOCAL_VIEWER", GLboolean, - ["ctx->Light.Model.LocalViewer"], "", None ), - ( "GL_LIGHT_MODEL_TWO_SIDE", GLboolean, ["ctx->Light.Model.TwoSide"], "", None ), - ( "GL_LINE_SMOOTH", GLboolean, ["ctx->Line.SmoothFlag"], "", None ), - ( "GL_LINE_SMOOTH_HINT", GLenum, ["ctx->Hint.LineSmooth"], "", None ), - ( "GL_LINE_STIPPLE", GLboolean, ["ctx->Line.StippleFlag"], "", None ), - ( "GL_LINE_STIPPLE_PATTERN", GLint, ["ctx->Line.StipplePattern"], "", None ), - ( "GL_LINE_STIPPLE_REPEAT", GLint, ["ctx->Line.StippleFactor"], "", None ), - ( "GL_LINE_WIDTH", GLfloat, ["ctx->Line.Width"], "", None ), - ( "GL_LINE_WIDTH_GRANULARITY", GLfloat, - ["ctx->Const.LineWidthGranularity"], "", None ), - ( "GL_LINE_WIDTH_RANGE", GLfloat, - ["ctx->Const.MinLineWidthAA", - "ctx->Const.MaxLineWidthAA"], "", None ), - ( "GL_ALIASED_LINE_WIDTH_RANGE", GLfloat, - ["ctx->Const.MinLineWidth", - "ctx->Const.MaxLineWidth"], "", None ), - ( "GL_LIST_BASE", GLint, ["ctx->List.ListBase"], "", None ), - ( "GL_LIST_INDEX", GLint, ["(ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)"], "", None ), - ( "GL_LIST_MODE", GLenum, ["mode"], - """GLenum mode; - if (!ctx->CompileFlag) - mode = 0; - else if (ctx->ExecuteFlag) - mode = GL_COMPILE_AND_EXECUTE; - else - mode = GL_COMPILE;""", None ), - ( "GL_INDEX_LOGIC_OP", GLboolean, ["ctx->Color.IndexLogicOpEnabled"], "", None ), - ( "GL_COLOR_LOGIC_OP", GLboolean, ["ctx->Color.ColorLogicOpEnabled"], "", None ), - ( "GL_LOGIC_OP_MODE", GLenum, ["ctx->Color.LogicOp"], "", None ), - ( "GL_MAP1_COLOR_4", GLboolean, ["ctx->Eval.Map1Color4"], "", None ), - ( "GL_MAP1_GRID_DOMAIN", GLfloat, - ["ctx->Eval.MapGrid1u1", - "ctx->Eval.MapGrid1u2"], "", None ), - ( "GL_MAP1_GRID_SEGMENTS", GLint, ["ctx->Eval.MapGrid1un"], "", None ), - ( "GL_MAP1_INDEX", GLboolean, ["ctx->Eval.Map1Index"], "", None ), - ( "GL_MAP1_NORMAL", GLboolean, ["ctx->Eval.Map1Normal"], "", None ), - ( "GL_MAP1_TEXTURE_COORD_1", GLboolean, ["ctx->Eval.Map1TextureCoord1"], "", None ), - ( "GL_MAP1_TEXTURE_COORD_2", GLboolean, ["ctx->Eval.Map1TextureCoord2"], "", None ), - ( "GL_MAP1_TEXTURE_COORD_3", GLboolean, ["ctx->Eval.Map1TextureCoord3"], "", None ), - ( "GL_MAP1_TEXTURE_COORD_4", GLboolean, ["ctx->Eval.Map1TextureCoord4"], "", None ), - ( "GL_MAP1_VERTEX_3", GLboolean, ["ctx->Eval.Map1Vertex3"], "", None ), - ( "GL_MAP1_VERTEX_4", GLboolean, ["ctx->Eval.Map1Vertex4"], "", None ), - ( "GL_MAP2_COLOR_4", GLboolean, ["ctx->Eval.Map2Color4"], "", None ), - ( "GL_MAP2_GRID_DOMAIN", GLfloat, - ["ctx->Eval.MapGrid2u1", - "ctx->Eval.MapGrid2u2", - "ctx->Eval.MapGrid2v1", - "ctx->Eval.MapGrid2v2"], "", None ), - ( "GL_MAP2_GRID_SEGMENTS", GLint, - ["ctx->Eval.MapGrid2un", - "ctx->Eval.MapGrid2vn"], "", None ), - ( "GL_MAP2_INDEX", GLboolean, ["ctx->Eval.Map2Index"], "", None ), - ( "GL_MAP2_NORMAL", GLboolean, ["ctx->Eval.Map2Normal"], "", None ), - ( "GL_MAP2_TEXTURE_COORD_1", GLboolean, ["ctx->Eval.Map2TextureCoord1"], "", None ), - ( "GL_MAP2_TEXTURE_COORD_2", GLboolean, ["ctx->Eval.Map2TextureCoord2"], "", None ), - ( "GL_MAP2_TEXTURE_COORD_3", GLboolean, ["ctx->Eval.Map2TextureCoord3"], "", None ), - ( "GL_MAP2_TEXTURE_COORD_4", GLboolean, ["ctx->Eval.Map2TextureCoord4"], "", None ), - ( "GL_MAP2_VERTEX_3", GLboolean, ["ctx->Eval.Map2Vertex3"], "", None ), - ( "GL_MAP2_VERTEX_4", GLboolean, ["ctx->Eval.Map2Vertex4"], "", None ), - ( "GL_MAP_COLOR", GLboolean, ["ctx->Pixel.MapColorFlag"], "", None ), - ( "GL_MAP_STENCIL", GLboolean, ["ctx->Pixel.MapStencilFlag"], "", None ), - ( "GL_MATRIX_MODE", GLenum, ["ctx->Transform.MatrixMode"], "", None ), - - ( "GL_MAX_ATTRIB_STACK_DEPTH", GLint, ["MAX_ATTRIB_STACK_DEPTH"], "", None ), - ( "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", GLint, ["MAX_CLIENT_ATTRIB_STACK_DEPTH"], "", None ), - ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ), - ( "GL_MAX_ELEMENTS_VERTICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ), - ( "GL_MAX_ELEMENTS_INDICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ), - ( "GL_MAX_EVAL_ORDER", GLint, ["MAX_EVAL_ORDER"], "", None ), - ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ), - ( "GL_MAX_LIST_NESTING", GLint, ["MAX_LIST_NESTING"], "", None ), - ( "GL_MAX_MODELVIEW_STACK_DEPTH", GLint, ["MAX_MODELVIEW_STACK_DEPTH"], "", None ), - ( "GL_MAX_NAME_STACK_DEPTH", GLint, ["MAX_NAME_STACK_DEPTH"], "", None ), - ( "GL_MAX_PIXEL_MAP_TABLE", GLint, ["MAX_PIXEL_MAP_TABLE"], "", None ), - ( "GL_MAX_PROJECTION_STACK_DEPTH", GLint, ["MAX_PROJECTION_STACK_DEPTH"], "", None ), - ( "GL_MAX_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.MaxTextureLevels - 1)"], "", None ), - ( "GL_MAX_3D_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.Max3DTextureLevels - 1)"], "", None ), - ( "GL_MAX_TEXTURE_STACK_DEPTH", GLint, ["MAX_TEXTURE_STACK_DEPTH"], "", None ), - ( "GL_MAX_VIEWPORT_DIMS", GLint, - ["ctx->Const.MaxViewportWidth", "ctx->Const.MaxViewportHeight"], - "", None ), - ( "GL_MODELVIEW_MATRIX", GLfloat, - [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", - "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", - "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", - "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], - "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ), - ( "GL_MODELVIEW_STACK_DEPTH", GLint, ["ctx->ModelviewMatrixStack.Depth + 1"], "", None ), - ( "GL_NAME_STACK_DEPTH", GLint, ["ctx->Select.NameStackDepth"], "", None ), - ( "GL_NORMALIZE", GLboolean, ["ctx->Transform.Normalize"], "", None ), - ( "GL_PACK_ALIGNMENT", GLint, ["ctx->Pack.Alignment"], "", None ), - ( "GL_PACK_LSB_FIRST", GLboolean, ["ctx->Pack.LsbFirst"], "", None ), - ( "GL_PACK_ROW_LENGTH", GLint, ["ctx->Pack.RowLength"], "", None ), - ( "GL_PACK_SKIP_PIXELS", GLint, ["ctx->Pack.SkipPixels"], "", None ), - ( "GL_PACK_SKIP_ROWS", GLint, ["ctx->Pack.SkipRows"], "", None ), - ( "GL_PACK_SWAP_BYTES", GLboolean, ["ctx->Pack.SwapBytes"], "", None ), - ( "GL_PACK_SKIP_IMAGES_EXT", GLint, ["ctx->Pack.SkipImages"], "", None ), - ( "GL_PACK_IMAGE_HEIGHT_EXT", GLint, ["ctx->Pack.ImageHeight"], "", None ), - ( "GL_PACK_INVERT_MESA", GLboolean, ["ctx->Pack.Invert"], "", None ), - ( "GL_PERSPECTIVE_CORRECTION_HINT", GLenum, - ["ctx->Hint.PerspectiveCorrection"], "", None ), - ( "GL_PIXEL_MAP_A_TO_A_SIZE", GLint, ["ctx->PixelMaps.AtoA.Size"], "", None ), - ( "GL_PIXEL_MAP_B_TO_B_SIZE", GLint, ["ctx->PixelMaps.BtoB.Size"], "", None ), - ( "GL_PIXEL_MAP_G_TO_G_SIZE", GLint, ["ctx->PixelMaps.GtoG.Size"], "", None ), - ( "GL_PIXEL_MAP_I_TO_A_SIZE", GLint, ["ctx->PixelMaps.ItoA.Size"], "", None ), - ( "GL_PIXEL_MAP_I_TO_B_SIZE", GLint, ["ctx->PixelMaps.ItoB.Size"], "", None ), - ( "GL_PIXEL_MAP_I_TO_G_SIZE", GLint, ["ctx->PixelMaps.ItoG.Size"], "", None ), - ( "GL_PIXEL_MAP_I_TO_I_SIZE", GLint, ["ctx->PixelMaps.ItoI.Size"], "", None ), - ( "GL_PIXEL_MAP_I_TO_R_SIZE", GLint, ["ctx->PixelMaps.ItoR.Size"], "", None ), - ( "GL_PIXEL_MAP_R_TO_R_SIZE", GLint, ["ctx->PixelMaps.RtoR.Size"], "", None ), - ( "GL_PIXEL_MAP_S_TO_S_SIZE", GLint, ["ctx->PixelMaps.StoS.Size"], "", None ), - ( "GL_POINT_SIZE", GLfloat, ["ctx->Point.Size"], "", None ), - ( "GL_POINT_SIZE_GRANULARITY", GLfloat, - ["ctx->Const.PointSizeGranularity"], "", None ), - ( "GL_POINT_SIZE_RANGE", GLfloat, - ["ctx->Const.MinPointSizeAA", - "ctx->Const.MaxPointSizeAA"], "", None ), - ( "GL_ALIASED_POINT_SIZE_RANGE", GLfloat, - ["ctx->Const.MinPointSize", - "ctx->Const.MaxPointSize"], "", None ), - ( "GL_POINT_SMOOTH", GLboolean, ["ctx->Point.SmoothFlag"], "", None ), - ( "GL_POINT_SMOOTH_HINT", GLenum, ["ctx->Hint.PointSmooth"], "", None ), - ( "GL_POINT_SIZE_MIN_EXT", GLfloat, ["ctx->Point.MinSize"], "", None ), - ( "GL_POINT_SIZE_MAX_EXT", GLfloat, ["ctx->Point.MaxSize"], "", None ), - ( "GL_POINT_FADE_THRESHOLD_SIZE_EXT", GLfloat, - ["ctx->Point.Threshold"], "", None ), - ( "GL_DISTANCE_ATTENUATION_EXT", GLfloat, - ["ctx->Point.Params[0]", - "ctx->Point.Params[1]", - "ctx->Point.Params[2]"], "", None ), - ( "GL_POLYGON_MODE", GLenum, - ["ctx->Polygon.FrontMode", - "ctx->Polygon.BackMode"], "", None ), - ( "GL_POLYGON_OFFSET_BIAS_EXT", GLfloat, ["ctx->Polygon.OffsetUnits"], "", None ), - ( "GL_POLYGON_OFFSET_FACTOR", GLfloat, ["ctx->Polygon.OffsetFactor "], "", None ), - ( "GL_POLYGON_OFFSET_UNITS", GLfloat, ["ctx->Polygon.OffsetUnits "], "", None ), - ( "GL_POLYGON_OFFSET_POINT", GLboolean, ["ctx->Polygon.OffsetPoint"], "", None ), - ( "GL_POLYGON_OFFSET_LINE", GLboolean, ["ctx->Polygon.OffsetLine"], "", None ), - ( "GL_POLYGON_OFFSET_FILL", GLboolean, ["ctx->Polygon.OffsetFill"], "", None ), - ( "GL_POLYGON_SMOOTH", GLboolean, ["ctx->Polygon.SmoothFlag"], "", None ), - ( "GL_POLYGON_SMOOTH_HINT", GLenum, ["ctx->Hint.PolygonSmooth"], "", None ), - ( "GL_POLYGON_STIPPLE", GLboolean, ["ctx->Polygon.StippleFlag"], "", None ), - ( "GL_PROJECTION_MATRIX", GLfloat, - [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", - "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", - "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", - "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], - "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ), - ( "GL_PROJECTION_STACK_DEPTH", GLint, - ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ), - ( "GL_READ_BUFFER", GLenum, ["ctx->ReadBuffer->ColorReadBuffer"], "", None ), - ( "GL_RED_BIAS", GLfloat, ["ctx->Pixel.RedBias"], "", None ), - ( "GL_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.redBits"], "", None ), - ( "GL_RED_SCALE", GLfloat, ["ctx->Pixel.RedScale"], "", None ), - ( "GL_RENDER_MODE", GLenum, ["ctx->RenderMode"], "", None ), - ( "GL_RESCALE_NORMAL", GLboolean, - ["ctx->Transform.RescaleNormals"], "", None ), - ( "GL_RGBA_MODE", GLboolean, ["ctx->DrawBuffer->Visual.rgbMode"], - "", None ), - ( "GL_SCISSOR_BOX", GLint, - ["ctx->Scissor.X", - "ctx->Scissor.Y", - "ctx->Scissor.Width", - "ctx->Scissor.Height"], "", None ), - ( "GL_SCISSOR_TEST", GLboolean, ["ctx->Scissor.Enabled"], "", None ), - ( "GL_SELECTION_BUFFER_SIZE", GLint, ["ctx->Select.BufferSize"], "", None ), - ( "GL_SHADE_MODEL", GLenum, ["ctx->Light.ShadeModel"], "", None ), - ( "GL_SHARED_TEXTURE_PALETTE_EXT", GLboolean, - ["ctx->Texture.SharedPalette"], "", None ), - ( "GL_STENCIL_BITS", GLint, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ), - ( "GL_STENCIL_CLEAR_VALUE", GLint, ["ctx->Stencil.Clear"], "", None ), - ( "GL_STENCIL_FAIL", GLenum, - ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STENCIL_FUNC", GLenum, - ["ctx->Stencil.Function[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STENCIL_PASS_DEPTH_FAIL", GLenum, - ["ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STENCIL_PASS_DEPTH_PASS", GLenum, - ["ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STENCIL_REF", GLint, - ["ctx->Stencil.Ref[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STENCIL_TEST", GLboolean, ["ctx->Stencil.Enabled"], "", None ), - ( "GL_STENCIL_VALUE_MASK", GLint, - ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STENCIL_WRITEMASK", GLint, - ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STEREO", GLboolean, ["ctx->DrawBuffer->Visual.stereoMode"], - "", None ), - ( "GL_SUBPIXEL_BITS", GLint, ["ctx->Const.SubPixelBits"], "", None ), - ( "GL_TEXTURE_1D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D)"], "", None ), - ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ), - ( "GL_TEXTURE_3D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_3D)"], "", None ), - ( "GL_TEXTURE_1D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), - ( "GL_TEXTURE_2D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), - ( "GL_TEXTURE_BINDING_1D", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name"], "", None ), - ( "GL_TEXTURE_BINDING_2D", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name"], "", None ), - ( "GL_TEXTURE_BINDING_3D", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name"], "", None ), - ( "GL_TEXTURE_BINDING_1D_ARRAY_EXT", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name"], "", ["MESA_texture_array"] ), - ( "GL_TEXTURE_BINDING_2D_ARRAY_EXT", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name"], "", ["MESA_texture_array"] ), - ( "GL_TEXTURE_GEN_S", GLboolean, - ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None ), - ( "GL_TEXTURE_GEN_T", GLboolean, - ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)"], "", None ), - ( "GL_TEXTURE_GEN_R", GLboolean, - ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)"], "", None ), - ( "GL_TEXTURE_GEN_Q", GLboolean, - ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)"], "", None ), - ( "GL_TEXTURE_MATRIX", GLfloat, - ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", - "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", - "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", - "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], - "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ), - ( "GL_TEXTURE_STACK_DEPTH", GLint, - ["ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1"], "", None ), - ( "GL_UNPACK_ALIGNMENT", GLint, ["ctx->Unpack.Alignment"], "", None ), - ( "GL_UNPACK_LSB_FIRST", GLboolean, ["ctx->Unpack.LsbFirst"], "", None ), - ( "GL_UNPACK_ROW_LENGTH", GLint, ["ctx->Unpack.RowLength"], "", None ), - ( "GL_UNPACK_SKIP_PIXELS", GLint, ["ctx->Unpack.SkipPixels"], "", None ), - ( "GL_UNPACK_SKIP_ROWS", GLint, ["ctx->Unpack.SkipRows"], "", None ), - ( "GL_UNPACK_SWAP_BYTES", GLboolean, ["ctx->Unpack.SwapBytes"], "", None ), - ( "GL_UNPACK_SKIP_IMAGES_EXT", GLint, ["ctx->Unpack.SkipImages"], "", None ), - ( "GL_UNPACK_IMAGE_HEIGHT_EXT", GLint, ["ctx->Unpack.ImageHeight"], "", None ), - ( "GL_UNPACK_CLIENT_STORAGE_APPLE", GLboolean, ["ctx->Unpack.ClientStorage"], "", None ), - ( "GL_VIEWPORT", GLint, [ "ctx->Viewport.X", "ctx->Viewport.Y", - "ctx->Viewport.Width", "ctx->Viewport.Height" ], "", None ), - ( "GL_ZOOM_X", GLfloat, ["ctx->Pixel.ZoomX"], "", None ), - ( "GL_ZOOM_Y", GLfloat, ["ctx->Pixel.ZoomY"], "", None ), - - # Vertex arrays - ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Vertex.Enabled"], "", None ), - ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Vertex.Size"], "", None ), - ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Vertex.Type"], "", None ), - ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Vertex.Stride"], "", None ), - ( "GL_VERTEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.ArrayObj->Normal.Enabled"], "", None ), - ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Normal.Type"], "", None ), - ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Normal.Stride"], "", None ), - ( "GL_NORMAL_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Color.Enabled"], "", None ), - ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Color.Size"], "", None ), - ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Color.Type"], "", None ), - ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Color.Stride"], "", None ), - ( "GL_COLOR_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_INDEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Index.Enabled"], "", None ), - ( "GL_INDEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Index.Type"], "", None ), - ( "GL_INDEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Index.Stride"], "", None ), - ( "GL_INDEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_TEXTURE_COORD_ARRAY", GLboolean, - ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ), - ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint, - ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size"], "", None ), - ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum, - ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type"], "", None ), - ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint, - ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ), - ( "GL_TEXTURE_COORD_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_EDGE_FLAG_ARRAY", GLboolean, ["ctx->Array.ArrayObj->EdgeFlag.Enabled"], "", None ), - ( "GL_EDGE_FLAG_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->EdgeFlag.Stride"], "", None ), - ( "GL_EDGE_FLAG_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - - # GL_ARB_multitexture - ( "GL_MAX_TEXTURE_UNITS_ARB", GLint, - ["ctx->Const.MaxTextureUnits"], "", ["ARB_multitexture"] ), - ( "GL_ACTIVE_TEXTURE_ARB", GLint, - [ "GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit"], "", ["ARB_multitexture"] ), - ( "GL_CLIENT_ACTIVE_TEXTURE_ARB", GLint, - ["GL_TEXTURE0_ARB + ctx->Array.ActiveTexture"], "", ["ARB_multitexture"] ), - - # GL_ARB_texture_cube_map - ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean, - ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", ["ARB_texture_cube_map"] ), - ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name"], - "", ["ARB_texture_cube_map"] ), - ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint, - ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"], - "", ["ARB_texture_cube_map"]), - - # GL_ARB_texture_compression */ - ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint, - ["ctx->Hint.TextureCompression"], "", None ), - ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, - ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"], - "", None ), - ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum, - [], - """GLint formats[100]; - GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); - ASSERT(n <= 100); - for (i = 0; i < n; i++) - params[i] = CONVERSION(formats[i]);""", - None ), - - # GL_EXT_compiled_vertex_array - ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"], - "", ["EXT_compiled_vertex_array"] ), - ( "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", GLint, ["ctx->Array.LockCount"], - "", ["EXT_compiled_vertex_array"] ), - - # GL_ARB_transpose_matrix - ( "GL_TRANSPOSE_COLOR_MATRIX_ARB", GLfloat, - ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", - "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", - "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", - "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], - "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ), - ( "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB", GLfloat, - ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", - "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", - "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", - "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], - "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ), - ( "GL_TRANSPOSE_PROJECTION_MATRIX_ARB", GLfloat, - ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", - "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", - "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", - "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], - "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ), - ( "GL_TRANSPOSE_TEXTURE_MATRIX_ARB", GLfloat, - ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", - "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", - "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", - "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], - "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ), - - # GL_SGI_color_matrix (also in 1.2 imaging) - ( "GL_COLOR_MATRIX_SGI", GLfloat, - ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", - "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", - "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", - "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], - "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ), - ( "GL_COLOR_MATRIX_STACK_DEPTH_SGI", GLint, - ["ctx->ColorMatrixStack.Depth + 1"], "", None ), - ( "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI", GLint, - ["MAX_COLOR_STACK_DEPTH"], "", None ), - ( "GL_POST_COLOR_MATRIX_RED_SCALE_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixScale[0]"], "", None ), - ( "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixScale[1]"], "", None ), - ( "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixScale[2]"], "", None ), - ( "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixScale[3]"], "", None ), - ( "GL_POST_COLOR_MATRIX_RED_BIAS_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixBias[0]"], "", None ), - ( "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixBias[1]"], "", None ), - ( "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixBias[2]"], "", None ), - ( "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI", GLfloat, - ["ctx->Pixel.PostColorMatrixBias[3]"], "", None ), - - # GL_EXT_convolution (also in 1.2 imaging) - ( "GL_CONVOLUTION_1D_EXT", GLboolean, - ["ctx->Pixel.Convolution1DEnabled"], "", ["EXT_convolution"] ), - ( "GL_CONVOLUTION_2D_EXT", GLboolean, - ["ctx->Pixel.Convolution2DEnabled"], "", ["EXT_convolution"] ), - ( "GL_SEPARABLE_2D_EXT", GLboolean, - ["ctx->Pixel.Separable2DEnabled"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_RED_SCALE_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionScale[0]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_GREEN_SCALE_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionScale[1]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_BLUE_SCALE_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionScale[2]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionScale[3]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_RED_BIAS_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionBias[0]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_GREEN_BIAS_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionBias[1]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_BLUE_BIAS_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionBias[2]"], "", ["EXT_convolution"] ), - ( "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT", GLfloat, - ["ctx->Pixel.PostConvolutionBias[3]"], "", ["EXT_convolution"] ), - - # GL_EXT_histogram / GL_ARB_imaging - ( "GL_HISTOGRAM", GLboolean, - [ "ctx->Pixel.HistogramEnabled" ], "", ["EXT_histogram"] ), - ( "GL_MINMAX", GLboolean, - [ "ctx->Pixel.MinMaxEnabled" ], "", ["EXT_histogram"] ), - - # GL_SGI_color_table / GL_ARB_imaging - ( "GL_COLOR_TABLE_SGI", GLboolean, - ["ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]"], "", ["SGI_color_table"] ), - ( "GL_POST_CONVOLUTION_COLOR_TABLE_SGI", GLboolean, - ["ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]"], "", ["SGI_color_table"] ), - ( "GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI", GLboolean, - ["ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]"], "", ["SGI_color_table"] ), - - # GL_SGI_texture_color_table - ( "GL_TEXTURE_COLOR_TABLE_SGI", GLboolean, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled"], - "", ["SGI_texture_color_table"] ), - - # GL_EXT_secondary_color - ( "GL_COLOR_SUM_EXT", GLboolean, - ["ctx->Fog.ColorSumEnabled"], "", - ["EXT_secondary_color", "ARB_vertex_program"] ), - ( "GL_CURRENT_SECONDARY_COLOR_EXT", GLfloatN, - ["ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]", - "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]", - "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]", - "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]"], - "FLUSH_CURRENT(ctx, 0);", ["EXT_secondary_color"] ), - ( "GL_SECONDARY_COLOR_ARRAY_EXT", GLboolean, - ["ctx->Array.ArrayObj->SecondaryColor.Enabled"], "", ["EXT_secondary_color"] ), - ( "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT", GLenum, - ["ctx->Array.ArrayObj->SecondaryColor.Type"], "", ["EXT_secondary_color"] ), - ( "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT", GLint, - ["ctx->Array.ArrayObj->SecondaryColor.Stride"], "", ["EXT_secondary_color"] ), - ( "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT", GLint, - ["ctx->Array.ArrayObj->SecondaryColor.Size"], "", ["EXT_secondary_color"] ), - - # GL_EXT_fog_coord - ( "GL_CURRENT_FOG_COORDINATE_EXT", GLfloat, - ["ctx->Current.Attrib[VERT_ATTRIB_FOG][0]"], - "FLUSH_CURRENT(ctx, 0);", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_ARRAY_EXT", GLboolean, ["ctx->Array.ArrayObj->FogCoord.Enabled"], - "", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_ARRAY_TYPE_EXT", GLenum, ["ctx->Array.ArrayObj->FogCoord.Type"], - "", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT", GLint, ["ctx->Array.ArrayObj->FogCoord.Stride"], - "", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_SOURCE_EXT", GLenum, ["ctx->Fog.FogCoordinateSource"], - "", ["EXT_fog_coord"] ), - - # GL_EXT_texture_lod_bias - ( "GL_MAX_TEXTURE_LOD_BIAS_EXT", GLfloat, - ["ctx->Const.MaxTextureLodBias"], "", ["EXT_texture_lod_bias"]), - - # GL_EXT_texture_filter_anisotropic - ( "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", GLfloat, - ["ctx->Const.MaxTextureMaxAnisotropy"], "", ["EXT_texture_filter_anisotropic"]), - - # GL_ARB_multisample - ( "GL_MULTISAMPLE_ARB", GLboolean, - ["ctx->Multisample.Enabled"], "", None ), - ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean, - ["ctx->Multisample.SampleAlphaToCoverage"], "", None ), - ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean, - ["ctx->Multisample.SampleAlphaToOne"], "", None ), - ( "GL_SAMPLE_COVERAGE_ARB", GLboolean, - ["ctx->Multisample.SampleCoverage"], "", None ), - ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat, - ["ctx->Multisample.SampleCoverageValue"], "", None ), - ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean, - ["ctx->Multisample.SampleCoverageInvert"], "", None ), - ( "GL_SAMPLE_BUFFERS_ARB", GLint, - ["ctx->DrawBuffer->Visual.sampleBuffers"], "", None ), - ( "GL_SAMPLES_ARB", GLint, - ["ctx->DrawBuffer->Visual.samples"], "", None ), - - # GL_IBM_rasterpos_clip - ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean, - ["ctx->Transform.RasterPositionUnclipped"], "", ["IBM_rasterpos_clip"] ), - - # GL_NV_point_sprite - ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"], # == GL_POINT_SPRITE_ARB - "", ["NV_point_sprite", "ARB_point_sprite"] ), - ( "GL_POINT_SPRITE_R_MODE_NV", GLenum, ["ctx->Point.SpriteRMode"], - "", ["NV_point_sprite"] ), - ( "GL_POINT_SPRITE_COORD_ORIGIN", GLenum, ["ctx->Point.SpriteOrigin"], - "", ["NV_point_sprite", "ARB_point_sprite"] ), - - # GL_SGIS_generate_mipmap - ( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum, ["ctx->Hint.GenerateMipmap"], - "", ["SGIS_generate_mipmap"] ), - - # GL_NV_vertex_program - ( "GL_VERTEX_PROGRAM_BINDING_NV", GLint, - ["(ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)"], - "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY0_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[0].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY1_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[1].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY2_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[2].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY3_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[3].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY4_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[4].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY5_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[5].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY6_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[6].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY7_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[7].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY8_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[8].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY9_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[9].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY10_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[10].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY11_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[11].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY12_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[12].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY13_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[13].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY14_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[14].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_VERTEX_ATTRIB_ARRAY15_NV", GLboolean, - ["ctx->Array.ArrayObj->VertexAttrib[15].Enabled"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB0_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[0]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB1_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[1]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB2_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[2]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB3_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[3]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB4_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[4]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB5_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[5]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB6_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[6]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB7_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[7]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB8_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[8]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB9_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[9]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB10_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[10]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB11_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[11]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB12_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[12]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB13_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[13]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB14_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[14]"], "", ["NV_vertex_program"] ), - ( "GL_MAP1_VERTEX_ATTRIB15_4_NV", GLboolean, - ["ctx->Eval.Map1Attrib[15]"], "", ["NV_vertex_program"] ), - - # GL_NV_fragment_program - ( "GL_FRAGMENT_PROGRAM_NV", GLboolean, - ["ctx->FragmentProgram.Enabled"], "", ["NV_fragment_program"] ), - ( "GL_FRAGMENT_PROGRAM_BINDING_NV", GLint, - ["ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0"], - "", ["NV_fragment_program"] ), - ( "GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV", GLint, - ["MAX_NV_FRAGMENT_PROGRAM_PARAMS"], "", ["NV_fragment_program"] ), - - # GL_NV_texture_rectangle - ( "GL_TEXTURE_RECTANGLE_NV", GLboolean, - ["_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)"], "", ["NV_texture_rectangle"] ), - ( "GL_TEXTURE_BINDING_RECTANGLE_NV", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name"], - "", ["NV_texture_rectangle"] ), - ( "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV", GLint, - ["ctx->Const.MaxTextureRectSize"], "", ["NV_texture_rectangle"] ), - - # GL_EXT_stencil_two_side - ( "GL_STENCIL_TEST_TWO_SIDE_EXT", GLboolean, - ["ctx->Stencil.TestTwoSide"], "", ["EXT_stencil_two_side"] ), - ( "GL_ACTIVE_STENCIL_FACE_EXT", GLenum, - ["ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT"], - "", ["EXT_stencil_two_side"] ), - - # GL_NV_light_max_exponent - ( "GL_MAX_SHININESS_NV", GLfloat, - ["ctx->Const.MaxShininess"], "", ["NV_light_max_exponent"] ), - ( "GL_MAX_SPOT_EXPONENT_NV", GLfloat, - ["ctx->Const.MaxSpotExponent"], "", ["NV_light_max_exponent"] ), - - # GL_ARB_vertex_buffer_object - ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayBufferObj->Name"], "", None ), - ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", None ), - ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", None ), - ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", None ), - ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", None ), - ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], - "", None ), - ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", None ), - ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"], - "", None ), - ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"], - "", None ), - # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported - ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ElementArrayBufferObj->Name"], - "", None ), - - # GL_EXT_pixel_buffer_object - ( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint, - ["ctx->Pack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ), - ( "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT", GLint, - ["ctx->Unpack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ), - - # GL_ARB_vertex_program - ( "GL_VERTEX_PROGRAM_ARB", GLboolean, # == GL_VERTEX_PROGRAM_NV - ["ctx->VertexProgram.Enabled"], "", - ["ARB_vertex_program", "NV_vertex_program"] ), - ( "GL_VERTEX_PROGRAM_POINT_SIZE_ARB", GLboolean, # == GL_VERTEX_PROGRAM_POINT_SIZE_NV - ["ctx->VertexProgram.PointSizeEnabled"], "", - ["ARB_vertex_program", "NV_vertex_program"] ), - ( "GL_VERTEX_PROGRAM_TWO_SIDE_ARB", GLboolean, # == GL_VERTEX_PROGRAM_TWO_SIDE_NV - ["ctx->VertexProgram.TwoSideEnabled"], "", - ["ARB_vertex_program", "NV_vertex_program"] ), - ( "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB", GLint, # == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV - ["ctx->Const.MaxProgramMatrixStackDepth"], "", - ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), - ( "GL_MAX_PROGRAM_MATRICES_ARB", GLint, # == GL_MAX_TRACK_MATRICES_NV - ["ctx->Const.MaxProgramMatrices"], "", - ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), - ( "GL_CURRENT_MATRIX_STACK_DEPTH_ARB", GLboolean, # == GL_CURRENT_MATRIX_STACK_DEPTH_NV - ["ctx->CurrentStack->Depth + 1"], "", - ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), - ( "GL_CURRENT_MATRIX_ARB", GLfloat, # == GL_CURRENT_MATRIX_NV - ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", - "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", - "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", - "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], - "const GLfloat *matrix = ctx->CurrentStack->Top->m;", - ["ARB_vertex_program", "ARB_fragment_program", "NV_fragment_program"] ), - ( "GL_TRANSPOSE_CURRENT_MATRIX_ARB", GLfloat, - ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", - "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", - "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", - "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], - "const GLfloat *matrix = ctx->CurrentStack->Top->m;", - ["ARB_vertex_program", "ARB_fragment_program"] ), - ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint, - ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ), - ( "GL_PROGRAM_ERROR_POSITION_ARB", GLint, # == GL_PROGRAM_ERROR_POSITION_NV - ["ctx->Program.ErrorPos"], "", ["NV_vertex_program", - "ARB_vertex_program", "NV_fragment_program", "ARB_fragment_program"] ), - - # GL_ARB_fragment_program - ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean, - ["ctx->FragmentProgram.Enabled"], "", ["ARB_fragment_program"] ), - ( "GL_MAX_TEXTURE_COORDS_ARB", GLint, # == GL_MAX_TEXTURE_COORDS_NV - ["ctx->Const.MaxTextureCoordUnits"], "", - ["ARB_fragment_program", "NV_fragment_program"] ), - ( "GL_MAX_TEXTURE_IMAGE_UNITS_ARB", GLint, # == GL_MAX_TEXTURE_IMAGE_UNITS_NV - ["ctx->Const.MaxTextureImageUnits"], "", - ["ARB_fragment_program", "NV_fragment_program"] ), - - # GL_EXT_depth_bounds_test - ( "GL_DEPTH_BOUNDS_TEST_EXT", GLboolean, - ["ctx->Depth.BoundsTest"], "", ["EXT_depth_bounds_test"] ), - ( "GL_DEPTH_BOUNDS_EXT", GLfloat, - ["ctx->Depth.BoundsMin", "ctx->Depth.BoundsMax"], - "", ["EXT_depth_bounds_test"] ), - - # GL_ARB_draw_buffers - ( "GL_MAX_DRAW_BUFFERS_ARB", GLint, - ["ctx->Const.MaxDrawBuffers"], "", None ), - ( "GL_DRAW_BUFFER0_ARB", GLenum, - ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ), - ( "GL_DRAW_BUFFER1_ARB", GLenum, - ["buffer"], - """GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", None ), - ( "GL_DRAW_BUFFER2_ARB", GLenum, - ["buffer"], - """GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", None ), - ( "GL_DRAW_BUFFER3_ARB", GLenum, - ["buffer"], - """GLenum buffer; - if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); - return; - } - buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", None ), - # XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future - - # GL_OES_read_format - ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint, - ["ctx->Const.ColorReadType"], "", ["OES_read_format"] ), - ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint, - ["ctx->Const.ColorReadFormat"], "", ["OES_read_format"] ), - - # GL_ATI_fragment_shader - ( "GL_NUM_FRAGMENT_REGISTERS_ATI", GLint, ["6"], "", ["ATI_fragment_shader"] ), - ( "GL_NUM_FRAGMENT_CONSTANTS_ATI", GLint, ["8"], "", ["ATI_fragment_shader"] ), - ( "GL_NUM_PASSES_ATI", GLint, ["2"], "", ["ATI_fragment_shader"] ), - ( "GL_NUM_INSTRUCTIONS_PER_PASS_ATI", GLint, ["8"], "", ["ATI_fragment_shader"] ), - ( "GL_NUM_INSTRUCTIONS_TOTAL_ATI", GLint, ["16"], "", ["ATI_fragment_shader"] ), - ( "GL_COLOR_ALPHA_PAIRING_ATI", GLboolean, ["GL_TRUE"], "", ["ATI_fragment_shader"] ), - ( "GL_NUM_LOOPBACK_COMPONENTS_ATI", GLint, ["3"], "", ["ATI_fragment_shader"] ), - ( "GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI", GLint, ["3"], "", ["ATI_fragment_shader"] ), - - # OpenGL 2.0 - ( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ), - ( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ), - ( "GL_STENCIL_BACK_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[1]"], "", None ), - ( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ), - ( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ), - ( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ), - ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum, ["ctx->Stencil.ZPassFunc[1]"], "", None ), - - # GL_EXT_framebuffer_object - ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->DrawBuffer->Name"], "", - ["EXT_framebuffer_object"] ), - ( "GL_RENDERBUFFER_BINDING_EXT", GLint, - ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "", - ["EXT_framebuffer_object"] ), - ( "GL_MAX_COLOR_ATTACHMENTS_EXT", GLint, - ["ctx->Const.MaxColorAttachments"], "", - ["EXT_framebuffer_object"] ), - ( "GL_MAX_RENDERBUFFER_SIZE_EXT", GLint, - ["ctx->Const.MaxRenderbufferSize"], "", - ["EXT_framebuffer_object"] ), - - # GL_EXT_framebuffer_blit - # NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT - ( "GL_READ_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->ReadBuffer->Name"], "", - ["EXT_framebuffer_blit"] ), - - # GL_EXT_provoking_vertex - ( "GL_PROVOKING_VERTEX_EXT", GLboolean, - ["ctx->Light.ProvokingVertex"], "", ["EXT_provoking_vertex"] ), - ( "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT", GLboolean, - ["ctx->Const.QuadsFollowProvokingVertexConvention"], "", - ["EXT_provoking_vertex"] ), - - # GL_ARB_fragment_shader - ( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint, - ["ctx->Const.FragmentProgram.MaxUniformComponents"], "", - ["ARB_fragment_shader"] ), - ( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum, - ["ctx->Hint.FragmentShaderDerivative"], "", ["ARB_fragment_shader"] ), - - # GL_ARB_vertex_shader - ( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint, - ["ctx->Const.VertexProgram.MaxUniformComponents"], "", - ["ARB_vertex_shader"] ), - ( "GL_MAX_VARYING_FLOATS_ARB", GLint, - ["ctx->Const.MaxVarying * 4"], "", ["ARB_vertex_shader"] ), - ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint, - ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ), - ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint, - ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["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", GLint, - ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"], - "", ["ARB_shader_objects"] ), - - # GL_ARB_framebuffer_object - ( "GL_MAX_SAMPLES", GLint, ["ctx->Const.MaxSamples"], "", - ["ARB_framebuffer_object"] ), - - # GL_APPLE_vertex_array_object - ( "GL_VERTEX_ARRAY_BINDING_APPLE", GLint, ["ctx->Array.ArrayObj->Name"], "", - ["APPLE_vertex_array_object"] ), - - # GL_ARB_seamless_cube_map - ( "GL_TEXTURE_CUBE_MAP_SEAMLESS", GLboolean, ["ctx->Texture.CubeMapSeamless"], "", - ["ARB_seamless_cube_map"] ), - - # GL_ARB_sync - ( "GL_MAX_SERVER_WAIT_TIMEOUT", GLint64, ["ctx->Const.MaxServerWaitTimeout"], "", - ["ARB_sync"] ), -] - - -def ConversionFunc(fromType, toType): - """Return the name of the macro to convert between two data types.""" - if fromType == toType: - return "" - elif fromType == GLfloat and toType == GLint: - return "IROUND" - elif fromType == GLfloat and toType == GLint64: - return "IROUND64" - elif fromType == GLfloatN and toType == GLfloat: - return "" - elif fromType == GLint and toType == GLfloat: # but not GLfloatN! - return "(GLfloat)" - elif fromType == GLint and toType == GLint64: - return "(GLint64)" - elif fromType == GLint64 and toType == GLfloat: # but not GLfloatN! - return "(GLfloat)" - else: - if fromType == GLfloatN: - fromType = GLfloat - fromStr = TypeStrings[fromType] - fromStr = string.upper(fromStr[2:]) - toStr = TypeStrings[toType] - toStr = string.upper(toStr[2:]) - return fromStr + "_TO_" + toStr - - -def EmitGetFunction(stateVars, returnType): - """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv.""" - assert (returnType == GLboolean or - returnType == GLint or - returnType == GLint64 or - returnType == GLfloat) - - strType = TypeStrings[returnType] - # Capitalize first letter of return type - if returnType == GLint: - function = "GetIntegerv" - elif returnType == GLboolean: - function = "GetBooleanv" - elif returnType == GLfloat: - function = "GetFloatv" - elif returnType == GLint64: - function = "GetInteger64v" - else: - abort() - - if returnType == GLint64: - print "#if FEATURE_ARB_sync" - - print "void GLAPIENTRY" - print "_mesa_%s( GLenum pname, %s *params )" % (function, strType) - print "{" - print " GET_CURRENT_CONTEXT(ctx);" - print " ASSERT_OUTSIDE_BEGIN_END(ctx);" - print "" - print " if (!params)" - print " return;" - print "" - print " if (ctx->NewState)" - print " _mesa_update_state(ctx);" - print "" - print " if (ctx->Driver.%s &&" % function - print " ctx->Driver.%s(ctx, pname, params))" % function - print " return;" - print "" - print " switch (pname) {" - - for (name, varType, state, optionalCode, extensions) in stateVars: - print " case " + name + ":" - if extensions: - if len(extensions) == 1: - print (' CHECK_EXT1(%s, "%s");' % - (extensions[0], function)) - elif len(extensions) == 2: - print (' CHECK_EXT2(%s, %s, "%s");' % - (extensions[0], extensions[1], function)) - elif len(extensions) == 3: - print (' CHECK_EXT3(%s, %s, %s, "%s");' % - (extensions[0], extensions[1], extensions[2], function)) - else: - assert len(extensions) == 4 - print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' % - (extensions[0], extensions[1], extensions[2], extensions[3], function)) - conversion = ConversionFunc(varType, returnType) - if optionalCode: - optionalCode = string.replace(optionalCode, "CONVERSION", conversion); - print " {" - print " " + optionalCode - n = len(state) - for i in range(n): - if conversion: - print " params[%d] = %s(%s);" % (i, conversion, state[i]) - else: - print " params[%d] = %s;" % (i, state[i]) - if optionalCode: - print " }" - print " break;" - - print " default:" - print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function - print " }" - print "}" - if returnType == GLint64: - print "#endif /* FEATURE_ARB_sync */" - print "" - return - - - -def EmitHeader(): - """Print the get.c file header.""" - print """ -/*** - *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py - ***/ - -#include "glheader.h" -#include "context.h" -#include "enable.h" -#include "extensions.h" -#include "fbobject.h" -#include "get.h" -#include "macros.h" -#include "mtypes.h" -#include "state.h" -#include "texcompress.h" - - -#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) - -#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) - -#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 ENUM_TO_INT64(E) ( (GLint64) (E) ) - - -/* - * Check if named extension is enabled, if not generate error and return. - */ -#define CHECK_EXT1(EXT1, FUNC) \\ - if (!ctx->Extensions.EXT1) { \\ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ - return; \\ - } - -/* - * Check if either of two extensions is enabled. - */ -#define CHECK_EXT2(EXT1, EXT2, FUNC) \\ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \\ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ - return; \\ - } - -/* - * Check if either of three extensions is enabled. - */ -#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \\ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\ - !ctx->Extensions.EXT3) { \\ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ - return; \\ - } - -/* - * Check if either of four extensions is enabled. - */ -#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \\ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\ - !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \\ - _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ - return; \\ - } - -""" - return - - - -def EmitGetDoublev(): - print """ -void GLAPIENTRY -_mesa_GetDoublev( GLenum pname, GLdouble *params ) -{ - const GLfloat magic = -1234.5F; - GLfloat values[16]; - GLuint i; - - if (!params) - return; - - /* Init temp array to magic numbers so we can figure out how many values - * are returned by the GetFloatv() call. - */ - for (i = 0; i < 16; i++) - values[i] = magic; - - _mesa_GetFloatv(pname, values); - - for (i = 0; i < 16 && values[i] != magic; i++) - params[i] = (GLdouble) values[i]; -} -""" - - - - -EmitHeader() -# XXX Maybe sort the StateVars list -EmitGetFunction(StateVars, GLboolean) -EmitGetFunction(StateVars, GLfloat) -EmitGetFunction(StateVars, GLint) -EmitGetFunction(StateVars, GLint64) -EmitGetDoublev() - diff --git a/mesalib/src/mesa/main/histogram.c b/mesalib/src/mesa/main/histogram.c index 2b3e62c7d..c7304e8dd 100644 --- a/mesalib/src/mesa/main/histogram.c +++ b/mesalib/src/mesa/main/histogram.c @@ -29,8 +29,11 @@ #include "context.h" #include "image.h" #include "histogram.h" +#include "glapi/dispatch.h" +#if FEATURE_histogram + /* * XXX the packed pixel formats haven't been tested. @@ -615,7 +618,11 @@ base_histogram_format( GLenum format ) */ -void GLAPIENTRY +/* this is defined below */ +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); + + +static void GLAPIENTRY _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -678,7 +685,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -738,7 +745,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -785,7 +792,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -832,7 +839,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -858,7 +865,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -884,7 +891,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) { GLuint i; @@ -967,7 +974,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) { GET_CURRENT_CONTEXT(ctx); @@ -995,7 +1002,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetHistogram(GLenum target) { GLuint i; @@ -1021,7 +1028,7 @@ _mesa_ResetHistogram(GLenum target) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target) { GET_CURRENT_CONTEXT(ctx); @@ -1044,6 +1051,24 @@ _mesa_ResetMinmax(GLenum target) } +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); +} + + +#endif /* FEATURE_histogram */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/mesalib/src/mesa/main/histogram.h b/mesalib/src/mesa/main/histogram.h index 367e9b11b..dbae1bbd0 100644 --- a/mesalib/src/mesa/main/histogram.h +++ b/mesalib/src/mesa/main/histogram.h @@ -36,48 +36,22 @@ #ifndef HISTOGRAM_H #define HISTOGRAM_H -#include "glheader.h" -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_histogram -extern void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +extern void +_mesa_init_histogram_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +#else /* FEATURE_histogram */ -extern void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params); +static INLINE void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_ResetHistogram(GLenum target); - -extern void GLAPIENTRY -_mesa_ResetMinmax(GLenum target); +#endif /* FEATURE_histogram */ extern void _mesa_init_histogram( GLcontext * ctx ); -#else - -/** No-op */ -#define _mesa_init_histogram( c ) ((void) 0) - -#endif - -#endif +#endif /* HISTOGRAM_H */ diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c index 10c89f436..654faa5c7 100644 --- a/mesalib/src/mesa/main/light.c +++ b/mesalib/src/mesa/main/light.c @@ -206,7 +206,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params) void GLAPIENTRY _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) { - _mesa_Lightfv( light, pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Lightfv( light, pname, fparam ); } @@ -285,7 +288,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) void GLAPIENTRY _mesa_Lighti( GLenum light, GLenum pname, GLint param ) { - _mesa_Lightiv( light, pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_Lightiv( light, pname, iparam ); } @@ -537,14 +543,20 @@ _mesa_LightModeliv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_LightModeli( GLenum pname, GLint param ) { - _mesa_LightModeliv( pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_LightModeliv( pname, iparam ); } void GLAPIENTRY _mesa_LightModelf( GLenum pname, GLfloat param ) { - _mesa_LightModelfv( pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_LightModelfv( pname, fparam ); } @@ -636,7 +648,7 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) struct gl_light *light, *list = &ctx->Light.EnabledList; GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - if (MESA_VERBOSE&VERBOSE_IMMEDIATE) + if (MESA_VERBOSE & VERBOSE_MATERIAL) _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); if (!bitmask) diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h index e23cdb1f4..4e68bc15d 100644 --- a/mesalib/src/mesa/main/mfeatures.h +++ b/mesalib/src/mesa/main/mfeatures.h @@ -36,12 +36,53 @@ #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 driver entries, they can be initialized by + * _MESA_INIT__FUNCTIONS + * + * When a feature defines vtxfmt entries, they can be initialized and + * installed by + * _MESA_INIT__VTXFMT + * _mesa_install__vtxfmt + * + * When a feature defines dispatch entries, they are initialized by + * _mesa_init__dispatch + * + * When a feature has states, they are initialized and freed by + * _mesa_init_ + * _mesa_free__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. + */ + +#ifdef IN_DRI_DRIVER +#define FEATURE_remap_table 1 +#else +#define FEATURE_remap_table 0 +#endif + #define FEATURE_accum _HAVE_FULL_GL +#define FEATURE_arrayelt _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL +/* this disables vtxfmt, api_loopback, and api_noop completely */ +#define FEATURE_beginend _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL #define FEATURE_convolve _HAVE_FULL_GL #define FEATURE_dispatch _HAVE_FULL_GL -#define FEATURE_dlist _HAVE_FULL_GL +#define FEATURE_dlist (_HAVE_FULL_GL && FEATURE_arrayelt && FEATURE_beginend) #define FEATURE_draw_read_buffer _HAVE_FULL_GL #define FEATURE_drawpix _HAVE_FULL_GL #define FEATURE_evaluators _HAVE_FULL_GL @@ -50,15 +91,15 @@ #define FEATURE_histogram _HAVE_FULL_GL #define FEATURE_pixel_transfer _HAVE_FULL_GL #define FEATURE_point_size_array 0 +#define FEATURE_queryobj _HAVE_FULL_GL +#define FEATURE_rastpos _HAVE_FULL_GL #define FEATURE_texgen _HAVE_FULL_GL #define FEATURE_texture_fxt1 _HAVE_FULL_GL #define FEATURE_texture_s3tc _HAVE_FULL_GL #define FEATURE_userclip _HAVE_FULL_GL #define FEATURE_vertex_array_byte 0 -#define FEATURE_windowpos _HAVE_FULL_GL #define FEATURE_es2_glsl 0 -#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL #define FEATURE_ARB_fragment_program _HAVE_FULL_GL #define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL #define FEATURE_ARB_map_buffer_range _HAVE_FULL_GL @@ -76,7 +117,6 @@ #define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL #define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL #define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL -#define FEATURE_EXT_timer_query _HAVE_FULL_GL #define FEATURE_ATI_fragment_shader _HAVE_FULL_GL #define FEATURE_NV_fence _HAVE_FULL_GL #define FEATURE_NV_fragment_program _HAVE_FULL_GL diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c index c3928fa51..7350c7a3d 100644 --- a/mesalib/src/mesa/main/mipmap.c +++ b/mesalib/src/mesa/main/mipmap.c @@ -28,10 +28,11 @@ */ #include "imports.h" +#include "formats.h" #include "mipmap.h" #include "texcompress.h" -#include "texformat.h" #include "teximage.h" +#include "texstore.h" #include "image.h" @@ -1493,7 +1494,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) { const struct gl_texture_image *srcImage; - const struct gl_texture_format *convertFormat; + gl_format convertFormat; const GLubyte *srcData = NULL; GLubyte *dstData = NULL; GLint level, maxLevels; @@ -1508,7 +1509,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, ASSERT(maxLevels > 0); /* bad target */ /* Find convertFormat - the format that do_row() will process */ - if (srcImage->IsCompressed) { + + if (_mesa_is_format_compressed(srcImage->TexFormat)) { /* setup for compressed textures - need to allocate temporary * image buffers to hold uncompressed images. */ @@ -1520,11 +1522,11 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, texObj->Target == GL_TEXTURE_CUBE_MAP_ARB); if (srcImage->_BaseFormat == GL_RGB) { - convertFormat = &_mesa_texformat_rgb; + convertFormat = MESA_FORMAT_RGB888; components = 3; } else if (srcImage->_BaseFormat == GL_RGBA) { - convertFormat = &_mesa_texformat_rgba; + convertFormat = MESA_FORMAT_RGBA8888; components = 4; } else { @@ -1588,7 +1590,11 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, &dstWidth, &dstHeight, &dstDepth); if (!nextLevel) { /* all done */ - break; + if (_mesa_is_format_compressed(srcImage->TexFormat)) { + _mesa_free((void *) srcData); + _mesa_free(dstData); + } + return; } /* get dest gl_texture_image */ @@ -1609,25 +1615,17 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstImage->TexFormat = srcImage->TexFormat; dstImage->FetchTexelc = srcImage->FetchTexelc; dstImage->FetchTexelf = srcImage->FetchTexelf; - dstImage->IsCompressed = srcImage->IsCompressed; - if (dstImage->IsCompressed) { - dstImage->CompressedSize - = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, - dstImage->Height, - dstImage->Depth, - dstImage->TexFormat->MesaFormat); - ASSERT(dstImage->CompressedSize > 0); - } - - ASSERT(dstImage->TexFormat); - ASSERT(dstImage->FetchTexelc); - ASSERT(dstImage->FetchTexelf); /* Alloc new teximage data buffer. * Setup src and dest data pointers. */ - if (dstImage->IsCompressed) { - dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); + if (_mesa_is_format_compressed(dstImage->TexFormat)) { + GLuint dstCompressedSize = + _mesa_format_image_size(dstImage->TexFormat, dstImage->Width, + dstImage->Height, dstImage->Depth); + ASSERT(dstCompressedSize > 0); + + dstImage->Data = _mesa_alloc_texmemory(dstCompressedSize); if (!dstImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); return; @@ -1637,7 +1635,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, ASSERT(dstData); } else { - bytesPerTexel = dstImage->TexFormat->TexelBytes; + bytesPerTexel = _mesa_get_format_bytes(dstImage->TexFormat); ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight * dstDepth * bytesPerTexel); @@ -1649,6 +1647,10 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstData = (GLubyte *) dstImage->Data; } + ASSERT(dstImage->TexFormat); + ASSERT(dstImage->FetchTexelc); + ASSERT(dstImage->FetchTexelf); + _mesa_generate_mipmap_level(target, datatype, comps, border, srcWidth, srcHeight, srcDepth, srcData, srcImage->RowStride, @@ -1656,22 +1658,24 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstData, dstImage->RowStride); - if (dstImage->IsCompressed) { + if (_mesa_is_format_compressed(dstImage->TexFormat)) { GLubyte *temp; /* compress image from dstData into dstImage->Data */ - const GLenum srcFormat = convertFormat->BaseFormat; + const GLenum srcFormat = _mesa_get_format_base_format(convertFormat); GLint dstRowStride - = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); + = _mesa_format_row_stride(dstImage->TexFormat, dstWidth); ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); - dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat, - dstImage->TexFormat, - dstImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, 0, /* strides */ - dstWidth, dstHeight, 1, /* size */ - srcFormat, CHAN_TYPE, - dstData, /* src data, actually */ - &ctx->DefaultPacking); + + _mesa_texstore(ctx, 2, dstImage->_BaseFormat, + dstImage->TexFormat, + dstImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, 0, /* strides */ + dstWidth, dstHeight, 1, /* size */ + srcFormat, CHAN_TYPE, + dstData, /* src data, actually */ + &ctx->DefaultPacking); + /* swap src and dest pointers */ temp = (GLubyte *) srcData; srcData = dstData; @@ -1679,12 +1683,6 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, } } /* loop over mipmap levels */ - - if (srcImage->IsCompressed) { - /* free uncompressed image buffers */ - _mesa_free((void *) srcData); - _mesa_free(dstData); - } } diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index f8e4e4158..cde2f5fe0 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.5 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -78,12 +78,38 @@ #endif +/** + * \name 64-bit extension of GLbitfield. + */ +/*@{*/ +typedef GLuint64 GLbitfield64; + +#define BITFIELD64_ONE 1ULL +#define BITFIELD64_ALLONES ~0ULL + +/** Set a single bit */ +#define BITFIELD64_BIT(b) (BITFIELD64_ONE << (b)) + +/** Set a mask of the least significant \c b bits */ +#define BITFIELD64_MASK(b) (((b) >= 64) ? BITFIELD64_ALLONES : \ + (BITFIELD64_BIT(b) - 1)) + +/** + * Set all bits from l (low bit) to h (high bit), inclusive. + * + * \note \C BITFIELD_64_RANGE(0, 63) return 64 set bits. + */ +#define BITFIELD64_RANGE(l, h) (BITFIELD64_MASK((h) + 1) & ~BITFIELD64_MASK(l)) +/*@}*/ + + /** * \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; @@ -207,7 +233,7 @@ typedef enum VERT_RESULT_BFC0 = 13, VERT_RESULT_BFC1 = 14, VERT_RESULT_EDGE = 15, - VERT_RESULT_VAR0 = 16 /**< shader varying */, + VERT_RESULT_VAR0 = 16, /**< shader varying */ VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) } gl_vert_result; @@ -819,29 +845,6 @@ struct gl_list_attrib }; -/** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_instruction -{ - GLuint Size; - void (*Execute)( GLcontext *ctx, void *data ); - void (*Destroy)( GLcontext *ctx, void *data ); - void (*Print)( GLcontext *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; -}; - - /** * Multisample attribute group (GL_MULTISAMPLE_BIT). */ @@ -1136,104 +1139,21 @@ typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, const void *texel); -/** - * 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 \ - GLcontext *ctx, GLuint dims, \ - GLenum baseInternalFormat, \ - const struct gl_texture_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 - - - -/** - * Texture image storage function. - */ -typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); - - -/** - * Texture format record - */ -struct gl_texture_format -{ - GLint MesaFormat; /**< One of the MESA_FORMAT_* values */ - - GLenum BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, - * GL_LUMINANCE, GL_LUMINANCE_ALPHA, - * GL_INTENSITY, GL_COLOR_INDEX or - * GL_DEPTH_COMPONENT. - */ - GLenum DataType; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */ - - /** - * Bits per texel component. These are just rough approximations - * for compressed texture formats. - */ - /*@{*/ - GLubyte RedBits; - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte LuminanceBits; - GLubyte IntensityBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; /**< GL_EXT_packed_depth_stencil */ - /*@}*/ - - GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ - - StoreTexImageFunc StoreImage; - - /** - * \name Texel fetch function pointers - */ - /*@{*/ - FetchTexelFuncC FetchTexel1D; - FetchTexelFuncC FetchTexel2D; - FetchTexelFuncC FetchTexel3D; - FetchTexelFuncF FetchTexel1Df; - FetchTexelFuncF FetchTexel2Df; - FetchTexelFuncF FetchTexel3Df; - /*@}*/ - - StoreTexelFunc StoreTexel; -}; - - /** * 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. */ - GLint InternalFormat; /**< Internal format as given by the user */ + GLuint TexFormat; /**< The actual format: MESA_FORMAT_x */ + GLuint Border; /**< 0 or 1 */ GLuint Width; /**< = 2^WidthLog2 + 2*Border */ GLuint Height; /**< = 2^HeightLog2 + 2*Border */ @@ -1251,16 +1171,11 @@ struct gl_texture_image GLboolean IsClientData; /**< Data owned by client? */ GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ - const struct gl_texture_format *TexFormat; - struct gl_texture_object *TexObject; /**< Pointer back to parent object */ FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ - GLboolean IsCompressed; /**< GL_ARB_texture_compression */ - GLuint CompressedSize; /**< GL_ARB_texture_compression */ - 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 */ @@ -1482,6 +1397,7 @@ struct gl_transform_attrib GLboolean Normalize; /**< Normalize all normals? */ GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ + GLboolean DepthClamp; /**< GL_ARB_depth_clamp */ GLboolean CullVertexFlag; /**< True if GL_CULL_VERTEX_EXT is enabled */ GLfloat CullEyePos[4]; @@ -1779,7 +1695,7 @@ struct gl_program struct prog_instruction *Instructions; GLbitfield InputsRead; /**< Bitmask of which input regs are read */ - GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */ + GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */ 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 */ @@ -1833,7 +1749,6 @@ struct gl_vertex_program struct gl_program Base; /**< base class */ GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ GLboolean IsPositionInvariant; - void *TnlData; /**< should probably use Base.DriverData */ }; @@ -1939,10 +1854,10 @@ struct ati_fragment_shader struct atifs_instruction *Instructions[2]; struct atifs_setupinst *SetupInst[2]; GLfloat Constants[8][4]; - GLbitfield LocalConstDef; /** Indicates which constants have been set */ + GLbitfield LocalConstDef; /**< Indicates which constants have been set */ GLubyte numArithInstr[2]; GLubyte regsAssigned[2]; - GLubyte NumPasses; /** 1 or 2 */ + GLubyte NumPasses; /**< 1 or 2 */ GLubyte cur_pass; GLubyte last_optype; GLboolean interpinp1; @@ -1956,7 +1871,7 @@ struct ati_fragment_shader struct gl_ati_fragment_shader_state { GLboolean Enabled; - GLboolean _Enabled; /** enabled and valid shader? */ + GLboolean _Enabled; /**< enabled and valid shader? */ GLboolean Compiling; GLfloat GlobalConstants[8][4]; struct ati_fragment_shader *Current; @@ -2066,6 +1981,9 @@ struct gl_shader_program #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 */ /** @@ -2176,20 +2094,12 @@ struct gl_renderbuffer GLuint Name; GLint RefCount; GLuint Width, Height; + GLenum InternalFormat; /**< The user-specified format */ - GLenum _ActualFormat; /**< The driver-chosen format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or GL_STENCIL_INDEX. */ - GLenum ColorEncoding; /**< GL_LINEAR or GL_SRGB */ - GLenum ComponentType; /**< GL_FLOAT, GL_INT, GL_UNSIGNED_INT, - GL_UNSIGNED_NORMALIZED or GL_INDEX */ - GLubyte RedBits; /**< Bits of red per pixel */ - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; + GLuint Format; /**< The actual format: MESA_FORMAT_x */ + GLubyte NumSamples; GLenum DataType; /**< Type of values passed to the Get/Put functions */ @@ -2445,9 +2355,6 @@ struct gl_constants GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ - GLenum ColorReadFormat; /**< GL_OES_read_format */ - GLenum ColorReadType; /**< GL_OES_read_format */ - GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ @@ -2476,7 +2383,9 @@ struct gl_extensions GLboolean dummy; /* don't remove this! */ GLboolean ARB_copy_buffer; GLboolean ARB_depth_texture; + GLboolean ARB_depth_clamp; GLboolean ARB_draw_buffers; + GLboolean ARB_draw_elements_base_vertex; GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; @@ -2525,9 +2434,10 @@ struct gl_extensions GLboolean EXT_copy_texture; GLboolean EXT_depth_bounds_test; GLboolean EXT_draw_range_elements; - GLboolean EXT_framebuffer_object; GLboolean EXT_fog_coord; GLboolean EXT_framebuffer_blit; + GLboolean EXT_framebuffer_multisample; + GLboolean EXT_framebuffer_object; GLboolean EXT_gpu_program_parameters; GLboolean EXT_histogram; GLboolean EXT_multi_draw_arrays; @@ -2581,6 +2491,7 @@ struct gl_extensions GLboolean MESA_texture_signed_rgba; GLboolean NV_blend_square; GLboolean NV_fragment_program; + GLboolean NV_fragment_program_option; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; @@ -3056,7 +2967,7 @@ struct __GLcontextRec struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ /**@}*/ - struct gl_list_extensions ListExt; /**< driver dlist extensions */ + struct gl_list_extensions *ListExt; /**< driver dlist extensions */ /** \name For debugging/development only */ /*@{*/ @@ -3112,11 +3023,12 @@ extern int MESA_DEBUG_FLAGS; #endif +/** The MESA_VERBOSE var is a bitmask of these flags */ enum _verbose { VERBOSE_VARRAY = 0x0001, VERBOSE_TEXTURE = 0x0002, - VERBOSE_IMMEDIATE = 0x0004, + VERBOSE_MATERIAL = 0x0004, VERBOSE_PIPELINE = 0x0008, VERBOSE_DRIVER = 0x0010, VERBOSE_STATE = 0x0020, @@ -3126,9 +3038,12 @@ enum _verbose 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 diff --git a/mesalib/src/mesa/main/pixel.c b/mesalib/src/mesa/main/pixel.c index fcef6dfd4..3820ebd88 100644 --- a/mesalib/src/mesa/main/pixel.c +++ b/mesalib/src/mesa/main/pixel.c @@ -36,13 +36,17 @@ #include "macros.h" #include "pixel.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_pixel_transfer /**********************************************************************/ /***** glPixelZoom *****/ /**********************************************************************/ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) { GET_CURRENT_CONTEXT(ctx); @@ -163,7 +167,7 @@ validate_pbo_access(GLcontext *ctx, struct gl_pixelstore_attrib *pack, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -205,7 +209,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -261,7 +265,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -317,7 +321,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -362,7 +366,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) { GET_CURRENT_CONTEXT(ctx); @@ -406,7 +410,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapusv( GLenum map, GLushort *values ) { GET_CURRENT_CONTEXT(ctx); @@ -468,7 +472,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values ) * Implements glPixelTransfer[fi] whether called immediately or from a * display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ) { GET_CURRENT_CONTEXT(ctx); @@ -662,7 +666,7 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferi( GLenum pname, GLint param ) { _mesa_PixelTransferf( pname, (GLfloat) param ); @@ -756,6 +760,24 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) } +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); +} + + +#endif /* FEATURE_pixel_transfer */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/mesalib/src/mesa/main/pixel.h b/mesalib/src/mesa/main/pixel.h index cb6c5262a..f4d3f1efd 100644 --- a/mesalib/src/mesa/main/pixel.h +++ b/mesalib/src/mesa/main/pixel.h @@ -33,48 +33,35 @@ #define PIXEL_H -#include "mtypes.h" +#include "main/mtypes.h" -/** \name API functions */ -/*@{*/ +#if FEATURE_pixel_transfer -extern void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ); - -extern void GLAPIENTRY -_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); - -extern void GLAPIENTRY -_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ); - -extern void GLAPIENTRY -_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); +extern void +_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); -extern void GLAPIENTRY -_mesa_PixelTransferf( GLenum pname, GLfloat param ); +extern void +_mesa_init_pixel_dispatch( struct _glapi_table * disp ); -extern void GLAPIENTRY -_mesa_PixelTransferi( GLenum pname, GLint param ); +#else /* FEATURE_pixel_transfer */ -extern void GLAPIENTRY -_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); +static INLINE void +_mesa_update_pixel(GLcontext *ctx, GLuint newstate) +{ +} -/*@}*/ +static INLINE void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_pixel_transfer */ -extern void -_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); extern void _mesa_init_pixel( GLcontext * ctx ); /*@}*/ -#endif +#endif /* PIXEL_H */ diff --git a/mesalib/src/mesa/main/points.c b/mesalib/src/mesa/main/points.c index 4c8fc1f72..dcaeccd90 100644 --- a/mesalib/src/mesa/main/points.c +++ b/mesalib/src/mesa/main/points.c @@ -69,8 +69,10 @@ _mesa_PointSize( GLfloat size ) void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ) { - const GLfloat value = (GLfloat) param; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } @@ -90,7 +92,10 @@ _mesa_PointParameteriv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_PointParameterf( GLenum pname, GLfloat param) { - _mesa_PointParameterfv(pname, ¶m); + GLfloat p[3]; + p[0] = param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } @@ -200,7 +205,12 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) } break; case GL_POINT_SPRITE_COORD_ORIGIN: - if (ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) { + /* This is not completely correct. GL_POINT_SPRITE_COORD_ORIGIN was + * added to point sprites when the extension was merged into OpenGL + * 2.0. It is expected that an implementation supporting OpenGL 1.4 + * and GL_ARB_point_sprite will generate an error here. + */ + if (ctx->Extensions.ARB_point_sprite) { GLenum value = (GLenum) params[0]; if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) { _mesa_error(ctx, GL_INVALID_VALUE, diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index a73c6e050..f6eb4ee7e 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -29,6 +29,10 @@ #include "imports.h" #include "queryobj.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_queryobj /** @@ -216,7 +220,7 @@ _mesa_IsQueryARB(GLuint id) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_BeginQueryARB(GLenum target, GLuint id) { struct gl_query_object *q; @@ -236,7 +240,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); @@ -247,7 +250,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); return; @@ -285,17 +287,15 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) if (target == GL_SAMPLES_PASSED_ARB) { ctx->Query.CurrentOcclusionObject = q; } -#if FEATURE_EXT_timer_query else if (target == GL_TIME_ELAPSED_EXT) { ctx->Query.CurrentTimerObject = q; } -#endif ctx->Driver.BeginQuery(ctx, q); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndQueryARB(GLenum target) { struct gl_query_object *q; @@ -313,7 +313,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentOcclusionObject; ctx->Query.CurrentOcclusionObject = NULL; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -322,7 +321,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentTimerObject; ctx->Query.CurrentTimerObject = NULL; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); return; @@ -354,7 +352,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentOcclusionObject; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -362,7 +359,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentTimerObject; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); return; @@ -462,12 +458,10 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } -#if FEATURE_EXT_timer_query - /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) { struct gl_query_object *q = NULL; @@ -504,7 +498,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) { struct gl_query_object *q = NULL; @@ -537,19 +531,35 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) } } -#endif /* FEATURE_EXT_timer_query */ + +void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ + SET_GenQueriesARB(disp, _mesa_GenQueriesARB); + SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB); + SET_IsQueryARB(disp, _mesa_IsQueryARB); + SET_BeginQueryARB(disp, _mesa_BeginQueryARB); + SET_EndQueryARB(disp, _mesa_EndQueryARB); + SET_GetQueryivARB(disp, _mesa_GetQueryivARB); + SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); + SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); + + SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); +} + + +#endif /* FEATURE_queryobj */ /** * Allocate/init the context state related to query objects. */ void -_mesa_init_query(GLcontext *ctx) +_mesa_init_queryobj(GLcontext *ctx) { -#if FEATURE_ARB_occlusion_query ctx->Query.QueryObjects = _mesa_NewHashTable(); ctx->Query.CurrentOcclusionObject = NULL; -#endif } @@ -569,7 +579,7 @@ delete_queryobj_cb(GLuint id, void *data, void *userData) * Free the context state related to query objects. */ void -_mesa_free_query_data(GLcontext *ctx) +_mesa_free_queryobj_data(GLcontext *ctx) { _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); _mesa_DeleteHashTable(ctx->Query.QueryObjects); diff --git a/mesalib/src/mesa/main/queryobj.h b/mesalib/src/mesa/main/queryobj.h index ee775ef95..6cf3c76d7 100644 --- a/mesalib/src/mesa/main/queryobj.h +++ b/mesalib/src/mesa/main/queryobj.h @@ -23,19 +23,24 @@ */ -#ifndef OCCLUDE_H -#define OCCLUDE_H +#ifndef QUERYOBJ_H +#define QUERYOBJ_H -extern void -_mesa_init_query(GLcontext *ctx); +#include "main/mtypes.h" -extern void -_mesa_free_query_data(GLcontext *ctx); -extern void -_mesa_init_query_object_functions(struct dd_function_table *driver); +#if FEATURE_queryobj +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewQueryObject = impl ## NewQueryObject; \ + (driver)->DeleteQuery = impl ## DeleteQuery; \ + (driver)->BeginQuery = impl ## BeginQuery; \ + (driver)->EndQuery = impl ## EndQuery; \ + (driver)->WaitQuery = impl ## WaitQuery; \ + (driver)->CheckQuery = impl ## CheckQuery; \ + } while (0) extern void GLAPIENTRY _mesa_GenQueriesARB(GLsizei n, GLuint *ids); @@ -46,12 +51,6 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); extern GLboolean GLAPIENTRY _mesa_IsQueryARB(GLuint id); -extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - extern void GLAPIENTRY _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); @@ -61,11 +60,33 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); +extern void +_mesa_init_query_object_functions(struct dd_function_table *driver); -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); +extern void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_queryobj */ + +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void +_mesa_init_query_object_functions(struct dd_function_table *driver) +{ +} + +static INLINE void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_queryobj */ + +extern void +_mesa_init_queryobj(GLcontext *ctx); + +extern void +_mesa_free_queryobj_data(GLcontext *ctx); -#endif /* OCCLUDE_H */ +#endif /* QUERYOBJ_H */ diff --git a/mesalib/src/mesa/main/rastpos.c b/mesalib/src/mesa/main/rastpos.c index 9f309d6ab..703b47ec7 100644 --- a/mesalib/src/mesa/main/rastpos.c +++ b/mesalib/src/mesa/main/rastpos.c @@ -34,6 +34,10 @@ #include "macros.h" #include "rastpos.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_rastpos /** @@ -60,147 +64,147 @@ rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2d(GLdouble x, GLdouble y) { rasterpos((GLfloat)x, (GLfloat)y, (GLfloat)0.0, (GLfloat)1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2f(GLfloat x, GLfloat y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2i(GLint x, GLint y) { rasterpos((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2s(GLshort x, GLshort y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3i(GLint x, GLint y, GLint z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2fv(const GLfloat *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2sv(const GLshort *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], v[3]); @@ -211,7 +215,7 @@ _mesa_RasterPos4sv(const GLshort *v) /*** GL_ARB_window_pos / GL_MESA_window_pos ***/ /**********************************************************************/ -#if FEATURE_drawpix + /** * All glWindowPosMESA and glWindowPosARB commands call this function to * update the current raster position. @@ -290,153 +294,152 @@ window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dMESA(GLdouble x, GLdouble y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fMESA(GLfloat x, GLfloat y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2iMESA(GLint x, GLint y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2sMESA(GLshort x, GLshort y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2svMESA(const GLshort *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], 1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -#endif #if 0 @@ -477,6 +480,65 @@ void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) #endif +void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ + SET_RasterPos2f(disp, _mesa_RasterPos2f); + SET_RasterPos2fv(disp, _mesa_RasterPos2fv); + SET_RasterPos2i(disp, _mesa_RasterPos2i); + SET_RasterPos2iv(disp, _mesa_RasterPos2iv); + SET_RasterPos2d(disp, _mesa_RasterPos2d); + SET_RasterPos2dv(disp, _mesa_RasterPos2dv); + SET_RasterPos2s(disp, _mesa_RasterPos2s); + SET_RasterPos2sv(disp, _mesa_RasterPos2sv); + SET_RasterPos3d(disp, _mesa_RasterPos3d); + SET_RasterPos3dv(disp, _mesa_RasterPos3dv); + SET_RasterPos3f(disp, _mesa_RasterPos3f); + SET_RasterPos3fv(disp, _mesa_RasterPos3fv); + SET_RasterPos3i(disp, _mesa_RasterPos3i); + SET_RasterPos3iv(disp, _mesa_RasterPos3iv); + SET_RasterPos3s(disp, _mesa_RasterPos3s); + SET_RasterPos3sv(disp, _mesa_RasterPos3sv); + SET_RasterPos4d(disp, _mesa_RasterPos4d); + SET_RasterPos4dv(disp, _mesa_RasterPos4dv); + SET_RasterPos4f(disp, _mesa_RasterPos4f); + SET_RasterPos4fv(disp, _mesa_RasterPos4fv); + SET_RasterPos4i(disp, _mesa_RasterPos4i); + SET_RasterPos4iv(disp, _mesa_RasterPos4iv); + SET_RasterPos4s(disp, _mesa_RasterPos4s); + SET_RasterPos4sv(disp, _mesa_RasterPos4sv); + + /* 197. GL_MESA_window_pos */ + SET_WindowPos2dMESA(disp, _mesa_WindowPos2dMESA); + SET_WindowPos2dvMESA(disp, _mesa_WindowPos2dvMESA); + SET_WindowPos2fMESA(disp, _mesa_WindowPos2fMESA); + SET_WindowPos2fvMESA(disp, _mesa_WindowPos2fvMESA); + SET_WindowPos2iMESA(disp, _mesa_WindowPos2iMESA); + SET_WindowPos2ivMESA(disp, _mesa_WindowPos2ivMESA); + SET_WindowPos2sMESA(disp, _mesa_WindowPos2sMESA); + SET_WindowPos2svMESA(disp, _mesa_WindowPos2svMESA); + SET_WindowPos3dMESA(disp, _mesa_WindowPos3dMESA); + SET_WindowPos3dvMESA(disp, _mesa_WindowPos3dvMESA); + SET_WindowPos3fMESA(disp, _mesa_WindowPos3fMESA); + SET_WindowPos3fvMESA(disp, _mesa_WindowPos3fvMESA); + SET_WindowPos3iMESA(disp, _mesa_WindowPos3iMESA); + SET_WindowPos3ivMESA(disp, _mesa_WindowPos3ivMESA); + SET_WindowPos3sMESA(disp, _mesa_WindowPos3sMESA); + SET_WindowPos3svMESA(disp, _mesa_WindowPos3svMESA); + SET_WindowPos4dMESA(disp, _mesa_WindowPos4dMESA); + SET_WindowPos4dvMESA(disp, _mesa_WindowPos4dvMESA); + SET_WindowPos4fMESA(disp, _mesa_WindowPos4fMESA); + SET_WindowPos4fvMESA(disp, _mesa_WindowPos4fvMESA); + SET_WindowPos4iMESA(disp, _mesa_WindowPos4iMESA); + SET_WindowPos4ivMESA(disp, _mesa_WindowPos4ivMESA); + SET_WindowPos4sMESA(disp, _mesa_WindowPos4sMESA); + SET_WindowPos4svMESA(disp, _mesa_WindowPos4svMESA); +} + + +#endif /* FEATURE_rastpos */ + + /**********************************************************************/ /** \name Initialization */ /**********************************************************************/ diff --git a/mesalib/src/mesa/main/rastpos.h b/mesalib/src/mesa/main/rastpos.h index 363f86ad8..b2127225b 100644 --- a/mesalib/src/mesa/main/rastpos.h +++ b/mesalib/src/mesa/main/rastpos.h @@ -32,162 +32,33 @@ #define RASTPOS_H -#include "glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_RasterPos2d(GLdouble x, GLdouble y); +#if FEATURE_rastpos -extern void GLAPIENTRY -_mesa_RasterPos2f(GLfloat x, GLfloat y); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RasterPos = impl ## RasterPos; \ + } while (0) -extern void GLAPIENTRY -_mesa_RasterPos2i(GLint x, GLint y); +extern void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_RasterPos2s(GLshort x, GLshort y); +#else /* FEATURE_rastpos */ -extern void GLAPIENTRY -_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); +static INLINE void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_RasterPos3i(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_RasterPos2dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos2fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos2iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos2sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos3dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos3fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos3iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos3sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos4dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos4fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos4iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos4sv(const GLshort *v); - - -/**********************************************************************/ -/** \name GL_MESA_window_pos */ -/**********************************************************************/ -/*@{*/ - -extern void GLAPIENTRY -_mesa_WindowPos2dMESA(GLdouble x, GLdouble y); - -extern void GLAPIENTRY -_mesa_WindowPos2fMESA(GLfloat x, GLfloat y); - -extern void GLAPIENTRY -_mesa_WindowPos2iMESA(GLint x, GLint y); - -extern void GLAPIENTRY -_mesa_WindowPos2sMESA(GLshort x, GLshort y); - -extern void GLAPIENTRY -_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); - -extern void GLAPIENTRY -_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); - -extern void GLAPIENTRY -_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_WindowPos2dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos2fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos2ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos2svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos3dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos3fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos3ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos3svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos4dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos4fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos4ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos4svMESA(const GLshort *v); +#endif /* FEATURE_rastpos */ extern void -_mesa_init_rastpos( GLcontext * ctx ); +_mesa_init_rastpos(GLcontext *ctx); /*@}*/ -#endif +#endif /* RASTPOS_H */ diff --git a/mesalib/src/mesa/main/rbadaptors.c b/mesalib/src/mesa/main/rbadaptors.c index c1ac0606c..1060c5796 100644 --- a/mesalib/src/mesa/main/rbadaptors.c +++ b/mesalib/src/mesa/main/rbadaptors.c @@ -218,14 +218,10 @@ _mesa_new_renderbuffer_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8) _glthread_UNLOCK_MUTEX(rb8->Mutex); rb16->InternalFormat = rb8->InternalFormat; - rb16->_ActualFormat = rb8->_ActualFormat; + rb16->Format = rb8->Format; /* XXX is this right? */ rb16->_BaseFormat = rb8->_BaseFormat; rb16->DataType = GL_UNSIGNED_SHORT; /* Note: passing through underlying bits/channel */ - rb16->RedBits = rb8->RedBits; - rb16->GreenBits = rb8->GreenBits; - rb16->BlueBits = rb8->BlueBits; - rb16->AlphaBits = rb8->AlphaBits; rb16->Wrapped = rb8; rb16->AllocStorage = AllocStorage_wrapper; @@ -385,14 +381,10 @@ _mesa_new_renderbuffer_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8) _glthread_UNLOCK_MUTEX(rb8->Mutex); rb32->InternalFormat = rb8->InternalFormat; - rb32->_ActualFormat = rb8->_ActualFormat; + rb32->Format = rb8->Format; /* XXX is this right? */ rb32->_BaseFormat = rb8->_BaseFormat; rb32->DataType = GL_FLOAT; /* Note: passing through underlying bits/channel */ - rb32->RedBits = rb8->RedBits; - rb32->GreenBits = rb8->GreenBits; - rb32->BlueBits = rb8->BlueBits; - rb32->AlphaBits = rb8->AlphaBits; rb32->Wrapped = rb8; rb32->AllocStorage = AllocStorage_wrapper; @@ -552,14 +544,10 @@ _mesa_new_renderbuffer_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb16) _glthread_UNLOCK_MUTEX(rb16->Mutex); rb32->InternalFormat = rb16->InternalFormat; - rb32->_ActualFormat = rb16->_ActualFormat; + rb32->Format = rb16->Format; /* XXX is this right? */ rb32->_BaseFormat = rb16->_BaseFormat; rb32->DataType = GL_FLOAT; /* Note: passing through underlying bits/channel */ - rb32->RedBits = rb16->RedBits; - rb32->GreenBits = rb16->GreenBits; - rb32->BlueBits = rb16->BlueBits; - rb32->AlphaBits = rb16->AlphaBits; rb32->Wrapped = rb16; rb32->AllocStorage = AllocStorage_wrapper; diff --git a/mesalib/src/mesa/main/remap.c b/mesalib/src/mesa/main/remap.c new file mode 100644 index 000000000..0385ae8d7 --- /dev/null +++ b/mesalib/src/mesa/main/remap.c @@ -0,0 +1,216 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 2009 Chia-I Wu + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to 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 remap.c + * Remap table management. + * + * Entries in the dispatch table are either static or dynamic. The + * dispatch table is shared by mesa core and glapi. When they are + * built separately, it is possible that a static entry in mesa core + * is dynamic, or assigned a different static offset, in glapi. The + * remap table is in charge of mapping a static entry in mesa core to + * a dynamic entry, or the corresponding static entry, in glapi. + */ + +#include "remap.h" +#include "imports.h" + +#include "glapi/dispatch.h" + + +#if FEATURE_remap_table + + +#define need_MESA_remap_table +#include "remap_helper.h" + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) +#define MAX_ENTRY_POINTS 16 + + +/* this is global for quick access */ +int driDispatchRemapTable[driDispatchRemapTable_size]; + + +/** + * Return the spec string associated with the given function index. + * The index is available from including remap_helper.h. + * + * \param func_index an opaque function index. + * + * \return the spec string associated with the function index, or NULL. + */ +const char * +_mesa_get_function_spec(GLint func_index) +{ + if (func_index < ARRAY_SIZE(_mesa_function_pool)) + return _mesa_function_pool + func_index; + else + return NULL; +} + + +/** + * Map a function by its spec. The function will be added to glapi, + * and the dispatch offset will be returned. + * + * \param spec a '\0'-separated string array specifying a function. + * It begins with the parameter signature of the function, + * followed by the names of the entry points. An empty entry + * point name terminates the array. + * + * \return the offset of the (re-)mapped function in the dispatch + * table, or -1. + */ +GLint +_mesa_map_function_spec(const char *spec) +{ + const char *signature; + const char *names[MAX_ENTRY_POINTS + 1]; + GLint num_names = 0; + + if (!spec) + return -1; + + signature = spec; + spec += strlen(spec) + 1; + + /* spec is terminated by an empty string */ + while (*spec) { + names[num_names] = spec; + num_names++; + if (num_names >= MAX_ENTRY_POINTS) + break; + spec += strlen(spec) + 1; + } + if (!num_names) + return -1; + + names[num_names] = NULL; + + /* add the entry points to the dispatch table */ + return _glapi_add_dispatch(names, signature); +} + + +/** + * Map an array of functions. This is a convenient function for + * use with arrays available from including remap_helper.h. + * + * Note that the dispatch offsets of the functions are not returned. + * If they are needed, _mesa_map_function_spec() should be used. + * + * \param func_array an array of function remaps. + */ +void +_mesa_map_function_array(const struct gl_function_remap *func_array) +{ + GLint i; + + if (!func_array) + return; + + for (i = 0; func_array[i].func_index != -1; i++) { + const char *spec; + GLint offset; + + spec = _mesa_get_function_spec(func_array[i].func_index); + if (!spec) { + _mesa_problem(NULL, "invalid function index %d", + func_array[i].func_index); + continue; + } + + offset = _mesa_map_function_spec(spec); + /* error checks */ + if (offset < 0) { + const char *name = spec + strlen(spec) + 1; + _mesa_warning(NULL, "failed to remap %s", name); + } + else if (func_array[i].dispatch_offset >= 0 && + offset != func_array[i].dispatch_offset) { + const char *name = spec + strlen(spec) + 1; + _mesa_problem(NULL, "%s should be mapped to %d, not %d", + name, func_array[i].dispatch_offset, offset); + } + } +} + + +/** + * Map the functions which are already static. + * + * When a extension function are incorporated into the ABI, the + * extension suffix is usually stripped. Mapping such functions + * makes sure the alternative names are available. + * + * Note that functions mapped by _mesa_init_remap_table() are + * excluded. + */ +void +_mesa_map_static_functions(void) +{ + /* Remap static functions which have alternative names and are in the ABI. + * This is to be on the safe side. glapi should have defined those names. + */ + _mesa_map_function_array(MESA_alt_functions); +} + + +/** + * Initialize the remap table. This is called in one_time_init(). + * The remap table needs to be initialized before calling the + * CALL/GET/SET macros defined in glapi/dispatch.h. + */ +void +_mesa_init_remap_table(void) +{ + static GLboolean initialized = GL_FALSE; + GLint i; + + if (initialized) + return; + initialized = GL_TRUE; + + /* initialize the remap table */ + for (i = 0; i < ARRAY_SIZE(driDispatchRemapTable); i++) { + GLint offset; + const char *spec; + + /* sanity check */ + ASSERT(i == MESA_remap_table_functions[i].remap_index); + spec = _mesa_function_pool + MESA_remap_table_functions[i].pool_index; + + offset = _mesa_map_function_spec(spec); + /* store the dispatch offset in the remap table */ + driDispatchRemapTable[i] = offset; + if (offset < 0) + _mesa_warning(NULL, "failed to remap index %d", i); + } +} + + +#endif /* FEATURE_remap_table */ diff --git a/mesalib/src/mesa/main/remap.h b/mesalib/src/mesa/main/remap.h new file mode 100644 index 000000000..7fb56e360 --- /dev/null +++ b/mesalib/src/mesa/main/remap.h @@ -0,0 +1,87 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 2009 Chia-I Wu + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to 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 REMAP_H +#define REMAP_H + + +#include "main/mtypes.h" + +struct gl_function_remap; + + +#if FEATURE_remap_table + +extern int +driDispatchRemapTable[]; + +extern const char * +_mesa_get_function_spec(GLint func_index); + +extern GLint +_mesa_map_function_spec(const char *spec); + +extern void +_mesa_map_function_array(const struct gl_function_remap *func_array); + +extern void +_mesa_map_static_functions(void); + +extern void +_mesa_init_remap_table(void); + +#else /* FEATURE_remap_table */ + +static INLINE const char * +_mesa_get_function_spec(GLint func_index) +{ + return NULL; +} + +static INLINE GLint +_mesa_map_function_spec(const char *spec) +{ + return -1; +} + +static INLINE void +_mesa_map_function_array(const struct gl_function_remap *func_array) +{ +} + +static INLINE void +_mesa_map_static_functions(void) +{ +} + +static INLINE void +_mesa_init_remap_table(void) +{ +} + +#endif /* FEATURE_remap_table */ + + +#endif /* REMAP_H */ diff --git a/mesalib/src/mesa/main/remap_helper.h b/mesalib/src/mesa/main/remap_helper.h new file mode 100644 index 000000000..c80a524b4 --- /dev/null +++ b/mesalib/src/mesa/main/remap_helper.h @@ -0,0 +1,5891 @@ +/* DO NOT EDIT - This file generated automatically by remap_helper.py (from Mesa) script */ + +/* + * Copyright (C) 2009 Chia-I Wu + * 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 "glapi/dispatch.h" + +struct gl_function_remap { + GLint func_index; + GLint dispatch_offset; /* for sanity check */ +}; + +/* 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]: RasterPos4i (offset 82) */ + "iiii\0" + "glRasterPos4i\0" + "\0" + /* _mesa_function_pool[101]: RasterPos4d (offset 78) */ + "dddd\0" + "glRasterPos4d\0" + "\0" + /* _mesa_function_pool[121]: NewList (dynamic) */ + "ii\0" + "glNewList\0" + "\0" + /* _mesa_function_pool[135]: RasterPos4f (offset 80) */ + "ffff\0" + "glRasterPos4f\0" + "\0" + /* _mesa_function_pool[155]: LoadIdentity (offset 290) */ + "\0" + "glLoadIdentity\0" + "\0" + /* _mesa_function_pool[172]: SampleCoverageARB (will be remapped) */ + "fi\0" + "glSampleCoverage\0" + "glSampleCoverageARB\0" + "\0" + /* _mesa_function_pool[213]: ConvolutionFilter1D (offset 348) */ + "iiiiip\0" + "glConvolutionFilter1D\0" + "glConvolutionFilter1DEXT\0" + "\0" + /* _mesa_function_pool[268]: BeginQueryARB (will be remapped) */ + "ii\0" + "glBeginQuery\0" + "glBeginQueryARB\0" + "\0" + /* _mesa_function_pool[301]: RasterPos3dv (offset 71) */ + "p\0" + "glRasterPos3dv\0" + "\0" + /* _mesa_function_pool[319]: PointParameteriNV (will be remapped) */ + "ii\0" + "glPointParameteri\0" + "glPointParameteriNV\0" + "\0" + /* _mesa_function_pool[361]: GetProgramiv (will be remapped) */ + "iip\0" + "glGetProgramiv\0" + "\0" + /* _mesa_function_pool[381]: MultiTexCoord3sARB (offset 398) */ + "iiii\0" + "glMultiTexCoord3s\0" + "glMultiTexCoord3sARB\0" + "\0" + /* _mesa_function_pool[426]: SecondaryColor3iEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3i\0" + "glSecondaryColor3iEXT\0" + "\0" + /* _mesa_function_pool[472]: WindowPos3fMESA (will be remapped) */ + "fff\0" + "glWindowPos3f\0" + "glWindowPos3fARB\0" + "glWindowPos3fMESA\0" + "\0" + /* _mesa_function_pool[526]: TexCoord1iv (offset 99) */ + "p\0" + "glTexCoord1iv\0" + "\0" + /* _mesa_function_pool[543]: TexCoord4sv (offset 125) */ + "p\0" + "glTexCoord4sv\0" + "\0" + /* _mesa_function_pool[560]: RasterPos4s (offset 84) */ + "iiii\0" + "glRasterPos4s\0" + "\0" + /* _mesa_function_pool[580]: PixelTexGenParameterfvSGIS (will be remapped) */ + "ip\0" + "glPixelTexGenParameterfvSGIS\0" + "\0" + /* _mesa_function_pool[613]: ActiveTextureARB (offset 374) */ + "i\0" + "glActiveTexture\0" + "glActiveTextureARB\0" + "\0" + /* _mesa_function_pool[651]: BlitFramebufferEXT (will be remapped) */ + "iiiiiiiiii\0" + "glBlitFramebuffer\0" + "glBlitFramebufferEXT\0" + "\0" + /* _mesa_function_pool[702]: TexCoord1f (offset 96) */ + "f\0" + "glTexCoord1f\0" + "\0" + /* _mesa_function_pool[718]: TexCoord1d (offset 94) */ + "d\0" + "glTexCoord1d\0" + "\0" + /* _mesa_function_pool[734]: VertexAttrib4ubvNV (will be remapped) */ + "ip\0" + "glVertexAttrib4ubvNV\0" + "\0" + /* _mesa_function_pool[759]: TexCoord1i (offset 98) */ + "i\0" + "glTexCoord1i\0" + "\0" + /* _mesa_function_pool[775]: GetProgramNamedParameterdvNV (will be remapped) */ + "iipp\0" + "glGetProgramNamedParameterdvNV\0" + "\0" + /* _mesa_function_pool[812]: Histogram (offset 367) */ + "iiii\0" + "glHistogram\0" + "glHistogramEXT\0" + "\0" + /* _mesa_function_pool[845]: TexCoord1s (offset 100) */ + "i\0" + "glTexCoord1s\0" + "\0" + /* _mesa_function_pool[861]: GetMapfv (offset 267) */ + "iip\0" + "glGetMapfv\0" + "\0" + /* _mesa_function_pool[877]: EvalCoord1f (offset 230) */ + "f\0" + "glEvalCoord1f\0" + "\0" + /* _mesa_function_pool[894]: TexImage4DSGIS (dynamic) */ + "iiiiiiiiiip\0" + "glTexImage4DSGIS\0" + "\0" + /* _mesa_function_pool[924]: PolygonStipple (offset 175) */ + "p\0" + "glPolygonStipple\0" + "\0" + /* _mesa_function_pool[944]: WindowPos2dvMESA (will be remapped) */ + "p\0" + "glWindowPos2dv\0" + "glWindowPos2dvARB\0" + "glWindowPos2dvMESA\0" + "\0" + /* _mesa_function_pool[999]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiColor3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1043]: BlendEquationSeparateEXT (will be remapped) */ + "ii\0" + "glBlendEquationSeparate\0" + "glBlendEquationSeparateEXT\0" + "glBlendEquationSeparateATI\0" + "\0" + /* _mesa_function_pool[1125]: ListParameterfSGIX (dynamic) */ + "iif\0" + "glListParameterfSGIX\0" + "\0" + /* _mesa_function_pool[1151]: SecondaryColor3bEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3b\0" + "glSecondaryColor3bEXT\0" + "\0" + /* _mesa_function_pool[1197]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */ + "pppp\0" + "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" + "\0" + /* _mesa_function_pool[1243]: GetPixelMapfv (offset 271) */ + "ip\0" + "glGetPixelMapfv\0" + "\0" + /* _mesa_function_pool[1263]: Color3uiv (offset 22) */ + "p\0" + "glColor3uiv\0" + "\0" + /* _mesa_function_pool[1278]: IsEnabled (offset 286) */ + "i\0" + "glIsEnabled\0" + "\0" + /* _mesa_function_pool[1293]: VertexAttrib4svNV (will be remapped) */ + "ip\0" + "glVertexAttrib4svNV\0" + "\0" + /* _mesa_function_pool[1317]: EvalCoord2fv (offset 235) */ + "p\0" + "glEvalCoord2fv\0" + "\0" + /* _mesa_function_pool[1335]: GetBufferSubDataARB (will be remapped) */ + "iiip\0" + "glGetBufferSubData\0" + "glGetBufferSubDataARB\0" + "\0" + /* _mesa_function_pool[1382]: BufferSubDataARB (will be remapped) */ + "iiip\0" + "glBufferSubData\0" + "glBufferSubDataARB\0" + "\0" + /* _mesa_function_pool[1423]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */ + "ppp\0" + "glTexCoord2fColor4ubVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1461]: AttachShader (will be remapped) */ + "ii\0" + "glAttachShader\0" + "\0" + /* _mesa_function_pool[1480]: VertexAttrib2fARB (will be remapped) */ + "iff\0" + "glVertexAttrib2f\0" + "glVertexAttrib2fARB\0" + "\0" + /* _mesa_function_pool[1522]: GetDebugLogLengthMESA (dynamic) */ + "iii\0" + "glGetDebugLogLengthMESA\0" + "\0" + /* _mesa_function_pool[1551]: GetMapiv (offset 268) */ + "iip\0" + "glGetMapiv\0" + "\0" + /* _mesa_function_pool[1567]: VertexAttrib3fARB (will be remapped) */ + "ifff\0" + "glVertexAttrib3f\0" + "glVertexAttrib3fARB\0" + "\0" + /* _mesa_function_pool[1610]: Indexubv (offset 316) */ + "p\0" + "glIndexubv\0" + "\0" + /* _mesa_function_pool[1624]: GetQueryivARB (will be remapped) */ + "iip\0" + "glGetQueryiv\0" + "glGetQueryivARB\0" + "\0" + /* _mesa_function_pool[1658]: TexImage3D (offset 371) */ + "iiiiiiiiip\0" + "glTexImage3D\0" + "glTexImage3DEXT\0" + "\0" + /* _mesa_function_pool[1699]: ReplacementCodeuiVertex3fvSUN (dynamic) */ + "pp\0" + "glReplacementCodeuiVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1735]: EdgeFlagPointer (offset 312) */ + "ip\0" + "glEdgeFlagPointer\0" + "\0" + /* _mesa_function_pool[1757]: Color3ubv (offset 20) */ + "p\0" + "glColor3ubv\0" + "\0" + /* _mesa_function_pool[1772]: GetQueryObjectivARB (will be remapped) */ + "iip\0" + "glGetQueryObjectiv\0" + "glGetQueryObjectivARB\0" + "\0" + /* _mesa_function_pool[1818]: Vertex3dv (offset 135) */ + "p\0" + "glVertex3dv\0" + "\0" + /* _mesa_function_pool[1833]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1880]: CompressedTexSubImage2DARB (will be remapped) */ + "iiiiiiiip\0" + "glCompressedTexSubImage2D\0" + "glCompressedTexSubImage2DARB\0" + "\0" + /* _mesa_function_pool[1946]: CombinerOutputNV (will be remapped) */ + "iiiiiiiiii\0" + "glCombinerOutputNV\0" + "\0" + /* _mesa_function_pool[1977]: VertexAttribs3fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs3fvNV\0" + "\0" + /* _mesa_function_pool[2003]: Uniform2fARB (will be remapped) */ + "iff\0" + "glUniform2f\0" + "glUniform2fARB\0" + "\0" + /* _mesa_function_pool[2035]: LightModeliv (offset 166) */ + "ip\0" + "glLightModeliv\0" + "\0" + /* _mesa_function_pool[2054]: VertexAttrib1svARB (will be remapped) */ + "ip\0" + "glVertexAttrib1sv\0" + "glVertexAttrib1svARB\0" + "\0" + /* _mesa_function_pool[2097]: VertexAttribs1dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs1dvNV\0" + "\0" + /* _mesa_function_pool[2123]: Uniform2ivARB (will be remapped) */ + "iip\0" + "glUniform2iv\0" + "glUniform2ivARB\0" + "\0" + /* _mesa_function_pool[2157]: GetImageTransformParameterfvHP (dynamic) */ + "iip\0" + "glGetImageTransformParameterfvHP\0" + "\0" + /* _mesa_function_pool[2195]: Normal3bv (offset 53) */ + "p\0" + "glNormal3bv\0" + "\0" + /* _mesa_function_pool[2210]: TexGeniv (offset 193) */ + "iip\0" + "glTexGeniv\0" + "\0" + /* _mesa_function_pool[2226]: WeightubvARB (dynamic) */ + "ip\0" + "glWeightubvARB\0" + "\0" + /* _mesa_function_pool[2245]: VertexAttrib1fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib1fvNV\0" + "\0" + /* _mesa_function_pool[2269]: Vertex3iv (offset 139) */ + "p\0" + "glVertex3iv\0" + "\0" + /* _mesa_function_pool[2284]: CopyConvolutionFilter1D (offset 354) */ + "iiiii\0" + "glCopyConvolutionFilter1D\0" + "glCopyConvolutionFilter1DEXT\0" + "\0" + /* _mesa_function_pool[2346]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */ + "iffffff\0" + "glReplacementCodeuiNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[2394]: DeleteSync (will be remapped) */ + "i\0" + "glDeleteSync\0" + "\0" + /* _mesa_function_pool[2410]: FragmentMaterialfvSGIX (dynamic) */ + "iip\0" + "glFragmentMaterialfvSGIX\0" + "\0" + /* _mesa_function_pool[2440]: BlendColor (offset 336) */ + "ffff\0" + "glBlendColor\0" + "glBlendColorEXT\0" + "\0" + /* _mesa_function_pool[2475]: UniformMatrix4fvARB (will be remapped) */ + "iiip\0" + "glUniformMatrix4fv\0" + "glUniformMatrix4fvARB\0" + "\0" + /* _mesa_function_pool[2522]: DeleteVertexArraysAPPLE (will be remapped) */ + "ip\0" + "glDeleteVertexArrays\0" + "glDeleteVertexArraysAPPLE\0" + "\0" + /* _mesa_function_pool[2573]: ReadInstrumentsSGIX (dynamic) */ + "i\0" + "glReadInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[2598]: CallLists (offset 3) */ + "iip\0" + "glCallLists\0" + "\0" + /* _mesa_function_pool[2615]: UniformMatrix2x4fv (will be remapped) */ + "iiip\0" + "glUniformMatrix2x4fv\0" + "\0" + /* _mesa_function_pool[2642]: Color4ubVertex3fvSUN (dynamic) */ + "pp\0" + "glColor4ubVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[2669]: Normal3iv (offset 59) */ + "p\0" + "glNormal3iv\0" + "\0" + /* _mesa_function_pool[2684]: PassThrough (offset 199) */ + "f\0" + "glPassThrough\0" + "\0" + /* _mesa_function_pool[2701]: FramebufferTextureLayerEXT (will be remapped) */ + "iiiii\0" + "glFramebufferTextureLayer\0" + "glFramebufferTextureLayerEXT\0" + "\0" + /* _mesa_function_pool[2763]: GetListParameterfvSGIX (dynamic) */ + "iip\0" + "glGetListParameterfvSGIX\0" + "\0" + /* _mesa_function_pool[2793]: Viewport (offset 305) */ + "iiii\0" + "glViewport\0" + "\0" + /* _mesa_function_pool[2810]: VertexAttrib4NusvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nusv\0" + "glVertexAttrib4NusvARB\0" + "\0" + /* _mesa_function_pool[2857]: WindowPos4svMESA (will be remapped) */ + "p\0" + "glWindowPos4svMESA\0" + "\0" + /* _mesa_function_pool[2879]: CreateProgramObjectARB (will be remapped) */ + "\0" + "glCreateProgramObjectARB\0" + "\0" + /* _mesa_function_pool[2906]: FragmentLightModelivSGIX (dynamic) */ + "ip\0" + "glFragmentLightModelivSGIX\0" + "\0" + /* _mesa_function_pool[2937]: UniformMatrix4x3fv (will be remapped) */ + "iiip\0" + "glUniformMatrix4x3fv\0" + "\0" + /* _mesa_function_pool[2964]: PrioritizeTextures (offset 331) */ + "ipp\0" + "glPrioritizeTextures\0" + "glPrioritizeTexturesEXT\0" + "\0" + /* _mesa_function_pool[3014]: AsyncMarkerSGIX (dynamic) */ + "i\0" + "glAsyncMarkerSGIX\0" + "\0" + /* _mesa_function_pool[3035]: GlobalAlphaFactorubSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorubSUN\0" + "\0" + /* _mesa_function_pool[3063]: ClearDebugLogMESA (dynamic) */ + "iii\0" + "glClearDebugLogMESA\0" + "\0" + /* _mesa_function_pool[3088]: ResetHistogram (offset 369) */ + "i\0" + "glResetHistogram\0" + "glResetHistogramEXT\0" + "\0" + /* _mesa_function_pool[3128]: GetProgramNamedParameterfvNV (will be remapped) */ + "iipp\0" + "glGetProgramNamedParameterfvNV\0" + "\0" + /* _mesa_function_pool[3165]: PointParameterfEXT (will be remapped) */ + "if\0" + "glPointParameterf\0" + "glPointParameterfARB\0" + "glPointParameterfEXT\0" + "glPointParameterfSGIS\0" + "\0" + /* _mesa_function_pool[3251]: LoadIdentityDeformationMapSGIX (dynamic) */ + "i\0" + "glLoadIdentityDeformationMapSGIX\0" + "\0" + /* _mesa_function_pool[3287]: GenFencesNV (will be remapped) */ + "ip\0" + "glGenFencesNV\0" + "\0" + /* _mesa_function_pool[3305]: ImageTransformParameterfHP (dynamic) */ + "iif\0" + "glImageTransformParameterfHP\0" + "\0" + /* _mesa_function_pool[3339]: MatrixIndexusvARB (dynamic) */ + "ip\0" + "glMatrixIndexusvARB\0" + "\0" + /* _mesa_function_pool[3363]: DrawElementsBaseVertex (will be remapped) */ + "iiipi\0" + "glDrawElementsBaseVertex\0" + "\0" + /* _mesa_function_pool[3395]: DisableVertexAttribArrayARB (will be remapped) */ + "i\0" + "glDisableVertexAttribArray\0" + "glDisableVertexAttribArrayARB\0" + "\0" + /* _mesa_function_pool[3455]: TexCoord2sv (offset 109) */ + "p\0" + "glTexCoord2sv\0" + "\0" + /* _mesa_function_pool[3472]: Vertex4dv (offset 143) */ + "p\0" + "glVertex4dv\0" + "\0" + /* _mesa_function_pool[3487]: StencilMaskSeparate (will be remapped) */ + "ii\0" + "glStencilMaskSeparate\0" + "\0" + /* _mesa_function_pool[3513]: ProgramLocalParameter4dARB (will be remapped) */ + "iidddd\0" + "glProgramLocalParameter4dARB\0" + "\0" + /* _mesa_function_pool[3550]: CompressedTexImage3DARB (will be remapped) */ + "iiiiiiiip\0" + "glCompressedTexImage3D\0" + "glCompressedTexImage3DARB\0" + "\0" + /* _mesa_function_pool[3610]: Color3sv (offset 18) */ + "p\0" + "glColor3sv\0" + "\0" + /* _mesa_function_pool[3624]: GetConvolutionParameteriv (offset 358) */ + "iip\0" + "glGetConvolutionParameteriv\0" + "glGetConvolutionParameterivEXT\0" + "\0" + /* _mesa_function_pool[3688]: VertexAttrib1fARB (will be remapped) */ + "if\0" + "glVertexAttrib1f\0" + "glVertexAttrib1fARB\0" + "\0" + /* _mesa_function_pool[3729]: Vertex2dv (offset 127) */ + "p\0" + "glVertex2dv\0" + "\0" + /* _mesa_function_pool[3744]: TestFenceNV (will be remapped) */ + "i\0" + "glTestFenceNV\0" + "\0" + /* _mesa_function_pool[3761]: MultiTexCoord1fvARB (offset 379) */ + "ip\0" + "glMultiTexCoord1fv\0" + "glMultiTexCoord1fvARB\0" + "\0" + /* _mesa_function_pool[3806]: TexCoord3iv (offset 115) */ + "p\0" + "glTexCoord3iv\0" + "\0" + /* _mesa_function_pool[3823]: ColorFragmentOp2ATI (will be remapped) */ + "iiiiiiiiii\0" + "glColorFragmentOp2ATI\0" + "\0" + /* _mesa_function_pool[3857]: SecondaryColorPointerListIBM (dynamic) */ + "iiipi\0" + "glSecondaryColorPointerListIBM\0" + "\0" + /* _mesa_function_pool[3895]: GetPixelTexGenParameterivSGIS (will be remapped) */ + "ip\0" + "glGetPixelTexGenParameterivSGIS\0" + "\0" + /* _mesa_function_pool[3931]: Color3fv (offset 14) */ + "p\0" + "glColor3fv\0" + "\0" + /* _mesa_function_pool[3945]: VertexAttrib4fNV (will be remapped) */ + "iffff\0" + "glVertexAttrib4fNV\0" + "\0" + /* _mesa_function_pool[3971]: ReplacementCodeubSUN (dynamic) */ + "i\0" + "glReplacementCodeubSUN\0" + "\0" + /* _mesa_function_pool[3997]: FinishAsyncSGIX (dynamic) */ + "p\0" + "glFinishAsyncSGIX\0" + "\0" + /* _mesa_function_pool[4018]: GetDebugLogMESA (dynamic) */ + "iiiipp\0" + "glGetDebugLogMESA\0" + "\0" + /* _mesa_function_pool[4044]: FogCoorddEXT (will be remapped) */ + "d\0" + "glFogCoordd\0" + "glFogCoorddEXT\0" + "\0" + /* _mesa_function_pool[4074]: Color4ubVertex3fSUN (dynamic) */ + "iiiifff\0" + "glColor4ubVertex3fSUN\0" + "\0" + /* _mesa_function_pool[4105]: FogCoordfEXT (will be remapped) */ + "f\0" + "glFogCoordf\0" + "glFogCoordfEXT\0" + "\0" + /* _mesa_function_pool[4135]: PointSize (offset 173) */ + "f\0" + "glPointSize\0" + "\0" + /* _mesa_function_pool[4150]: TexCoord2fVertex3fSUN (dynamic) */ + "fffff\0" + "glTexCoord2fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[4181]: PopName (offset 200) */ + "\0" + "glPopName\0" + "\0" + /* _mesa_function_pool[4193]: GlobalAlphaFactoriSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactoriSUN\0" + "\0" + /* _mesa_function_pool[4220]: VertexAttrib2dNV (will be remapped) */ + "idd\0" + "glVertexAttrib2dNV\0" + "\0" + /* _mesa_function_pool[4244]: GetProgramInfoLog (will be remapped) */ + "iipp\0" + "glGetProgramInfoLog\0" + "\0" + /* _mesa_function_pool[4270]: VertexAttrib4NbvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nbv\0" + "glVertexAttrib4NbvARB\0" + "\0" + /* _mesa_function_pool[4315]: GetActiveAttribARB (will be remapped) */ + "iiipppp\0" + "glGetActiveAttrib\0" + "glGetActiveAttribARB\0" + "\0" + /* _mesa_function_pool[4363]: Vertex4sv (offset 149) */ + "p\0" + "glVertex4sv\0" + "\0" + /* _mesa_function_pool[4378]: VertexAttrib4ubNV (will be remapped) */ + "iiiii\0" + "glVertexAttrib4ubNV\0" + "\0" + /* _mesa_function_pool[4405]: TextureRangeAPPLE (will be remapped) */ + "iip\0" + "glTextureRangeAPPLE\0" + "\0" + /* _mesa_function_pool[4430]: GetTexEnvfv (offset 276) */ + "iip\0" + "glGetTexEnvfv\0" + "\0" + /* _mesa_function_pool[4449]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + "ffffffffffff\0" + "glTexCoord2fColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[4502]: Indexub (offset 315) */ + "i\0" + "glIndexub\0" + "\0" + /* _mesa_function_pool[4515]: TexEnvi (offset 186) */ + "iii\0" + "glTexEnvi\0" + "\0" + /* _mesa_function_pool[4530]: GetClipPlane (offset 259) */ + "ip\0" + "glGetClipPlane\0" + "\0" + /* _mesa_function_pool[4549]: CombinerParameterfvNV (will be remapped) */ + "ip\0" + "glCombinerParameterfvNV\0" + "\0" + /* _mesa_function_pool[4577]: VertexAttribs3dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs3dvNV\0" + "\0" + /* _mesa_function_pool[4603]: VertexAttribs4fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs4fvNV\0" + "\0" + /* _mesa_function_pool[4629]: VertexArrayRangeNV (will be remapped) */ + "ip\0" + "glVertexArrayRangeNV\0" + "\0" + /* _mesa_function_pool[4654]: FragmentLightiSGIX (dynamic) */ + "iii\0" + "glFragmentLightiSGIX\0" + "\0" + /* _mesa_function_pool[4680]: PolygonOffsetEXT (will be remapped) */ + "ff\0" + "glPolygonOffsetEXT\0" + "\0" + /* _mesa_function_pool[4703]: PollAsyncSGIX (dynamic) */ + "p\0" + "glPollAsyncSGIX\0" + "\0" + /* _mesa_function_pool[4722]: DeleteFragmentShaderATI (will be remapped) */ + "i\0" + "glDeleteFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[4751]: Scaled (offset 301) */ + "ddd\0" + "glScaled\0" + "\0" + /* _mesa_function_pool[4765]: Scalef (offset 302) */ + "fff\0" + "glScalef\0" + "\0" + /* _mesa_function_pool[4779]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glTexCoord2fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[4817]: MultTransposeMatrixdARB (will be remapped) */ + "p\0" + "glMultTransposeMatrixd\0" + "glMultTransposeMatrixdARB\0" + "\0" + /* _mesa_function_pool[4869]: AlphaFunc (offset 240) */ + "if\0" + "glAlphaFunc\0" + "\0" + /* _mesa_function_pool[4885]: WindowPos2svMESA (will be remapped) */ + "p\0" + "glWindowPos2sv\0" + "glWindowPos2svARB\0" + "glWindowPos2svMESA\0" + "\0" + /* _mesa_function_pool[4940]: EdgeFlag (offset 41) */ + "i\0" + "glEdgeFlag\0" + "\0" + /* _mesa_function_pool[4954]: TexCoord2iv (offset 107) */ + "p\0" + "glTexCoord2iv\0" + "\0" + /* _mesa_function_pool[4971]: CompressedTexImage1DARB (will be remapped) */ + "iiiiiip\0" + "glCompressedTexImage1D\0" + "glCompressedTexImage1DARB\0" + "\0" + /* _mesa_function_pool[5029]: Rotated (offset 299) */ + "dddd\0" + "glRotated\0" + "\0" + /* _mesa_function_pool[5045]: VertexAttrib2sNV (will be remapped) */ + "iii\0" + "glVertexAttrib2sNV\0" + "\0" + /* _mesa_function_pool[5069]: ReadPixels (offset 256) */ + "iiiiiip\0" + "glReadPixels\0" + "\0" + /* _mesa_function_pool[5091]: EdgeFlagv (offset 42) */ + "p\0" + "glEdgeFlagv\0" + "\0" + /* _mesa_function_pool[5106]: NormalPointerListIBM (dynamic) */ + "iipi\0" + "glNormalPointerListIBM\0" + "\0" + /* _mesa_function_pool[5135]: IndexPointerEXT (will be remapped) */ + "iiip\0" + "glIndexPointerEXT\0" + "\0" + /* _mesa_function_pool[5159]: Color4iv (offset 32) */ + "p\0" + "glColor4iv\0" + "\0" + /* _mesa_function_pool[5173]: TexParameterf (offset 178) */ + "iif\0" + "glTexParameterf\0" + "\0" + /* _mesa_function_pool[5194]: TexParameteri (offset 180) */ + "iii\0" + "glTexParameteri\0" + "\0" + /* _mesa_function_pool[5215]: NormalPointerEXT (will be remapped) */ + "iiip\0" + "glNormalPointerEXT\0" + "\0" + /* _mesa_function_pool[5240]: MultiTexCoord3dARB (offset 392) */ + "iddd\0" + "glMultiTexCoord3d\0" + "glMultiTexCoord3dARB\0" + "\0" + /* _mesa_function_pool[5285]: MultiTexCoord2iARB (offset 388) */ + "iii\0" + "glMultiTexCoord2i\0" + "glMultiTexCoord2iARB\0" + "\0" + /* _mesa_function_pool[5329]: DrawPixels (offset 257) */ + "iiiip\0" + "glDrawPixels\0" + "\0" + /* _mesa_function_pool[5349]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ + "iffffffff\0" + "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[5409]: MultiTexCoord2svARB (offset 391) */ + "ip\0" + "glMultiTexCoord2sv\0" + "glMultiTexCoord2svARB\0" + "\0" + /* _mesa_function_pool[5454]: ReplacementCodeubvSUN (dynamic) */ + "p\0" + "glReplacementCodeubvSUN\0" + "\0" + /* _mesa_function_pool[5481]: Uniform3iARB (will be remapped) */ + "iiii\0" + "glUniform3i\0" + "glUniform3iARB\0" + "\0" + /* _mesa_function_pool[5514]: GetFragmentMaterialfvSGIX (dynamic) */ + "iip\0" + "glGetFragmentMaterialfvSGIX\0" + "\0" + /* _mesa_function_pool[5547]: GetShaderInfoLog (will be remapped) */ + "iipp\0" + "glGetShaderInfoLog\0" + "\0" + /* _mesa_function_pool[5572]: WeightivARB (dynamic) */ + "ip\0" + "glWeightivARB\0" + "\0" + /* _mesa_function_pool[5590]: PollInstrumentsSGIX (dynamic) */ + "p\0" + "glPollInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[5615]: GlobalAlphaFactordSUN (dynamic) */ + "d\0" + "glGlobalAlphaFactordSUN\0" + "\0" + /* _mesa_function_pool[5642]: GetFinalCombinerInputParameterfvNV (will be remapped) */ + "iip\0" + "glGetFinalCombinerInputParameterfvNV\0" + "\0" + /* _mesa_function_pool[5684]: GenerateMipmapEXT (will be remapped) */ + "i\0" + "glGenerateMipmap\0" + "glGenerateMipmapEXT\0" + "\0" + /* _mesa_function_pool[5724]: GenLists (offset 5) */ + "i\0" + "glGenLists\0" + "\0" + /* _mesa_function_pool[5738]: SetFragmentShaderConstantATI (will be remapped) */ + "ip\0" + "glSetFragmentShaderConstantATI\0" + "\0" + /* _mesa_function_pool[5773]: GetMapAttribParameterivNV (dynamic) */ + "iiip\0" + "glGetMapAttribParameterivNV\0" + "\0" + /* _mesa_function_pool[5807]: CreateShaderObjectARB (will be remapped) */ + "i\0" + "glCreateShaderObjectARB\0" + "\0" + /* _mesa_function_pool[5834]: GetSharpenTexFuncSGIS (dynamic) */ + "ip\0" + "glGetSharpenTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[5862]: BufferDataARB (will be remapped) */ + "iipi\0" + "glBufferData\0" + "glBufferDataARB\0" + "\0" + /* _mesa_function_pool[5897]: FlushVertexArrayRangeNV (will be remapped) */ + "\0" + "glFlushVertexArrayRangeNV\0" + "\0" + /* _mesa_function_pool[5925]: MapGrid2d (offset 226) */ + "iddidd\0" + "glMapGrid2d\0" + "\0" + /* _mesa_function_pool[5945]: MapGrid2f (offset 227) */ + "iffiff\0" + "glMapGrid2f\0" + "\0" + /* _mesa_function_pool[5965]: SampleMapATI (will be remapped) */ + "iii\0" + "glSampleMapATI\0" + "\0" + /* _mesa_function_pool[5985]: VertexPointerEXT (will be remapped) */ + "iiiip\0" + "glVertexPointerEXT\0" + "\0" + /* _mesa_function_pool[6011]: GetTexFilterFuncSGIS (dynamic) */ + "iip\0" + "glGetTexFilterFuncSGIS\0" + "\0" + /* _mesa_function_pool[6039]: Scissor (offset 176) */ + "iiii\0" + "glScissor\0" + "\0" + /* _mesa_function_pool[6055]: Fogf (offset 153) */ + "if\0" + "glFogf\0" + "\0" + /* _mesa_function_pool[6066]: GetCombinerOutputParameterfvNV (will be remapped) */ + "iiip\0" + "glGetCombinerOutputParameterfvNV\0" + "\0" + /* _mesa_function_pool[6105]: TexSubImage1D (offset 332) */ + "iiiiiip\0" + "glTexSubImage1D\0" + "glTexSubImage1DEXT\0" + "\0" + /* _mesa_function_pool[6149]: VertexAttrib1sARB (will be remapped) */ + "ii\0" + "glVertexAttrib1s\0" + "glVertexAttrib1sARB\0" + "\0" + /* _mesa_function_pool[6190]: FenceSync (will be remapped) */ + "ii\0" + "glFenceSync\0" + "\0" + /* _mesa_function_pool[6206]: Color4usv (offset 40) */ + "p\0" + "glColor4usv\0" + "\0" + /* _mesa_function_pool[6221]: Fogi (offset 155) */ + "ii\0" + "glFogi\0" + "\0" + /* _mesa_function_pool[6232]: DepthRange (offset 288) */ + "dd\0" + "glDepthRange\0" + "\0" + /* _mesa_function_pool[6249]: RasterPos3iv (offset 75) */ + "p\0" + "glRasterPos3iv\0" + "\0" + /* _mesa_function_pool[6267]: FinalCombinerInputNV (will be remapped) */ + "iiii\0" + "glFinalCombinerInputNV\0" + "\0" + /* _mesa_function_pool[6296]: TexCoord2i (offset 106) */ + "ii\0" + "glTexCoord2i\0" + "\0" + /* _mesa_function_pool[6313]: PixelMapfv (offset 251) */ + "iip\0" + "glPixelMapfv\0" + "\0" + /* _mesa_function_pool[6331]: Color4ui (offset 37) */ + "iiii\0" + "glColor4ui\0" + "\0" + /* _mesa_function_pool[6348]: RasterPos3s (offset 76) */ + "iii\0" + "glRasterPos3s\0" + "\0" + /* _mesa_function_pool[6367]: Color3usv (offset 24) */ + "p\0" + "glColor3usv\0" + "\0" + /* _mesa_function_pool[6382]: FlushRasterSGIX (dynamic) */ + "\0" + "glFlushRasterSGIX\0" + "\0" + /* _mesa_function_pool[6402]: TexCoord2f (offset 104) */ + "ff\0" + "glTexCoord2f\0" + "\0" + /* _mesa_function_pool[6419]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ + "ifffff\0" + "glReplacementCodeuiTexCoord2fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[6468]: TexCoord2d (offset 102) */ + "dd\0" + "glTexCoord2d\0" + "\0" + /* _mesa_function_pool[6485]: RasterPos3d (offset 70) */ + "ddd\0" + "glRasterPos3d\0" + "\0" + /* _mesa_function_pool[6504]: RasterPos3f (offset 72) */ + "fff\0" + "glRasterPos3f\0" + "\0" + /* _mesa_function_pool[6523]: Uniform1fARB (will be remapped) */ + "if\0" + "glUniform1f\0" + "glUniform1fARB\0" + "\0" + /* _mesa_function_pool[6554]: AreTexturesResident (offset 322) */ + "ipp\0" + "glAreTexturesResident\0" + "glAreTexturesResidentEXT\0" + "\0" + /* _mesa_function_pool[6606]: TexCoord2s (offset 108) */ + "ii\0" + "glTexCoord2s\0" + "\0" + /* _mesa_function_pool[6623]: StencilOpSeparate (will be remapped) */ + "iiii\0" + "glStencilOpSeparate\0" + "glStencilOpSeparateATI\0" + "\0" + /* _mesa_function_pool[6672]: ColorTableParameteriv (offset 341) */ + "iip\0" + "glColorTableParameteriv\0" + "glColorTableParameterivSGI\0" + "\0" + /* _mesa_function_pool[6728]: FogCoordPointerListIBM (dynamic) */ + "iipi\0" + "glFogCoordPointerListIBM\0" + "\0" + /* _mesa_function_pool[6759]: WindowPos3dMESA (will be remapped) */ + "ddd\0" + "glWindowPos3d\0" + "glWindowPos3dARB\0" + "glWindowPos3dMESA\0" + "\0" + /* _mesa_function_pool[6813]: Color4us (offset 39) */ + "iiii\0" + "glColor4us\0" + "\0" + /* _mesa_function_pool[6830]: PointParameterfvEXT (will be remapped) */ + "ip\0" + "glPointParameterfv\0" + "glPointParameterfvARB\0" + "glPointParameterfvEXT\0" + "glPointParameterfvSGIS\0" + "\0" + /* _mesa_function_pool[6920]: Color3bv (offset 10) */ + "p\0" + "glColor3bv\0" + "\0" + /* _mesa_function_pool[6934]: WindowPos2fvMESA (will be remapped) */ + "p\0" + "glWindowPos2fv\0" + "glWindowPos2fvARB\0" + "glWindowPos2fvMESA\0" + "\0" + /* _mesa_function_pool[6989]: SecondaryColor3bvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3bv\0" + "glSecondaryColor3bvEXT\0" + "\0" + /* _mesa_function_pool[7035]: VertexPointerListIBM (dynamic) */ + "iiipi\0" + "glVertexPointerListIBM\0" + "\0" + /* _mesa_function_pool[7065]: GetProgramLocalParameterfvARB (will be remapped) */ + "iip\0" + "glGetProgramLocalParameterfvARB\0" + "\0" + /* _mesa_function_pool[7102]: FragmentMaterialfSGIX (dynamic) */ + "iif\0" + "glFragmentMaterialfSGIX\0" + "\0" + /* _mesa_function_pool[7131]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ + "ffffffff\0" + "glTexCoord2fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[7173]: RenderbufferStorageEXT (will be remapped) */ + "iiii\0" + "glRenderbufferStorage\0" + "glRenderbufferStorageEXT\0" + "\0" + /* _mesa_function_pool[7226]: IsFenceNV (will be remapped) */ + "i\0" + "glIsFenceNV\0" + "\0" + /* _mesa_function_pool[7241]: AttachObjectARB (will be remapped) */ + "ii\0" + "glAttachObjectARB\0" + "\0" + /* _mesa_function_pool[7263]: GetFragmentLightivSGIX (dynamic) */ + "iip\0" + "glGetFragmentLightivSGIX\0" + "\0" + /* _mesa_function_pool[7293]: UniformMatrix2fvARB (will be remapped) */ + "iiip\0" + "glUniformMatrix2fv\0" + "glUniformMatrix2fvARB\0" + "\0" + /* _mesa_function_pool[7340]: MultiTexCoord2fARB (offset 386) */ + "iff\0" + "glMultiTexCoord2f\0" + "glMultiTexCoord2fARB\0" + "\0" + /* _mesa_function_pool[7384]: ColorTable (offset 339) */ + "iiiiip\0" + "glColorTable\0" + "glColorTableSGI\0" + "glColorTableEXT\0" + "\0" + /* _mesa_function_pool[7437]: IndexPointer (offset 314) */ + "iip\0" + "glIndexPointer\0" + "\0" + /* _mesa_function_pool[7457]: Accum (offset 213) */ + "if\0" + "glAccum\0" + "\0" + /* _mesa_function_pool[7469]: GetTexImage (offset 281) */ + "iiiip\0" + "glGetTexImage\0" + "\0" + /* _mesa_function_pool[7490]: MapControlPointsNV (dynamic) */ + "iiiiiiiip\0" + "glMapControlPointsNV\0" + "\0" + /* _mesa_function_pool[7522]: ConvolutionFilter2D (offset 349) */ + "iiiiiip\0" + "glConvolutionFilter2D\0" + "glConvolutionFilter2DEXT\0" + "\0" + /* _mesa_function_pool[7578]: Finish (offset 216) */ + "\0" + "glFinish\0" + "\0" + /* _mesa_function_pool[7589]: MapParameterfvNV (dynamic) */ + "iip\0" + "glMapParameterfvNV\0" + "\0" + /* _mesa_function_pool[7613]: ClearStencil (offset 207) */ + "i\0" + "glClearStencil\0" + "\0" + /* _mesa_function_pool[7631]: VertexAttrib3dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib3dv\0" + "glVertexAttrib3dvARB\0" + "\0" + /* _mesa_function_pool[7674]: HintPGI (dynamic) */ + "ii\0" + "glHintPGI\0" + "\0" + /* _mesa_function_pool[7688]: ConvolutionParameteriv (offset 353) */ + "iip\0" + "glConvolutionParameteriv\0" + "glConvolutionParameterivEXT\0" + "\0" + /* _mesa_function_pool[7746]: Color4s (offset 33) */ + "iiii\0" + "glColor4s\0" + "\0" + /* _mesa_function_pool[7762]: InterleavedArrays (offset 317) */ + "iip\0" + "glInterleavedArrays\0" + "\0" + /* _mesa_function_pool[7787]: RasterPos2fv (offset 65) */ + "p\0" + "glRasterPos2fv\0" + "\0" + /* _mesa_function_pool[7805]: TexCoord1fv (offset 97) */ + "p\0" + "glTexCoord1fv\0" + "\0" + /* _mesa_function_pool[7822]: Vertex2d (offset 126) */ + "dd\0" + "glVertex2d\0" + "\0" + /* _mesa_function_pool[7837]: CullParameterdvEXT (will be remapped) */ + "ip\0" + "glCullParameterdvEXT\0" + "\0" + /* _mesa_function_pool[7862]: ProgramNamedParameter4fNV (will be remapped) */ + "iipffff\0" + "glProgramNamedParameter4fNV\0" + "\0" + /* _mesa_function_pool[7899]: Color3fVertex3fSUN (dynamic) */ + "ffffff\0" + "glColor3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[7928]: ProgramEnvParameter4fvARB (will be remapped) */ + "iip\0" + "glProgramEnvParameter4fvARB\0" + "glProgramParameter4fvNV\0" + "\0" + /* _mesa_function_pool[7985]: Color4i (offset 31) */ + "iiii\0" + "glColor4i\0" + "\0" + /* _mesa_function_pool[8001]: Color4f (offset 29) */ + "ffff\0" + "glColor4f\0" + "\0" + /* _mesa_function_pool[8017]: RasterPos4fv (offset 81) */ + "p\0" + "glRasterPos4fv\0" + "\0" + /* _mesa_function_pool[8035]: Color4d (offset 27) */ + "dddd\0" + "glColor4d\0" + "\0" + /* _mesa_function_pool[8051]: ClearIndex (offset 205) */ + "f\0" + "glClearIndex\0" + "\0" + /* _mesa_function_pool[8067]: Color4b (offset 25) */ + "iiii\0" + "glColor4b\0" + "\0" + /* _mesa_function_pool[8083]: LoadMatrixd (offset 292) */ + "p\0" + "glLoadMatrixd\0" + "\0" + /* _mesa_function_pool[8100]: FragmentLightModeliSGIX (dynamic) */ + "ii\0" + "glFragmentLightModeliSGIX\0" + "\0" + /* _mesa_function_pool[8130]: RasterPos2dv (offset 63) */ + "p\0" + "glRasterPos2dv\0" + "\0" + /* _mesa_function_pool[8148]: ConvolutionParameterfv (offset 351) */ + "iip\0" + "glConvolutionParameterfv\0" + "glConvolutionParameterfvEXT\0" + "\0" + /* _mesa_function_pool[8206]: TbufferMask3DFX (dynamic) */ + "i\0" + "glTbufferMask3DFX\0" + "\0" + /* _mesa_function_pool[8227]: GetTexGendv (offset 278) */ + "iip\0" + "glGetTexGendv\0" + "\0" + /* _mesa_function_pool[8246]: LoadProgramNV (will be remapped) */ + "iiip\0" + "glLoadProgramNV\0" + "\0" + /* _mesa_function_pool[8268]: WaitSync (will be remapped) */ + "iii\0" + "glWaitSync\0" + "\0" + /* _mesa_function_pool[8284]: EndList (offset 1) */ + "\0" + "glEndList\0" + "\0" + /* _mesa_function_pool[8296]: VertexAttrib4fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib4fvNV\0" + "\0" + /* _mesa_function_pool[8320]: GetAttachedObjectsARB (will be remapped) */ + "iipp\0" + "glGetAttachedObjectsARB\0" + "\0" + /* _mesa_function_pool[8350]: Uniform3fvARB (will be remapped) */ + "iip\0" + "glUniform3fv\0" + "glUniform3fvARB\0" + "\0" + /* _mesa_function_pool[8384]: EvalCoord1fv (offset 231) */ + "p\0" + "glEvalCoord1fv\0" + "\0" + /* _mesa_function_pool[8402]: DrawRangeElements (offset 338) */ + "iiiiip\0" + "glDrawRangeElements\0" + "glDrawRangeElementsEXT\0" + "\0" + /* _mesa_function_pool[8453]: EvalMesh2 (offset 238) */ + "iiiii\0" + "glEvalMesh2\0" + "\0" + /* _mesa_function_pool[8472]: Vertex4fv (offset 145) */ + "p\0" + "glVertex4fv\0" + "\0" + /* _mesa_function_pool[8487]: SpriteParameterfvSGIX (dynamic) */ + "ip\0" + "glSpriteParameterfvSGIX\0" + "\0" + /* _mesa_function_pool[8515]: CheckFramebufferStatusEXT (will be remapped) */ + "i\0" + "glCheckFramebufferStatus\0" + "glCheckFramebufferStatusEXT\0" + "\0" + /* _mesa_function_pool[8571]: GlobalAlphaFactoruiSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactoruiSUN\0" + "\0" + /* _mesa_function_pool[8599]: GetHandleARB (will be remapped) */ + "i\0" + "glGetHandleARB\0" + "\0" + /* _mesa_function_pool[8617]: GetVertexAttribivARB (will be remapped) */ + "iip\0" + "glGetVertexAttribiv\0" + "glGetVertexAttribivARB\0" + "\0" + /* _mesa_function_pool[8665]: GetCombinerInputParameterfvNV (will be remapped) */ + "iiiip\0" + "glGetCombinerInputParameterfvNV\0" + "\0" + /* _mesa_function_pool[8704]: CreateProgram (will be remapped) */ + "\0" + "glCreateProgram\0" + "\0" + /* _mesa_function_pool[8722]: LoadTransposeMatrixdARB (will be remapped) */ + "p\0" + "glLoadTransposeMatrixd\0" + "glLoadTransposeMatrixdARB\0" + "\0" + /* _mesa_function_pool[8774]: GetMinmax (offset 364) */ + "iiiip\0" + "glGetMinmax\0" + "glGetMinmaxEXT\0" + "\0" + /* _mesa_function_pool[8808]: StencilFuncSeparate (will be remapped) */ + "iiii\0" + "glStencilFuncSeparate\0" + "\0" + /* _mesa_function_pool[8836]: SecondaryColor3sEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3s\0" + "glSecondaryColor3sEXT\0" + "\0" + /* _mesa_function_pool[8882]: Color3fVertex3fvSUN (dynamic) */ + "pp\0" + "glColor3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[8908]: Normal3fv (offset 57) */ + "p\0" + "glNormal3fv\0" + "\0" + /* _mesa_function_pool[8923]: GlobalAlphaFactorbSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorbSUN\0" + "\0" + /* _mesa_function_pool[8950]: Color3us (offset 23) */ + "iii\0" + "glColor3us\0" + "\0" + /* _mesa_function_pool[8966]: ImageTransformParameterfvHP (dynamic) */ + "iip\0" + "glImageTransformParameterfvHP\0" + "\0" + /* _mesa_function_pool[9001]: VertexAttrib4ivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4iv\0" + "glVertexAttrib4ivARB\0" + "\0" + /* _mesa_function_pool[9044]: End (offset 43) */ + "\0" + "glEnd\0" + "\0" + /* _mesa_function_pool[9052]: VertexAttrib3fNV (will be remapped) */ + "ifff\0" + "glVertexAttrib3fNV\0" + "\0" + /* _mesa_function_pool[9077]: VertexAttribs2dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs2dvNV\0" + "\0" + /* _mesa_function_pool[9103]: GetQueryObjectui64vEXT (will be remapped) */ + "iip\0" + "glGetQueryObjectui64vEXT\0" + "\0" + /* _mesa_function_pool[9133]: MultiTexCoord3fvARB (offset 395) */ + "ip\0" + "glMultiTexCoord3fv\0" + "glMultiTexCoord3fvARB\0" + "\0" + /* _mesa_function_pool[9178]: SecondaryColor3dEXT (will be remapped) */ + "ddd\0" + "glSecondaryColor3d\0" + "glSecondaryColor3dEXT\0" + "\0" + /* _mesa_function_pool[9224]: Color3ub (offset 19) */ + "iii\0" + "glColor3ub\0" + "\0" + /* _mesa_function_pool[9240]: GetProgramParameterfvNV (will be remapped) */ + "iiip\0" + "glGetProgramParameterfvNV\0" + "\0" + /* _mesa_function_pool[9272]: TangentPointerEXT (dynamic) */ + "iip\0" + "glTangentPointerEXT\0" + "\0" + /* _mesa_function_pool[9297]: Color4fNormal3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[9332]: GetInstrumentsSGIX (dynamic) */ + "\0" + "glGetInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[9355]: Color3ui (offset 21) */ + "iii\0" + "glColor3ui\0" + "\0" + /* _mesa_function_pool[9371]: EvalMapsNV (dynamic) */ + "ii\0" + "glEvalMapsNV\0" + "\0" + /* _mesa_function_pool[9388]: TexSubImage2D (offset 333) */ + "iiiiiiiip\0" + "glTexSubImage2D\0" + "glTexSubImage2DEXT\0" + "\0" + /* _mesa_function_pool[9434]: FragmentLightivSGIX (dynamic) */ + "iip\0" + "glFragmentLightivSGIX\0" + "\0" + /* _mesa_function_pool[9461]: GetTexParameterPointervAPPLE (will be remapped) */ + "iip\0" + "glGetTexParameterPointervAPPLE\0" + "\0" + /* _mesa_function_pool[9497]: TexGenfv (offset 191) */ + "iip\0" + "glTexGenfv\0" + "\0" + /* _mesa_function_pool[9513]: PixelTransformParameterfvEXT (dynamic) */ + "iip\0" + "glPixelTransformParameterfvEXT\0" + "\0" + /* _mesa_function_pool[9549]: VertexAttrib4bvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4bv\0" + "glVertexAttrib4bvARB\0" + "\0" + /* _mesa_function_pool[9592]: AlphaFragmentOp2ATI (will be remapped) */ + "iiiiiiiii\0" + "glAlphaFragmentOp2ATI\0" + "\0" + /* _mesa_function_pool[9625]: MultiTexCoord4sARB (offset 406) */ + "iiiii\0" + "glMultiTexCoord4s\0" + "glMultiTexCoord4sARB\0" + "\0" + /* _mesa_function_pool[9671]: GetFragmentMaterialivSGIX (dynamic) */ + "iip\0" + "glGetFragmentMaterialivSGIX\0" + "\0" + /* _mesa_function_pool[9704]: WindowPos4dMESA (will be remapped) */ + "dddd\0" + "glWindowPos4dMESA\0" + "\0" + /* _mesa_function_pool[9728]: WeightPointerARB (dynamic) */ + "iiip\0" + "glWeightPointerARB\0" + "\0" + /* _mesa_function_pool[9753]: WindowPos2dMESA (will be remapped) */ + "dd\0" + "glWindowPos2d\0" + "glWindowPos2dARB\0" + "glWindowPos2dMESA\0" + "\0" + /* _mesa_function_pool[9806]: FramebufferTexture3DEXT (will be remapped) */ + "iiiiii\0" + "glFramebufferTexture3D\0" + "glFramebufferTexture3DEXT\0" + "\0" + /* _mesa_function_pool[9863]: BlendEquation (offset 337) */ + "i\0" + "glBlendEquation\0" + "glBlendEquationEXT\0" + "\0" + /* _mesa_function_pool[9901]: VertexAttrib3dNV (will be remapped) */ + "iddd\0" + "glVertexAttrib3dNV\0" + "\0" + /* _mesa_function_pool[9926]: VertexAttrib3dARB (will be remapped) */ + "iddd\0" + "glVertexAttrib3d\0" + "glVertexAttrib3dARB\0" + "\0" + /* _mesa_function_pool[9969]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + "ppppp\0" + "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[10033]: VertexAttrib4fARB (will be remapped) */ + "iffff\0" + "glVertexAttrib4f\0" + "glVertexAttrib4fARB\0" + "\0" + /* _mesa_function_pool[10077]: GetError (offset 261) */ + "\0" + "glGetError\0" + "\0" + /* _mesa_function_pool[10090]: IndexFuncEXT (dynamic) */ + "if\0" + "glIndexFuncEXT\0" + "\0" + /* _mesa_function_pool[10109]: TexCoord3dv (offset 111) */ + "p\0" + "glTexCoord3dv\0" + "\0" + /* _mesa_function_pool[10126]: Indexdv (offset 45) */ + "p\0" + "glIndexdv\0" + "\0" + /* _mesa_function_pool[10139]: FramebufferTexture2DEXT (will be remapped) */ + "iiiii\0" + "glFramebufferTexture2D\0" + "glFramebufferTexture2DEXT\0" + "\0" + /* _mesa_function_pool[10195]: Normal3s (offset 60) */ + "iii\0" + "glNormal3s\0" + "\0" + /* _mesa_function_pool[10211]: PushName (offset 201) */ + "i\0" + "glPushName\0" + "\0" + /* _mesa_function_pool[10225]: MultiTexCoord2dvARB (offset 385) */ + "ip\0" + "glMultiTexCoord2dv\0" + "glMultiTexCoord2dvARB\0" + "\0" + /* _mesa_function_pool[10270]: CullParameterfvEXT (will be remapped) */ + "ip\0" + "glCullParameterfvEXT\0" + "\0" + /* _mesa_function_pool[10295]: Normal3i (offset 58) */ + "iii\0" + "glNormal3i\0" + "\0" + /* _mesa_function_pool[10311]: ProgramNamedParameter4fvNV (will be remapped) */ + "iipp\0" + "glProgramNamedParameter4fvNV\0" + "\0" + /* _mesa_function_pool[10346]: SecondaryColorPointerEXT (will be remapped) */ + "iiip\0" + "glSecondaryColorPointer\0" + "glSecondaryColorPointerEXT\0" + "\0" + /* _mesa_function_pool[10403]: VertexAttrib4fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4fv\0" + "glVertexAttrib4fvARB\0" + "\0" + /* _mesa_function_pool[10446]: ColorPointerListIBM (dynamic) */ + "iiipi\0" + "glColorPointerListIBM\0" + "\0" + /* _mesa_function_pool[10475]: GetActiveUniformARB (will be remapped) */ + "iiipppp\0" + "glGetActiveUniform\0" + "glGetActiveUniformARB\0" + "\0" + /* _mesa_function_pool[10525]: ImageTransformParameteriHP (dynamic) */ + "iii\0" + "glImageTransformParameteriHP\0" + "\0" + /* _mesa_function_pool[10559]: Normal3b (offset 52) */ + "iii\0" + "glNormal3b\0" + "\0" + /* _mesa_function_pool[10575]: Normal3d (offset 54) */ + "ddd\0" + "glNormal3d\0" + "\0" + /* _mesa_function_pool[10591]: Normal3f (offset 56) */ + "fff\0" + "glNormal3f\0" + "\0" + /* _mesa_function_pool[10607]: MultiTexCoord1svARB (offset 383) */ + "ip\0" + "glMultiTexCoord1sv\0" + "glMultiTexCoord1svARB\0" + "\0" + /* _mesa_function_pool[10652]: Indexi (offset 48) */ + "i\0" + "glIndexi\0" + "\0" + /* _mesa_function_pool[10664]: EndQueryARB (will be remapped) */ + "i\0" + "glEndQuery\0" + "glEndQueryARB\0" + "\0" + /* _mesa_function_pool[10692]: DeleteFencesNV (will be remapped) */ + "ip\0" + "glDeleteFencesNV\0" + "\0" + /* _mesa_function_pool[10713]: DeformationMap3dSGIX (dynamic) */ + "iddiiddiiddiip\0" + "glDeformationMap3dSGIX\0" + "\0" + /* _mesa_function_pool[10752]: DepthMask (offset 211) */ + "i\0" + "glDepthMask\0" + "\0" + /* _mesa_function_pool[10767]: IsShader (will be remapped) */ + "i\0" + "glIsShader\0" + "\0" + /* _mesa_function_pool[10781]: Indexf (offset 46) */ + "f\0" + "glIndexf\0" + "\0" + /* _mesa_function_pool[10793]: GetImageTransformParameterivHP (dynamic) */ + "iip\0" + "glGetImageTransformParameterivHP\0" + "\0" + /* _mesa_function_pool[10831]: Indexd (offset 44) */ + "d\0" + "glIndexd\0" + "\0" + /* _mesa_function_pool[10843]: GetMaterialiv (offset 270) */ + "iip\0" + "glGetMaterialiv\0" + "\0" + /* _mesa_function_pool[10864]: StencilOp (offset 244) */ + "iii\0" + "glStencilOp\0" + "\0" + /* _mesa_function_pool[10881]: WindowPos4ivMESA (will be remapped) */ + "p\0" + "glWindowPos4ivMESA\0" + "\0" + /* _mesa_function_pool[10903]: MultiTexCoord3svARB (offset 399) */ + "ip\0" + "glMultiTexCoord3sv\0" + "glMultiTexCoord3svARB\0" + "\0" + /* _mesa_function_pool[10948]: TexEnvfv (offset 185) */ + "iip\0" + "glTexEnvfv\0" + "\0" + /* _mesa_function_pool[10964]: MultiTexCoord4iARB (offset 404) */ + "iiiii\0" + "glMultiTexCoord4i\0" + "glMultiTexCoord4iARB\0" + "\0" + /* _mesa_function_pool[11010]: Indexs (offset 50) */ + "i\0" + "glIndexs\0" + "\0" + /* _mesa_function_pool[11022]: Binormal3ivEXT (dynamic) */ + "p\0" + "glBinormal3ivEXT\0" + "\0" + /* _mesa_function_pool[11042]: ResizeBuffersMESA (will be remapped) */ + "\0" + "glResizeBuffersMESA\0" + "\0" + /* _mesa_function_pool[11064]: GetUniformivARB (will be remapped) */ + "iip\0" + "glGetUniformiv\0" + "glGetUniformivARB\0" + "\0" + /* _mesa_function_pool[11102]: PixelTexGenParameteriSGIS (will be remapped) */ + "ii\0" + "glPixelTexGenParameteriSGIS\0" + "\0" + /* _mesa_function_pool[11134]: VertexPointervINTEL (dynamic) */ + "iip\0" + "glVertexPointervINTEL\0" + "\0" + /* _mesa_function_pool[11161]: Vertex2i (offset 130) */ + "ii\0" + "glVertex2i\0" + "\0" + /* _mesa_function_pool[11176]: LoadMatrixf (offset 291) */ + "p\0" + "glLoadMatrixf\0" + "\0" + /* _mesa_function_pool[11193]: Vertex2f (offset 128) */ + "ff\0" + "glVertex2f\0" + "\0" + /* _mesa_function_pool[11208]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + "pppp\0" + "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[11261]: Color4bv (offset 26) */ + "p\0" + "glColor4bv\0" + "\0" + /* _mesa_function_pool[11275]: VertexPointer (offset 321) */ + "iiip\0" + "glVertexPointer\0" + "\0" + /* _mesa_function_pool[11297]: SecondaryColor3uiEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3ui\0" + "glSecondaryColor3uiEXT\0" + "\0" + /* _mesa_function_pool[11345]: StartInstrumentsSGIX (dynamic) */ + "\0" + "glStartInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[11370]: SecondaryColor3usvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3usv\0" + "glSecondaryColor3usvEXT\0" + "\0" + /* _mesa_function_pool[11418]: VertexAttrib2fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib2fvNV\0" + "\0" + /* _mesa_function_pool[11442]: ProgramLocalParameter4dvARB (will be remapped) */ + "iip\0" + "glProgramLocalParameter4dvARB\0" + "\0" + /* _mesa_function_pool[11477]: DeleteLists (offset 4) */ + "ii\0" + "glDeleteLists\0" + "\0" + /* _mesa_function_pool[11495]: LogicOp (offset 242) */ + "i\0" + "glLogicOp\0" + "\0" + /* _mesa_function_pool[11508]: MatrixIndexuivARB (dynamic) */ + "ip\0" + "glMatrixIndexuivARB\0" + "\0" + /* _mesa_function_pool[11532]: Vertex2s (offset 132) */ + "ii\0" + "glVertex2s\0" + "\0" + /* _mesa_function_pool[11547]: RenderbufferStorageMultisample (will be remapped) */ + "iiiii\0" + "glRenderbufferStorageMultisample\0" + "glRenderbufferStorageMultisampleEXT\0" + "\0" + /* _mesa_function_pool[11623]: TexCoord4fv (offset 121) */ + "p\0" + "glTexCoord4fv\0" + "\0" + /* _mesa_function_pool[11640]: Tangent3sEXT (dynamic) */ + "iii\0" + "glTangent3sEXT\0" + "\0" + /* _mesa_function_pool[11660]: GlobalAlphaFactorfSUN (dynamic) */ + "f\0" + "glGlobalAlphaFactorfSUN\0" + "\0" + /* _mesa_function_pool[11687]: MultiTexCoord3iARB (offset 396) */ + "iiii\0" + "glMultiTexCoord3i\0" + "glMultiTexCoord3iARB\0" + "\0" + /* _mesa_function_pool[11732]: IsProgram (will be remapped) */ + "i\0" + "glIsProgram\0" + "\0" + /* _mesa_function_pool[11747]: TexCoordPointerListIBM (dynamic) */ + "iiipi\0" + "glTexCoordPointerListIBM\0" + "\0" + /* _mesa_function_pool[11779]: GlobalAlphaFactorusSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorusSUN\0" + "\0" + /* _mesa_function_pool[11807]: VertexAttrib2dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib2dvNV\0" + "\0" + /* _mesa_function_pool[11831]: FramebufferRenderbufferEXT (will be remapped) */ + "iiii\0" + "glFramebufferRenderbuffer\0" + "glFramebufferRenderbufferEXT\0" + "\0" + /* _mesa_function_pool[11892]: VertexAttrib1dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib1dvNV\0" + "\0" + /* _mesa_function_pool[11916]: GenTextures (offset 328) */ + "ip\0" + "glGenTextures\0" + "glGenTexturesEXT\0" + "\0" + /* _mesa_function_pool[11951]: SetFenceNV (will be remapped) */ + "ii\0" + "glSetFenceNV\0" + "\0" + /* _mesa_function_pool[11968]: FramebufferTexture1DEXT (will be remapped) */ + "iiiii\0" + "glFramebufferTexture1D\0" + "glFramebufferTexture1DEXT\0" + "\0" + /* _mesa_function_pool[12024]: GetCombinerOutputParameterivNV (will be remapped) */ + "iiip\0" + "glGetCombinerOutputParameterivNV\0" + "\0" + /* _mesa_function_pool[12063]: PixelTexGenParameterivSGIS (will be remapped) */ + "ip\0" + "glPixelTexGenParameterivSGIS\0" + "\0" + /* _mesa_function_pool[12096]: TextureNormalEXT (dynamic) */ + "i\0" + "glTextureNormalEXT\0" + "\0" + /* _mesa_function_pool[12118]: IndexPointerListIBM (dynamic) */ + "iipi\0" + "glIndexPointerListIBM\0" + "\0" + /* _mesa_function_pool[12146]: WeightfvARB (dynamic) */ + "ip\0" + "glWeightfvARB\0" + "\0" + /* _mesa_function_pool[12164]: RasterPos2sv (offset 69) */ + "p\0" + "glRasterPos2sv\0" + "\0" + /* _mesa_function_pool[12182]: Color4ubv (offset 36) */ + "p\0" + "glColor4ubv\0" + "\0" + /* _mesa_function_pool[12197]: DrawBuffer (offset 202) */ + "i\0" + "glDrawBuffer\0" + "\0" + /* _mesa_function_pool[12213]: TexCoord2fv (offset 105) */ + "p\0" + "glTexCoord2fv\0" + "\0" + /* _mesa_function_pool[12230]: WindowPos4fMESA (will be remapped) */ + "ffff\0" + "glWindowPos4fMESA\0" + "\0" + /* _mesa_function_pool[12254]: TexCoord1sv (offset 101) */ + "p\0" + "glTexCoord1sv\0" + "\0" + /* _mesa_function_pool[12271]: WindowPos3dvMESA (will be remapped) */ + "p\0" + "glWindowPos3dv\0" + "glWindowPos3dvARB\0" + "glWindowPos3dvMESA\0" + "\0" + /* _mesa_function_pool[12326]: DepthFunc (offset 245) */ + "i\0" + "glDepthFunc\0" + "\0" + /* _mesa_function_pool[12341]: PixelMapusv (offset 253) */ + "iip\0" + "glPixelMapusv\0" + "\0" + /* _mesa_function_pool[12360]: GetQueryObjecti64vEXT (will be remapped) */ + "iip\0" + "glGetQueryObjecti64vEXT\0" + "\0" + /* _mesa_function_pool[12389]: MultiTexCoord1dARB (offset 376) */ + "id\0" + "glMultiTexCoord1d\0" + "glMultiTexCoord1dARB\0" + "\0" + /* _mesa_function_pool[12432]: PointParameterivNV (will be remapped) */ + "ip\0" + "glPointParameteriv\0" + "glPointParameterivNV\0" + "\0" + /* _mesa_function_pool[12476]: BlendFunc (offset 241) */ + "ii\0" + "glBlendFunc\0" + "\0" + /* _mesa_function_pool[12492]: Uniform2fvARB (will be remapped) */ + "iip\0" + "glUniform2fv\0" + "glUniform2fvARB\0" + "\0" + /* _mesa_function_pool[12526]: BufferParameteriAPPLE (will be remapped) */ + "iii\0" + "glBufferParameteriAPPLE\0" + "\0" + /* _mesa_function_pool[12555]: MultiTexCoord3dvARB (offset 393) */ + "ip\0" + "glMultiTexCoord3dv\0" + "glMultiTexCoord3dvARB\0" + "\0" + /* _mesa_function_pool[12600]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + "pppp\0" + "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[12656]: DeleteObjectARB (will be remapped) */ + "i\0" + "glDeleteObjectARB\0" + "\0" + /* _mesa_function_pool[12677]: MatrixIndexPointerARB (dynamic) */ + "iiip\0" + "glMatrixIndexPointerARB\0" + "\0" + /* _mesa_function_pool[12707]: ProgramNamedParameter4dvNV (will be remapped) */ + "iipp\0" + "glProgramNamedParameter4dvNV\0" + "\0" + /* _mesa_function_pool[12742]: Tangent3fvEXT (dynamic) */ + "p\0" + "glTangent3fvEXT\0" + "\0" + /* _mesa_function_pool[12761]: Flush (offset 217) */ + "\0" + "glFlush\0" + "\0" + /* _mesa_function_pool[12771]: Color4uiv (offset 38) */ + "p\0" + "glColor4uiv\0" + "\0" + /* _mesa_function_pool[12786]: GenVertexArrays (will be remapped) */ + "ip\0" + "glGenVertexArrays\0" + "\0" + /* _mesa_function_pool[12808]: RasterPos3sv (offset 77) */ + "p\0" + "glRasterPos3sv\0" + "\0" + /* _mesa_function_pool[12826]: BindFramebufferEXT (will be remapped) */ + "ii\0" + "glBindFramebuffer\0" + "glBindFramebufferEXT\0" + "\0" + /* _mesa_function_pool[12869]: ReferencePlaneSGIX (dynamic) */ + "p\0" + "glReferencePlaneSGIX\0" + "\0" + /* _mesa_function_pool[12893]: PushAttrib (offset 219) */ + "i\0" + "glPushAttrib\0" + "\0" + /* _mesa_function_pool[12909]: RasterPos2i (offset 66) */ + "ii\0" + "glRasterPos2i\0" + "\0" + /* _mesa_function_pool[12927]: ValidateProgramARB (will be remapped) */ + "i\0" + "glValidateProgram\0" + "glValidateProgramARB\0" + "\0" + /* _mesa_function_pool[12969]: TexParameteriv (offset 181) */ + "iip\0" + "glTexParameteriv\0" + "\0" + /* _mesa_function_pool[12991]: UnlockArraysEXT (will be remapped) */ + "\0" + "glUnlockArraysEXT\0" + "\0" + /* _mesa_function_pool[13011]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + "ffffffff\0" + "glTexCoord2fColor3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[13052]: WindowPos3fvMESA (will be remapped) */ + "p\0" + "glWindowPos3fv\0" + "glWindowPos3fvARB\0" + "glWindowPos3fvMESA\0" + "\0" + /* _mesa_function_pool[13107]: RasterPos2f (offset 64) */ + "ff\0" + "glRasterPos2f\0" + "\0" + /* _mesa_function_pool[13125]: VertexAttrib1svNV (will be remapped) */ + "ip\0" + "glVertexAttrib1svNV\0" + "\0" + /* _mesa_function_pool[13149]: RasterPos2d (offset 62) */ + "dd\0" + "glRasterPos2d\0" + "\0" + /* _mesa_function_pool[13167]: RasterPos3fv (offset 73) */ + "p\0" + "glRasterPos3fv\0" + "\0" + /* _mesa_function_pool[13185]: CopyTexSubImage3D (offset 373) */ + "iiiiiiiii\0" + "glCopyTexSubImage3D\0" + "glCopyTexSubImage3DEXT\0" + "\0" + /* _mesa_function_pool[13239]: VertexAttrib2dARB (will be remapped) */ + "idd\0" + "glVertexAttrib2d\0" + "glVertexAttrib2dARB\0" + "\0" + /* _mesa_function_pool[13281]: Color4ub (offset 35) */ + "iiii\0" + "glColor4ub\0" + "\0" + /* _mesa_function_pool[13298]: GetInteger64v (will be remapped) */ + "ip\0" + "glGetInteger64v\0" + "\0" + /* _mesa_function_pool[13318]: TextureColorMaskSGIS (dynamic) */ + "iiii\0" + "glTextureColorMaskSGIS\0" + "\0" + /* _mesa_function_pool[13347]: RasterPos2s (offset 68) */ + "ii\0" + "glRasterPos2s\0" + "\0" + /* _mesa_function_pool[13365]: GetColorTable (offset 343) */ + "iiip\0" + "glGetColorTable\0" + "glGetColorTableSGI\0" + "glGetColorTableEXT\0" + "\0" + /* _mesa_function_pool[13425]: SelectBuffer (offset 195) */ + "ip\0" + "glSelectBuffer\0" + "\0" + /* _mesa_function_pool[13444]: Indexiv (offset 49) */ + "p\0" + "glIndexiv\0" + "\0" + /* _mesa_function_pool[13457]: TexCoord3i (offset 114) */ + "iii\0" + "glTexCoord3i\0" + "\0" + /* _mesa_function_pool[13475]: CopyColorTable (offset 342) */ + "iiiii\0" + "glCopyColorTable\0" + "glCopyColorTableSGI\0" + "\0" + /* _mesa_function_pool[13519]: GetHistogramParameterfv (offset 362) */ + "iip\0" + "glGetHistogramParameterfv\0" + "glGetHistogramParameterfvEXT\0" + "\0" + /* _mesa_function_pool[13579]: Frustum (offset 289) */ + "dddddd\0" + "glFrustum\0" + "\0" + /* _mesa_function_pool[13597]: GetString (offset 275) */ + "i\0" + "glGetString\0" + "\0" + /* _mesa_function_pool[13612]: ColorPointervINTEL (dynamic) */ + "iip\0" + "glColorPointervINTEL\0" + "\0" + /* _mesa_function_pool[13638]: TexEnvf (offset 184) */ + "iif\0" + "glTexEnvf\0" + "\0" + /* _mesa_function_pool[13653]: TexCoord3d (offset 110) */ + "ddd\0" + "glTexCoord3d\0" + "\0" + /* _mesa_function_pool[13671]: AlphaFragmentOp1ATI (will be remapped) */ + "iiiiii\0" + "glAlphaFragmentOp1ATI\0" + "\0" + /* _mesa_function_pool[13701]: TexCoord3f (offset 112) */ + "fff\0" + "glTexCoord3f\0" + "\0" + /* _mesa_function_pool[13719]: MultiTexCoord3ivARB (offset 397) */ + "ip\0" + "glMultiTexCoord3iv\0" + "glMultiTexCoord3ivARB\0" + "\0" + /* _mesa_function_pool[13764]: MultiTexCoord2sARB (offset 390) */ + "iii\0" + "glMultiTexCoord2s\0" + "glMultiTexCoord2sARB\0" + "\0" + /* _mesa_function_pool[13808]: VertexAttrib1dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib1dv\0" + "glVertexAttrib1dvARB\0" + "\0" + /* _mesa_function_pool[13851]: DeleteTextures (offset 327) */ + "ip\0" + "glDeleteTextures\0" + "glDeleteTexturesEXT\0" + "\0" + /* _mesa_function_pool[13892]: TexCoordPointerEXT (will be remapped) */ + "iiiip\0" + "glTexCoordPointerEXT\0" + "\0" + /* _mesa_function_pool[13920]: TexSubImage4DSGIS (dynamic) */ + "iiiiiiiiiiiip\0" + "glTexSubImage4DSGIS\0" + "\0" + /* _mesa_function_pool[13955]: TexCoord3s (offset 116) */ + "iii\0" + "glTexCoord3s\0" + "\0" + /* _mesa_function_pool[13973]: GetTexLevelParameteriv (offset 285) */ + "iiip\0" + "glGetTexLevelParameteriv\0" + "\0" + /* _mesa_function_pool[14004]: CombinerStageParameterfvNV (dynamic) */ + "iip\0" + "glCombinerStageParameterfvNV\0" + "\0" + /* _mesa_function_pool[14038]: StopInstrumentsSGIX (dynamic) */ + "i\0" + "glStopInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[14063]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + "fffffffffffffff\0" + "glTexCoord4fColor4fNormal3fVertex4fSUN\0" + "\0" + /* _mesa_function_pool[14119]: ClearAccum (offset 204) */ + "ffff\0" + "glClearAccum\0" + "\0" + /* _mesa_function_pool[14138]: DeformSGIX (dynamic) */ + "i\0" + "glDeformSGIX\0" + "\0" + /* _mesa_function_pool[14154]: GetVertexAttribfvARB (will be remapped) */ + "iip\0" + "glGetVertexAttribfv\0" + "glGetVertexAttribfvARB\0" + "\0" + /* _mesa_function_pool[14202]: SecondaryColor3ivEXT (will be remapped) */ + "p\0" + "glSecondaryColor3iv\0" + "glSecondaryColor3ivEXT\0" + "\0" + /* _mesa_function_pool[14248]: TexCoord4iv (offset 123) */ + "p\0" + "glTexCoord4iv\0" + "\0" + /* _mesa_function_pool[14265]: UniformMatrix4x2fv (will be remapped) */ + "iiip\0" + "glUniformMatrix4x2fv\0" + "\0" + /* _mesa_function_pool[14292]: GetDetailTexFuncSGIS (dynamic) */ + "ip\0" + "glGetDetailTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[14319]: GetCombinerStageParameterfvNV (dynamic) */ + "iip\0" + "glGetCombinerStageParameterfvNV\0" + "\0" + /* _mesa_function_pool[14356]: PolygonOffset (offset 319) */ + "ff\0" + "glPolygonOffset\0" + "\0" + /* _mesa_function_pool[14376]: BindVertexArray (will be remapped) */ + "i\0" + "glBindVertexArray\0" + "\0" + /* _mesa_function_pool[14397]: Color4ubVertex2fvSUN (dynamic) */ + "pp\0" + "glColor4ubVertex2fvSUN\0" + "\0" + /* _mesa_function_pool[14424]: Rectd (offset 86) */ + "dddd\0" + "glRectd\0" + "\0" + /* _mesa_function_pool[14438]: TexFilterFuncSGIS (dynamic) */ + "iiip\0" + "glTexFilterFuncSGIS\0" + "\0" + /* _mesa_function_pool[14464]: SampleMaskSGIS (will be remapped) */ + "fi\0" + "glSampleMaskSGIS\0" + "glSampleMaskEXT\0" + "\0" + /* _mesa_function_pool[14501]: GetAttribLocationARB (will be remapped) */ + "ip\0" + "glGetAttribLocation\0" + "glGetAttribLocationARB\0" + "\0" + /* _mesa_function_pool[14548]: RasterPos3i (offset 74) */ + "iii\0" + "glRasterPos3i\0" + "\0" + /* _mesa_function_pool[14567]: VertexAttrib4ubvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4ubv\0" + "glVertexAttrib4ubvARB\0" + "\0" + /* _mesa_function_pool[14612]: DetailTexFuncSGIS (dynamic) */ + "iip\0" + "glDetailTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[14637]: Normal3fVertex3fSUN (dynamic) */ + "ffffff\0" + "glNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[14667]: CopyTexImage2D (offset 324) */ + "iiiiiiii\0" + "glCopyTexImage2D\0" + "glCopyTexImage2DEXT\0" + "\0" + /* _mesa_function_pool[14714]: GetBufferPointervARB (will be remapped) */ + "iip\0" + "glGetBufferPointerv\0" + "glGetBufferPointervARB\0" + "\0" + /* _mesa_function_pool[14762]: ProgramEnvParameter4fARB (will be remapped) */ + "iiffff\0" + "glProgramEnvParameter4fARB\0" + "glProgramParameter4fNV\0" + "\0" + /* _mesa_function_pool[14820]: Uniform3ivARB (will be remapped) */ + "iip\0" + "glUniform3iv\0" + "glUniform3ivARB\0" + "\0" + /* _mesa_function_pool[14854]: Lightfv (offset 160) */ + "iip\0" + "glLightfv\0" + "\0" + /* _mesa_function_pool[14869]: ClearDepth (offset 208) */ + "d\0" + "glClearDepth\0" + "\0" + /* _mesa_function_pool[14885]: GetFenceivNV (will be remapped) */ + "iip\0" + "glGetFenceivNV\0" + "\0" + /* _mesa_function_pool[14905]: WindowPos4dvMESA (will be remapped) */ + "p\0" + "glWindowPos4dvMESA\0" + "\0" + /* _mesa_function_pool[14927]: ColorSubTable (offset 346) */ + "iiiiip\0" + "glColorSubTable\0" + "glColorSubTableEXT\0" + "\0" + /* _mesa_function_pool[14970]: Color4fv (offset 30) */ + "p\0" + "glColor4fv\0" + "\0" + /* _mesa_function_pool[14984]: MultiTexCoord4ivARB (offset 405) */ + "ip\0" + "glMultiTexCoord4iv\0" + "glMultiTexCoord4ivARB\0" + "\0" + /* _mesa_function_pool[15029]: ProgramLocalParameters4fvEXT (will be remapped) */ + "iiip\0" + "glProgramLocalParameters4fvEXT\0" + "\0" + /* _mesa_function_pool[15066]: ColorPointer (offset 308) */ + "iiip\0" + "glColorPointer\0" + "\0" + /* _mesa_function_pool[15087]: Rects (offset 92) */ + "iiii\0" + "glRects\0" + "\0" + /* _mesa_function_pool[15101]: GetMapAttribParameterfvNV (dynamic) */ + "iiip\0" + "glGetMapAttribParameterfvNV\0" + "\0" + /* _mesa_function_pool[15135]: Lightiv (offset 162) */ + "iip\0" + "glLightiv\0" + "\0" + /* _mesa_function_pool[15150]: VertexAttrib4sARB (will be remapped) */ + "iiiii\0" + "glVertexAttrib4s\0" + "glVertexAttrib4sARB\0" + "\0" + /* _mesa_function_pool[15194]: GetQueryObjectuivARB (will be remapped) */ + "iip\0" + "glGetQueryObjectuiv\0" + "glGetQueryObjectuivARB\0" + "\0" + /* _mesa_function_pool[15242]: GetTexParameteriv (offset 283) */ + "iip\0" + "glGetTexParameteriv\0" + "\0" + /* _mesa_function_pool[15267]: MapParameterivNV (dynamic) */ + "iip\0" + "glMapParameterivNV\0" + "\0" + /* _mesa_function_pool[15291]: GenRenderbuffersEXT (will be remapped) */ + "ip\0" + "glGenRenderbuffers\0" + "glGenRenderbuffersEXT\0" + "\0" + /* _mesa_function_pool[15336]: VertexAttrib2dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib2dv\0" + "glVertexAttrib2dvARB\0" + "\0" + /* _mesa_function_pool[15379]: EdgeFlagPointerEXT (will be remapped) */ + "iip\0" + "glEdgeFlagPointerEXT\0" + "\0" + /* _mesa_function_pool[15405]: VertexAttribs2svNV (will be remapped) */ + "iip\0" + "glVertexAttribs2svNV\0" + "\0" + /* _mesa_function_pool[15431]: WeightbvARB (dynamic) */ + "ip\0" + "glWeightbvARB\0" + "\0" + /* _mesa_function_pool[15449]: VertexAttrib2fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib2fv\0" + "glVertexAttrib2fvARB\0" + "\0" + /* _mesa_function_pool[15492]: GetBufferParameterivARB (will be remapped) */ + "iip\0" + "glGetBufferParameteriv\0" + "glGetBufferParameterivARB\0" + "\0" + /* _mesa_function_pool[15546]: Rectdv (offset 87) */ + "pp\0" + "glRectdv\0" + "\0" + /* _mesa_function_pool[15559]: ListParameteriSGIX (dynamic) */ + "iii\0" + "glListParameteriSGIX\0" + "\0" + /* _mesa_function_pool[15585]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + "iffffffffff\0" + "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[15644]: InstrumentsBufferSGIX (dynamic) */ + "ip\0" + "glInstrumentsBufferSGIX\0" + "\0" + /* _mesa_function_pool[15672]: VertexAttrib4NivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Niv\0" + "glVertexAttrib4NivARB\0" + "\0" + /* _mesa_function_pool[15717]: GetAttachedShaders (will be remapped) */ + "iipp\0" + "glGetAttachedShaders\0" + "\0" + /* _mesa_function_pool[15744]: GenVertexArraysAPPLE (will be remapped) */ + "ip\0" + "glGenVertexArraysAPPLE\0" + "\0" + /* _mesa_function_pool[15771]: Materialiv (offset 172) */ + "iip\0" + "glMaterialiv\0" + "\0" + /* _mesa_function_pool[15789]: PushClientAttrib (offset 335) */ + "i\0" + "glPushClientAttrib\0" + "\0" + /* _mesa_function_pool[15811]: ProgramEnvParameters4fvEXT (will be remapped) */ + "iiip\0" + "glProgramEnvParameters4fvEXT\0" + "\0" + /* _mesa_function_pool[15846]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + "pppp\0" + "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[15892]: WindowPos2iMESA (will be remapped) */ + "ii\0" + "glWindowPos2i\0" + "glWindowPos2iARB\0" + "glWindowPos2iMESA\0" + "\0" + /* _mesa_function_pool[15945]: SecondaryColor3fvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3fv\0" + "glSecondaryColor3fvEXT\0" + "\0" + /* _mesa_function_pool[15991]: PolygonMode (offset 174) */ + "ii\0" + "glPolygonMode\0" + "\0" + /* _mesa_function_pool[16009]: CompressedTexSubImage1DARB (will be remapped) */ + "iiiiiip\0" + "glCompressedTexSubImage1D\0" + "glCompressedTexSubImage1DARB\0" + "\0" + /* _mesa_function_pool[16073]: GetVertexAttribivNV (will be remapped) */ + "iip\0" + "glGetVertexAttribivNV\0" + "\0" + /* _mesa_function_pool[16100]: GetProgramStringARB (will be remapped) */ + "iip\0" + "glGetProgramStringARB\0" + "\0" + /* _mesa_function_pool[16127]: TexBumpParameterfvATI (will be remapped) */ + "ip\0" + "glTexBumpParameterfvATI\0" + "\0" + /* _mesa_function_pool[16155]: CompileShaderARB (will be remapped) */ + "i\0" + "glCompileShader\0" + "glCompileShaderARB\0" + "\0" + /* _mesa_function_pool[16193]: DeleteShader (will be remapped) */ + "i\0" + "glDeleteShader\0" + "\0" + /* _mesa_function_pool[16211]: DisableClientState (offset 309) */ + "i\0" + "glDisableClientState\0" + "\0" + /* _mesa_function_pool[16235]: TexGeni (offset 192) */ + "iii\0" + "glTexGeni\0" + "\0" + /* _mesa_function_pool[16250]: TexGenf (offset 190) */ + "iif\0" + "glTexGenf\0" + "\0" + /* _mesa_function_pool[16265]: Uniform3fARB (will be remapped) */ + "ifff\0" + "glUniform3f\0" + "glUniform3fARB\0" + "\0" + /* _mesa_function_pool[16298]: TexGend (offset 188) */ + "iid\0" + "glTexGend\0" + "\0" + /* _mesa_function_pool[16313]: ListParameterfvSGIX (dynamic) */ + "iip\0" + "glListParameterfvSGIX\0" + "\0" + /* _mesa_function_pool[16340]: GetPolygonStipple (offset 274) */ + "p\0" + "glGetPolygonStipple\0" + "\0" + /* _mesa_function_pool[16363]: Tangent3dvEXT (dynamic) */ + "p\0" + "glTangent3dvEXT\0" + "\0" + /* _mesa_function_pool[16382]: GetVertexAttribfvNV (will be remapped) */ + "iip\0" + "glGetVertexAttribfvNV\0" + "\0" + /* _mesa_function_pool[16409]: WindowPos3sMESA (will be remapped) */ + "iii\0" + "glWindowPos3s\0" + "glWindowPos3sARB\0" + "glWindowPos3sMESA\0" + "\0" + /* _mesa_function_pool[16463]: VertexAttrib2svNV (will be remapped) */ + "ip\0" + "glVertexAttrib2svNV\0" + "\0" + /* _mesa_function_pool[16487]: VertexAttribs1fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs1fvNV\0" + "\0" + /* _mesa_function_pool[16513]: TexCoord2fVertex3fvSUN (dynamic) */ + "pp\0" + "glTexCoord2fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[16542]: WindowPos4sMESA (will be remapped) */ + "iiii\0" + "glWindowPos4sMESA\0" + "\0" + /* _mesa_function_pool[16566]: VertexAttrib4NuivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nuiv\0" + "glVertexAttrib4NuivARB\0" + "\0" + /* _mesa_function_pool[16613]: ClientActiveTextureARB (offset 375) */ + "i\0" + "glClientActiveTexture\0" + "glClientActiveTextureARB\0" + "\0" + /* _mesa_function_pool[16663]: PixelTexGenSGIX (will be remapped) */ + "i\0" + "glPixelTexGenSGIX\0" + "\0" + /* _mesa_function_pool[16684]: ReplacementCodeusvSUN (dynamic) */ + "p\0" + "glReplacementCodeusvSUN\0" + "\0" + /* _mesa_function_pool[16711]: Uniform4fARB (will be remapped) */ + "iffff\0" + "glUniform4f\0" + "glUniform4fARB\0" + "\0" + /* _mesa_function_pool[16745]: Color4sv (offset 34) */ + "p\0" + "glColor4sv\0" + "\0" + /* _mesa_function_pool[16759]: FlushMappedBufferRange (will be remapped) */ + "iii\0" + "glFlushMappedBufferRange\0" + "\0" + /* _mesa_function_pool[16789]: IsProgramNV (will be remapped) */ + "i\0" + "glIsProgramARB\0" + "glIsProgramNV\0" + "\0" + /* _mesa_function_pool[16821]: FlushMappedBufferRangeAPPLE (will be remapped) */ + "iii\0" + "glFlushMappedBufferRangeAPPLE\0" + "\0" + /* _mesa_function_pool[16856]: PixelZoom (offset 246) */ + "ff\0" + "glPixelZoom\0" + "\0" + /* _mesa_function_pool[16872]: ReplacementCodePointerSUN (dynamic) */ + "iip\0" + "glReplacementCodePointerSUN\0" + "\0" + /* _mesa_function_pool[16905]: ProgramEnvParameter4dARB (will be remapped) */ + "iidddd\0" + "glProgramEnvParameter4dARB\0" + "glProgramParameter4dNV\0" + "\0" + /* _mesa_function_pool[16963]: ColorTableParameterfv (offset 340) */ + "iip\0" + "glColorTableParameterfv\0" + "glColorTableParameterfvSGI\0" + "\0" + /* _mesa_function_pool[17019]: FragmentLightModelfSGIX (dynamic) */ + "if\0" + "glFragmentLightModelfSGIX\0" + "\0" + /* _mesa_function_pool[17049]: Binormal3bvEXT (dynamic) */ + "p\0" + "glBinormal3bvEXT\0" + "\0" + /* _mesa_function_pool[17069]: PixelMapuiv (offset 252) */ + "iip\0" + "glPixelMapuiv\0" + "\0" + /* _mesa_function_pool[17088]: Color3dv (offset 12) */ + "p\0" + "glColor3dv\0" + "\0" + /* _mesa_function_pool[17102]: IsTexture (offset 330) */ + "i\0" + "glIsTexture\0" + "glIsTextureEXT\0" + "\0" + /* _mesa_function_pool[17132]: VertexWeightfvEXT (dynamic) */ + "p\0" + "glVertexWeightfvEXT\0" + "\0" + /* _mesa_function_pool[17155]: VertexAttrib1dARB (will be remapped) */ + "id\0" + "glVertexAttrib1d\0" + "glVertexAttrib1dARB\0" + "\0" + /* _mesa_function_pool[17196]: ImageTransformParameterivHP (dynamic) */ + "iip\0" + "glImageTransformParameterivHP\0" + "\0" + /* _mesa_function_pool[17231]: TexCoord4i (offset 122) */ + "iiii\0" + "glTexCoord4i\0" + "\0" + /* _mesa_function_pool[17250]: DeleteQueriesARB (will be remapped) */ + "ip\0" + "glDeleteQueries\0" + "glDeleteQueriesARB\0" + "\0" + /* _mesa_function_pool[17289]: Color4ubVertex2fSUN (dynamic) */ + "iiiiff\0" + "glColor4ubVertex2fSUN\0" + "\0" + /* _mesa_function_pool[17319]: FragmentColorMaterialSGIX (dynamic) */ + "ii\0" + "glFragmentColorMaterialSGIX\0" + "\0" + /* _mesa_function_pool[17351]: CurrentPaletteMatrixARB (dynamic) */ + "i\0" + "glCurrentPaletteMatrixARB\0" + "\0" + /* _mesa_function_pool[17380]: GetMapdv (offset 266) */ + "iip\0" + "glGetMapdv\0" + "\0" + /* _mesa_function_pool[17396]: SamplePatternSGIS (will be remapped) */ + "i\0" + "glSamplePatternSGIS\0" + "glSamplePatternEXT\0" + "\0" + /* _mesa_function_pool[17438]: PixelStoref (offset 249) */ + "if\0" + "glPixelStoref\0" + "\0" + /* _mesa_function_pool[17456]: IsQueryARB (will be remapped) */ + "i\0" + "glIsQuery\0" + "glIsQueryARB\0" + "\0" + /* _mesa_function_pool[17482]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + "iiiiifff\0" + "glReplacementCodeuiColor4ubVertex3fSUN\0" + "\0" + /* _mesa_function_pool[17531]: PixelStorei (offset 250) */ + "ii\0" + "glPixelStorei\0" + "\0" + /* _mesa_function_pool[17549]: VertexAttrib4usvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4usv\0" + "glVertexAttrib4usvARB\0" + "\0" + /* _mesa_function_pool[17594]: LinkProgramARB (will be remapped) */ + "i\0" + "glLinkProgram\0" + "glLinkProgramARB\0" + "\0" + /* _mesa_function_pool[17628]: VertexAttrib2fNV (will be remapped) */ + "iff\0" + "glVertexAttrib2fNV\0" + "\0" + /* _mesa_function_pool[17652]: ShaderSourceARB (will be remapped) */ + "iipp\0" + "glShaderSource\0" + "glShaderSourceARB\0" + "\0" + /* _mesa_function_pool[17691]: FragmentMaterialiSGIX (dynamic) */ + "iii\0" + "glFragmentMaterialiSGIX\0" + "\0" + /* _mesa_function_pool[17720]: EvalCoord2dv (offset 233) */ + "p\0" + "glEvalCoord2dv\0" + "\0" + /* _mesa_function_pool[17738]: VertexAttrib3svARB (will be remapped) */ + "ip\0" + "glVertexAttrib3sv\0" + "glVertexAttrib3svARB\0" + "\0" + /* _mesa_function_pool[17781]: ColorMaterial (offset 151) */ + "ii\0" + "glColorMaterial\0" + "\0" + /* _mesa_function_pool[17801]: CompressedTexSubImage3DARB (will be remapped) */ + "iiiiiiiiiip\0" + "glCompressedTexSubImage3D\0" + "glCompressedTexSubImage3DARB\0" + "\0" + /* _mesa_function_pool[17869]: WindowPos2ivMESA (will be remapped) */ + "p\0" + "glWindowPos2iv\0" + "glWindowPos2ivARB\0" + "glWindowPos2ivMESA\0" + "\0" + /* _mesa_function_pool[17924]: IsFramebufferEXT (will be remapped) */ + "i\0" + "glIsFramebuffer\0" + "glIsFramebufferEXT\0" + "\0" + /* _mesa_function_pool[17962]: Uniform4ivARB (will be remapped) */ + "iip\0" + "glUniform4iv\0" + "glUniform4ivARB\0" + "\0" + /* _mesa_function_pool[17996]: GetVertexAttribdvARB (will be remapped) */ + "iip\0" + "glGetVertexAttribdv\0" + "glGetVertexAttribdvARB\0" + "\0" + /* _mesa_function_pool[18044]: TexBumpParameterivATI (will be remapped) */ + "ip\0" + "glTexBumpParameterivATI\0" + "\0" + /* _mesa_function_pool[18072]: GetSeparableFilter (offset 359) */ + "iiippp\0" + "glGetSeparableFilter\0" + "glGetSeparableFilterEXT\0" + "\0" + /* _mesa_function_pool[18125]: Binormal3dEXT (dynamic) */ + "ddd\0" + "glBinormal3dEXT\0" + "\0" + /* _mesa_function_pool[18146]: SpriteParameteriSGIX (dynamic) */ + "ii\0" + "glSpriteParameteriSGIX\0" + "\0" + /* _mesa_function_pool[18173]: RequestResidentProgramsNV (will be remapped) */ + "ip\0" + "glRequestResidentProgramsNV\0" + "\0" + /* _mesa_function_pool[18205]: TagSampleBufferSGIX (dynamic) */ + "\0" + "glTagSampleBufferSGIX\0" + "\0" + /* _mesa_function_pool[18229]: ReplacementCodeusSUN (dynamic) */ + "i\0" + "glReplacementCodeusSUN\0" + "\0" + /* _mesa_function_pool[18255]: FeedbackBuffer (offset 194) */ + "iip\0" + "glFeedbackBuffer\0" + "\0" + /* _mesa_function_pool[18277]: RasterPos2iv (offset 67) */ + "p\0" + "glRasterPos2iv\0" + "\0" + /* _mesa_function_pool[18295]: TexImage1D (offset 182) */ + "iiiiiiip\0" + "glTexImage1D\0" + "\0" + /* _mesa_function_pool[18318]: ListParameterivSGIX (dynamic) */ + "iip\0" + "glListParameterivSGIX\0" + "\0" + /* _mesa_function_pool[18345]: MultiDrawElementsEXT (will be remapped) */ + "ipipi\0" + "glMultiDrawElements\0" + "glMultiDrawElementsEXT\0" + "\0" + /* _mesa_function_pool[18395]: Color3s (offset 17) */ + "iii\0" + "glColor3s\0" + "\0" + /* _mesa_function_pool[18410]: Uniform1ivARB (will be remapped) */ + "iip\0" + "glUniform1iv\0" + "glUniform1ivARB\0" + "\0" + /* _mesa_function_pool[18444]: WindowPos2sMESA (will be remapped) */ + "ii\0" + "glWindowPos2s\0" + "glWindowPos2sARB\0" + "glWindowPos2sMESA\0" + "\0" + /* _mesa_function_pool[18497]: WeightusvARB (dynamic) */ + "ip\0" + "glWeightusvARB\0" + "\0" + /* _mesa_function_pool[18516]: TexCoordPointer (offset 320) */ + "iiip\0" + "glTexCoordPointer\0" + "\0" + /* _mesa_function_pool[18540]: FogCoordPointerEXT (will be remapped) */ + "iip\0" + "glFogCoordPointer\0" + "glFogCoordPointerEXT\0" + "\0" + /* _mesa_function_pool[18584]: IndexMaterialEXT (dynamic) */ + "ii\0" + "glIndexMaterialEXT\0" + "\0" + /* _mesa_function_pool[18607]: Color3i (offset 15) */ + "iii\0" + "glColor3i\0" + "\0" + /* _mesa_function_pool[18622]: FrontFace (offset 157) */ + "i\0" + "glFrontFace\0" + "\0" + /* _mesa_function_pool[18637]: EvalCoord2d (offset 232) */ + "dd\0" + "glEvalCoord2d\0" + "\0" + /* _mesa_function_pool[18655]: SecondaryColor3ubvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3ubv\0" + "glSecondaryColor3ubvEXT\0" + "\0" + /* _mesa_function_pool[18703]: EvalCoord2f (offset 234) */ + "ff\0" + "glEvalCoord2f\0" + "\0" + /* _mesa_function_pool[18721]: VertexAttrib4dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4dv\0" + "glVertexAttrib4dvARB\0" + "\0" + /* _mesa_function_pool[18764]: BindAttribLocationARB (will be remapped) */ + "iip\0" + "glBindAttribLocation\0" + "glBindAttribLocationARB\0" + "\0" + /* _mesa_function_pool[18814]: Color3b (offset 9) */ + "iii\0" + "glColor3b\0" + "\0" + /* _mesa_function_pool[18829]: MultiTexCoord2dARB (offset 384) */ + "idd\0" + "glMultiTexCoord2d\0" + "glMultiTexCoord2dARB\0" + "\0" + /* _mesa_function_pool[18873]: ExecuteProgramNV (will be remapped) */ + "iip\0" + "glExecuteProgramNV\0" + "\0" + /* _mesa_function_pool[18897]: Color3f (offset 13) */ + "fff\0" + "glColor3f\0" + "\0" + /* _mesa_function_pool[18912]: LightEnviSGIX (dynamic) */ + "ii\0" + "glLightEnviSGIX\0" + "\0" + /* _mesa_function_pool[18932]: Color3d (offset 11) */ + "ddd\0" + "glColor3d\0" + "\0" + /* _mesa_function_pool[18947]: Normal3dv (offset 55) */ + "p\0" + "glNormal3dv\0" + "\0" + /* _mesa_function_pool[18962]: Lightf (offset 159) */ + "iif\0" + "glLightf\0" + "\0" + /* _mesa_function_pool[18976]: ReplacementCodeuiSUN (dynamic) */ + "i\0" + "glReplacementCodeuiSUN\0" + "\0" + /* _mesa_function_pool[19002]: MatrixMode (offset 293) */ + "i\0" + "glMatrixMode\0" + "\0" + /* _mesa_function_pool[19018]: GetPixelMapusv (offset 273) */ + "ip\0" + "glGetPixelMapusv\0" + "\0" + /* _mesa_function_pool[19039]: Lighti (offset 161) */ + "iii\0" + "glLighti\0" + "\0" + /* _mesa_function_pool[19053]: VertexAttribPointerNV (will be remapped) */ + "iiiip\0" + "glVertexAttribPointerNV\0" + "\0" + /* _mesa_function_pool[19084]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + "iiip\0" + "glGetFramebufferAttachmentParameteriv\0" + "glGetFramebufferAttachmentParameterivEXT\0" + "\0" + /* _mesa_function_pool[19169]: PixelTransformParameterfEXT (dynamic) */ + "iif\0" + "glPixelTransformParameterfEXT\0" + "\0" + /* _mesa_function_pool[19204]: MultiTexCoord4dvARB (offset 401) */ + "ip\0" + "glMultiTexCoord4dv\0" + "glMultiTexCoord4dvARB\0" + "\0" + /* _mesa_function_pool[19249]: PixelTransformParameteriEXT (dynamic) */ + "iii\0" + "glPixelTransformParameteriEXT\0" + "\0" + /* _mesa_function_pool[19284]: GetDoublev (offset 260) */ + "ip\0" + "glGetDoublev\0" + "\0" + /* _mesa_function_pool[19301]: MultMatrixd (offset 295) */ + "p\0" + "glMultMatrixd\0" + "\0" + /* _mesa_function_pool[19318]: MultMatrixf (offset 294) */ + "p\0" + "glMultMatrixf\0" + "\0" + /* _mesa_function_pool[19335]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + "ffiiiifff\0" + "glTexCoord2fColor4ubVertex3fSUN\0" + "\0" + /* _mesa_function_pool[19378]: Uniform1iARB (will be remapped) */ + "ii\0" + "glUniform1i\0" + "glUniform1iARB\0" + "\0" + /* _mesa_function_pool[19409]: VertexAttribPointerARB (will be remapped) */ + "iiiiip\0" + "glVertexAttribPointer\0" + "glVertexAttribPointerARB\0" + "\0" + /* _mesa_function_pool[19464]: SharpenTexFuncSGIS (dynamic) */ + "iip\0" + "glSharpenTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[19490]: MultiTexCoord4fvARB (offset 403) */ + "ip\0" + "glMultiTexCoord4fv\0" + "glMultiTexCoord4fvARB\0" + "\0" + /* _mesa_function_pool[19535]: UniformMatrix2x3fv (will be remapped) */ + "iiip\0" + "glUniformMatrix2x3fv\0" + "\0" + /* _mesa_function_pool[19562]: TrackMatrixNV (will be remapped) */ + "iiii\0" + "glTrackMatrixNV\0" + "\0" + /* _mesa_function_pool[19584]: CombinerParameteriNV (will be remapped) */ + "ii\0" + "glCombinerParameteriNV\0" + "\0" + /* _mesa_function_pool[19611]: DeleteAsyncMarkersSGIX (dynamic) */ + "ii\0" + "glDeleteAsyncMarkersSGIX\0" + "\0" + /* _mesa_function_pool[19640]: IsAsyncMarkerSGIX (dynamic) */ + "i\0" + "glIsAsyncMarkerSGIX\0" + "\0" + /* _mesa_function_pool[19663]: FrameZoomSGIX (dynamic) */ + "i\0" + "glFrameZoomSGIX\0" + "\0" + /* _mesa_function_pool[19682]: Normal3fVertex3fvSUN (dynamic) */ + "pp\0" + "glNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[19709]: RasterPos4sv (offset 85) */ + "p\0" + "glRasterPos4sv\0" + "\0" + /* _mesa_function_pool[19727]: VertexAttrib4NsvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nsv\0" + "glVertexAttrib4NsvARB\0" + "\0" + /* _mesa_function_pool[19772]: VertexAttrib3fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib3fv\0" + "glVertexAttrib3fvARB\0" + "\0" + /* _mesa_function_pool[19815]: ClearColor (offset 206) */ + "ffff\0" + "glClearColor\0" + "\0" + /* _mesa_function_pool[19834]: GetSynciv (will be remapped) */ + "iiipp\0" + "glGetSynciv\0" + "\0" + /* _mesa_function_pool[19853]: DeleteFramebuffersEXT (will be remapped) */ + "ip\0" + "glDeleteFramebuffers\0" + "glDeleteFramebuffersEXT\0" + "\0" + /* _mesa_function_pool[19902]: GlobalAlphaFactorsSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorsSUN\0" + "\0" + /* _mesa_function_pool[19929]: TexEnviv (offset 187) */ + "iip\0" + "glTexEnviv\0" + "\0" + /* _mesa_function_pool[19945]: TexSubImage3D (offset 372) */ + "iiiiiiiiiip\0" + "glTexSubImage3D\0" + "glTexSubImage3DEXT\0" + "\0" + /* _mesa_function_pool[19993]: Tangent3fEXT (dynamic) */ + "fff\0" + "glTangent3fEXT\0" + "\0" + /* _mesa_function_pool[20013]: SecondaryColor3uivEXT (will be remapped) */ + "p\0" + "glSecondaryColor3uiv\0" + "glSecondaryColor3uivEXT\0" + "\0" + /* _mesa_function_pool[20061]: MatrixIndexubvARB (dynamic) */ + "ip\0" + "glMatrixIndexubvARB\0" + "\0" + /* _mesa_function_pool[20085]: Color4fNormal3fVertex3fSUN (dynamic) */ + "ffffffffff\0" + "glColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[20126]: PixelTexGenParameterfSGIS (will be remapped) */ + "if\0" + "glPixelTexGenParameterfSGIS\0" + "\0" + /* _mesa_function_pool[20158]: CreateShader (will be remapped) */ + "i\0" + "glCreateShader\0" + "\0" + /* _mesa_function_pool[20176]: GetColorTableParameterfv (offset 344) */ + "iip\0" + "glGetColorTableParameterfv\0" + "glGetColorTableParameterfvSGI\0" + "glGetColorTableParameterfvEXT\0" + "\0" + /* _mesa_function_pool[20268]: FragmentLightModelfvSGIX (dynamic) */ + "ip\0" + "glFragmentLightModelfvSGIX\0" + "\0" + /* _mesa_function_pool[20299]: Bitmap (offset 8) */ + "iiffffp\0" + "glBitmap\0" + "\0" + /* _mesa_function_pool[20317]: MultiTexCoord3fARB (offset 394) */ + "ifff\0" + "glMultiTexCoord3f\0" + "glMultiTexCoord3fARB\0" + "\0" + /* _mesa_function_pool[20362]: GetTexLevelParameterfv (offset 284) */ + "iiip\0" + "glGetTexLevelParameterfv\0" + "\0" + /* _mesa_function_pool[20393]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + "ip\0" + "glGetPixelTexGenParameterfvSGIS\0" + "\0" + /* _mesa_function_pool[20429]: GenFramebuffersEXT (will be remapped) */ + "ip\0" + "glGenFramebuffers\0" + "glGenFramebuffersEXT\0" + "\0" + /* _mesa_function_pool[20472]: GetProgramParameterdvNV (will be remapped) */ + "iiip\0" + "glGetProgramParameterdvNV\0" + "\0" + /* _mesa_function_pool[20504]: Vertex2sv (offset 133) */ + "p\0" + "glVertex2sv\0" + "\0" + /* _mesa_function_pool[20519]: GetIntegerv (offset 263) */ + "ip\0" + "glGetIntegerv\0" + "\0" + /* _mesa_function_pool[20537]: IsVertexArrayAPPLE (will be remapped) */ + "i\0" + "glIsVertexArray\0" + "glIsVertexArrayAPPLE\0" + "\0" + /* _mesa_function_pool[20577]: FragmentLightfvSGIX (dynamic) */ + "iip\0" + "glFragmentLightfvSGIX\0" + "\0" + /* _mesa_function_pool[20604]: DetachShader (will be remapped) */ + "ii\0" + "glDetachShader\0" + "\0" + /* _mesa_function_pool[20623]: VertexAttrib4NubARB (will be remapped) */ + "iiiii\0" + "glVertexAttrib4Nub\0" + "glVertexAttrib4NubARB\0" + "\0" + /* _mesa_function_pool[20671]: GetProgramEnvParameterfvARB (will be remapped) */ + "iip\0" + "glGetProgramEnvParameterfvARB\0" + "\0" + /* _mesa_function_pool[20706]: GetTrackMatrixivNV (will be remapped) */ + "iiip\0" + "glGetTrackMatrixivNV\0" + "\0" + /* _mesa_function_pool[20733]: VertexAttrib3svNV (will be remapped) */ + "ip\0" + "glVertexAttrib3svNV\0" + "\0" + /* _mesa_function_pool[20757]: Uniform4fvARB (will be remapped) */ + "iip\0" + "glUniform4fv\0" + "glUniform4fvARB\0" + "\0" + /* _mesa_function_pool[20791]: MultTransposeMatrixfARB (will be remapped) */ + "p\0" + "glMultTransposeMatrixf\0" + "glMultTransposeMatrixfARB\0" + "\0" + /* _mesa_function_pool[20843]: GetTexEnviv (offset 277) */ + "iip\0" + "glGetTexEnviv\0" + "\0" + /* _mesa_function_pool[20862]: ColorFragmentOp1ATI (will be remapped) */ + "iiiiiii\0" + "glColorFragmentOp1ATI\0" + "\0" + /* _mesa_function_pool[20893]: GetUniformfvARB (will be remapped) */ + "iip\0" + "glGetUniformfv\0" + "glGetUniformfvARB\0" + "\0" + /* _mesa_function_pool[20931]: PopClientAttrib (offset 334) */ + "\0" + "glPopClientAttrib\0" + "\0" + /* _mesa_function_pool[20951]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + "iffffffffffff\0" + "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[21022]: DetachObjectARB (will be remapped) */ + "ii\0" + "glDetachObjectARB\0" + "\0" + /* _mesa_function_pool[21044]: VertexBlendARB (dynamic) */ + "i\0" + "glVertexBlendARB\0" + "\0" + /* _mesa_function_pool[21064]: WindowPos3iMESA (will be remapped) */ + "iii\0" + "glWindowPos3i\0" + "glWindowPos3iARB\0" + "glWindowPos3iMESA\0" + "\0" + /* _mesa_function_pool[21118]: SeparableFilter2D (offset 360) */ + "iiiiiipp\0" + "glSeparableFilter2D\0" + "glSeparableFilter2DEXT\0" + "\0" + /* _mesa_function_pool[21171]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiColor4ubVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[21216]: Map1d (offset 220) */ + "iddiip\0" + "glMap1d\0" + "\0" + /* _mesa_function_pool[21232]: Map1f (offset 221) */ + "iffiip\0" + "glMap1f\0" + "\0" + /* _mesa_function_pool[21248]: CompressedTexImage2DARB (will be remapped) */ + "iiiiiiip\0" + "glCompressedTexImage2D\0" + "glCompressedTexImage2DARB\0" + "\0" + /* _mesa_function_pool[21307]: ArrayElement (offset 306) */ + "i\0" + "glArrayElement\0" + "glArrayElementEXT\0" + "\0" + /* _mesa_function_pool[21343]: TexImage2D (offset 183) */ + "iiiiiiiip\0" + "glTexImage2D\0" + "\0" + /* _mesa_function_pool[21367]: DepthBoundsEXT (will be remapped) */ + "dd\0" + "glDepthBoundsEXT\0" + "\0" + /* _mesa_function_pool[21388]: ProgramParameters4fvNV (will be remapped) */ + "iiip\0" + "glProgramParameters4fvNV\0" + "\0" + /* _mesa_function_pool[21419]: DeformationMap3fSGIX (dynamic) */ + "iffiiffiiffiip\0" + "glDeformationMap3fSGIX\0" + "\0" + /* _mesa_function_pool[21458]: GetProgramivNV (will be remapped) */ + "iip\0" + "glGetProgramivNV\0" + "\0" + /* _mesa_function_pool[21480]: GetMinmaxParameteriv (offset 366) */ + "iip\0" + "glGetMinmaxParameteriv\0" + "glGetMinmaxParameterivEXT\0" + "\0" + /* _mesa_function_pool[21534]: PixelTransferf (offset 247) */ + "if\0" + "glPixelTransferf\0" + "\0" + /* _mesa_function_pool[21555]: CopyTexImage1D (offset 323) */ + "iiiiiii\0" + "glCopyTexImage1D\0" + "glCopyTexImage1DEXT\0" + "\0" + /* _mesa_function_pool[21601]: PushMatrix (offset 298) */ + "\0" + "glPushMatrix\0" + "\0" + /* _mesa_function_pool[21616]: Fogiv (offset 156) */ + "ip\0" + "glFogiv\0" + "\0" + /* _mesa_function_pool[21628]: TexCoord1dv (offset 95) */ + "p\0" + "glTexCoord1dv\0" + "\0" + /* _mesa_function_pool[21645]: AlphaFragmentOp3ATI (will be remapped) */ + "iiiiiiiiiiii\0" + "glAlphaFragmentOp3ATI\0" + "\0" + /* _mesa_function_pool[21681]: PixelTransferi (offset 248) */ + "ii\0" + "glPixelTransferi\0" + "\0" + /* _mesa_function_pool[21702]: GetVertexAttribdvNV (will be remapped) */ + "iip\0" + "glGetVertexAttribdvNV\0" + "\0" + /* _mesa_function_pool[21729]: VertexAttrib3fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib3fvNV\0" + "\0" + /* _mesa_function_pool[21753]: Rotatef (offset 300) */ + "ffff\0" + "glRotatef\0" + "\0" + /* _mesa_function_pool[21769]: GetFinalCombinerInputParameterivNV (will be remapped) */ + "iip\0" + "glGetFinalCombinerInputParameterivNV\0" + "\0" + /* _mesa_function_pool[21811]: Vertex3i (offset 138) */ + "iii\0" + "glVertex3i\0" + "\0" + /* _mesa_function_pool[21827]: Vertex3f (offset 136) */ + "fff\0" + "glVertex3f\0" + "\0" + /* _mesa_function_pool[21843]: Clear (offset 203) */ + "i\0" + "glClear\0" + "\0" + /* _mesa_function_pool[21854]: Vertex3d (offset 134) */ + "ddd\0" + "glVertex3d\0" + "\0" + /* _mesa_function_pool[21870]: GetMapParameterivNV (dynamic) */ + "iip\0" + "glGetMapParameterivNV\0" + "\0" + /* _mesa_function_pool[21897]: Uniform4iARB (will be remapped) */ + "iiiii\0" + "glUniform4i\0" + "glUniform4iARB\0" + "\0" + /* _mesa_function_pool[21931]: ReadBuffer (offset 254) */ + "i\0" + "glReadBuffer\0" + "\0" + /* _mesa_function_pool[21947]: ConvolutionParameteri (offset 352) */ + "iii\0" + "glConvolutionParameteri\0" + "glConvolutionParameteriEXT\0" + "\0" + /* _mesa_function_pool[22003]: Ortho (offset 296) */ + "dddddd\0" + "glOrtho\0" + "\0" + /* _mesa_function_pool[22019]: Binormal3sEXT (dynamic) */ + "iii\0" + "glBinormal3sEXT\0" + "\0" + /* _mesa_function_pool[22040]: ListBase (offset 6) */ + "i\0" + "glListBase\0" + "\0" + /* _mesa_function_pool[22054]: Vertex3s (offset 140) */ + "iii\0" + "glVertex3s\0" + "\0" + /* _mesa_function_pool[22070]: ConvolutionParameterf (offset 350) */ + "iif\0" + "glConvolutionParameterf\0" + "glConvolutionParameterfEXT\0" + "\0" + /* _mesa_function_pool[22126]: GetColorTableParameteriv (offset 345) */ + "iip\0" + "glGetColorTableParameteriv\0" + "glGetColorTableParameterivSGI\0" + "glGetColorTableParameterivEXT\0" + "\0" + /* _mesa_function_pool[22218]: ProgramEnvParameter4dvARB (will be remapped) */ + "iip\0" + "glProgramEnvParameter4dvARB\0" + "glProgramParameter4dvNV\0" + "\0" + /* _mesa_function_pool[22275]: ShadeModel (offset 177) */ + "i\0" + "glShadeModel\0" + "\0" + /* _mesa_function_pool[22291]: VertexAttribs2fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs2fvNV\0" + "\0" + /* _mesa_function_pool[22317]: Rectiv (offset 91) */ + "pp\0" + "glRectiv\0" + "\0" + /* _mesa_function_pool[22330]: UseProgramObjectARB (will be remapped) */ + "i\0" + "glUseProgram\0" + "glUseProgramObjectARB\0" + "\0" + /* _mesa_function_pool[22368]: GetMapParameterfvNV (dynamic) */ + "iip\0" + "glGetMapParameterfvNV\0" + "\0" + /* _mesa_function_pool[22395]: PassTexCoordATI (will be remapped) */ + "iii\0" + "glPassTexCoordATI\0" + "\0" + /* _mesa_function_pool[22418]: DeleteProgram (will be remapped) */ + "i\0" + "glDeleteProgram\0" + "\0" + /* _mesa_function_pool[22437]: Tangent3ivEXT (dynamic) */ + "p\0" + "glTangent3ivEXT\0" + "\0" + /* _mesa_function_pool[22456]: Tangent3dEXT (dynamic) */ + "ddd\0" + "glTangent3dEXT\0" + "\0" + /* _mesa_function_pool[22476]: SecondaryColor3dvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3dv\0" + "glSecondaryColor3dvEXT\0" + "\0" + /* _mesa_function_pool[22522]: Vertex2fv (offset 129) */ + "p\0" + "glVertex2fv\0" + "\0" + /* _mesa_function_pool[22537]: MultiDrawArraysEXT (will be remapped) */ + "ippi\0" + "glMultiDrawArrays\0" + "glMultiDrawArraysEXT\0" + "\0" + /* _mesa_function_pool[22582]: BindRenderbufferEXT (will be remapped) */ + "ii\0" + "glBindRenderbuffer\0" + "glBindRenderbufferEXT\0" + "\0" + /* _mesa_function_pool[22627]: MultiTexCoord4dARB (offset 400) */ + "idddd\0" + "glMultiTexCoord4d\0" + "glMultiTexCoord4dARB\0" + "\0" + /* _mesa_function_pool[22673]: Vertex3sv (offset 141) */ + "p\0" + "glVertex3sv\0" + "\0" + /* _mesa_function_pool[22688]: SecondaryColor3usEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3us\0" + "glSecondaryColor3usEXT\0" + "\0" + /* _mesa_function_pool[22736]: ProgramLocalParameter4fvARB (will be remapped) */ + "iip\0" + "glProgramLocalParameter4fvARB\0" + "\0" + /* _mesa_function_pool[22771]: DeleteProgramsNV (will be remapped) */ + "ip\0" + "glDeleteProgramsARB\0" + "glDeleteProgramsNV\0" + "\0" + /* _mesa_function_pool[22814]: EvalMesh1 (offset 236) */ + "iii\0" + "glEvalMesh1\0" + "\0" + /* _mesa_function_pool[22831]: MultiTexCoord1sARB (offset 382) */ + "ii\0" + "glMultiTexCoord1s\0" + "glMultiTexCoord1sARB\0" + "\0" + /* _mesa_function_pool[22874]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + "iffffff\0" + "glReplacementCodeuiColor3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[22921]: GetVertexAttribPointervNV (will be remapped) */ + "iip\0" + "glGetVertexAttribPointerv\0" + "glGetVertexAttribPointervARB\0" + "glGetVertexAttribPointervNV\0" + "\0" + /* _mesa_function_pool[23009]: MultiTexCoord1dvARB (offset 377) */ + "ip\0" + "glMultiTexCoord1dv\0" + "glMultiTexCoord1dvARB\0" + "\0" + /* _mesa_function_pool[23054]: Uniform2iARB (will be remapped) */ + "iii\0" + "glUniform2i\0" + "glUniform2iARB\0" + "\0" + /* _mesa_function_pool[23086]: Vertex2iv (offset 131) */ + "p\0" + "glVertex2iv\0" + "\0" + /* _mesa_function_pool[23101]: GetProgramStringNV (will be remapped) */ + "iip\0" + "glGetProgramStringNV\0" + "\0" + /* _mesa_function_pool[23127]: ColorPointerEXT (will be remapped) */ + "iiiip\0" + "glColorPointerEXT\0" + "\0" + /* _mesa_function_pool[23152]: LineWidth (offset 168) */ + "f\0" + "glLineWidth\0" + "\0" + /* _mesa_function_pool[23167]: MapBufferARB (will be remapped) */ + "ii\0" + "glMapBuffer\0" + "glMapBufferARB\0" + "\0" + /* _mesa_function_pool[23198]: MultiDrawElementsBaseVertex (will be remapped) */ + "ipipip\0" + "glMultiDrawElementsBaseVertex\0" + "\0" + /* _mesa_function_pool[23236]: Binormal3svEXT (dynamic) */ + "p\0" + "glBinormal3svEXT\0" + "\0" + /* _mesa_function_pool[23256]: ApplyTextureEXT (dynamic) */ + "i\0" + "glApplyTextureEXT\0" + "\0" + /* _mesa_function_pool[23277]: TexGendv (offset 189) */ + "iip\0" + "glTexGendv\0" + "\0" + /* _mesa_function_pool[23293]: TextureMaterialEXT (dynamic) */ + "ii\0" + "glTextureMaterialEXT\0" + "\0" + /* _mesa_function_pool[23318]: TextureLightEXT (dynamic) */ + "i\0" + "glTextureLightEXT\0" + "\0" + /* _mesa_function_pool[23339]: ResetMinmax (offset 370) */ + "i\0" + "glResetMinmax\0" + "glResetMinmaxEXT\0" + "\0" + /* _mesa_function_pool[23373]: SpriteParameterfSGIX (dynamic) */ + "if\0" + "glSpriteParameterfSGIX\0" + "\0" + /* _mesa_function_pool[23400]: EnableClientState (offset 313) */ + "i\0" + "glEnableClientState\0" + "\0" + /* _mesa_function_pool[23423]: VertexAttrib4sNV (will be remapped) */ + "iiiii\0" + "glVertexAttrib4sNV\0" + "\0" + /* _mesa_function_pool[23449]: GetConvolutionParameterfv (offset 357) */ + "iip\0" + "glGetConvolutionParameterfv\0" + "glGetConvolutionParameterfvEXT\0" + "\0" + /* _mesa_function_pool[23513]: VertexAttribs4dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs4dvNV\0" + "\0" + /* _mesa_function_pool[23539]: MultiModeDrawArraysIBM (will be remapped) */ + "pppii\0" + "glMultiModeDrawArraysIBM\0" + "\0" + /* _mesa_function_pool[23571]: VertexAttrib4dARB (will be remapped) */ + "idddd\0" + "glVertexAttrib4d\0" + "glVertexAttrib4dARB\0" + "\0" + /* _mesa_function_pool[23615]: GetTexBumpParameterfvATI (will be remapped) */ + "ip\0" + "glGetTexBumpParameterfvATI\0" + "\0" + /* _mesa_function_pool[23646]: ProgramNamedParameter4dNV (will be remapped) */ + "iipdddd\0" + "glProgramNamedParameter4dNV\0" + "\0" + /* _mesa_function_pool[23683]: GetMaterialfv (offset 269) */ + "iip\0" + "glGetMaterialfv\0" + "\0" + /* _mesa_function_pool[23704]: VertexWeightfEXT (dynamic) */ + "f\0" + "glVertexWeightfEXT\0" + "\0" + /* _mesa_function_pool[23726]: Binormal3fEXT (dynamic) */ + "fff\0" + "glBinormal3fEXT\0" + "\0" + /* _mesa_function_pool[23747]: CallList (offset 2) */ + "i\0" + "glCallList\0" + "\0" + /* _mesa_function_pool[23761]: Materialfv (offset 170) */ + "iip\0" + "glMaterialfv\0" + "\0" + /* _mesa_function_pool[23779]: TexCoord3fv (offset 113) */ + "p\0" + "glTexCoord3fv\0" + "\0" + /* _mesa_function_pool[23796]: FogCoordfvEXT (will be remapped) */ + "p\0" + "glFogCoordfv\0" + "glFogCoordfvEXT\0" + "\0" + /* _mesa_function_pool[23828]: MultiTexCoord1ivARB (offset 381) */ + "ip\0" + "glMultiTexCoord1iv\0" + "glMultiTexCoord1ivARB\0" + "\0" + /* _mesa_function_pool[23873]: SecondaryColor3ubEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3ub\0" + "glSecondaryColor3ubEXT\0" + "\0" + /* _mesa_function_pool[23921]: MultiTexCoord2ivARB (offset 389) */ + "ip\0" + "glMultiTexCoord2iv\0" + "glMultiTexCoord2ivARB\0" + "\0" + /* _mesa_function_pool[23966]: FogFuncSGIS (dynamic) */ + "ip\0" + "glFogFuncSGIS\0" + "\0" + /* _mesa_function_pool[23984]: CopyTexSubImage2D (offset 326) */ + "iiiiiiii\0" + "glCopyTexSubImage2D\0" + "glCopyTexSubImage2DEXT\0" + "\0" + /* _mesa_function_pool[24037]: GetObjectParameterivARB (will be remapped) */ + "iip\0" + "glGetObjectParameterivARB\0" + "\0" + /* _mesa_function_pool[24068]: Color3iv (offset 16) */ + "p\0" + "glColor3iv\0" + "\0" + /* _mesa_function_pool[24082]: TexCoord4fVertex4fSUN (dynamic) */ + "ffffffff\0" + "glTexCoord4fVertex4fSUN\0" + "\0" + /* _mesa_function_pool[24116]: DrawElements (offset 311) */ + "iiip\0" + "glDrawElements\0" + "\0" + /* _mesa_function_pool[24137]: BindVertexArrayAPPLE (will be remapped) */ + "i\0" + "glBindVertexArrayAPPLE\0" + "\0" + /* _mesa_function_pool[24163]: GetProgramLocalParameterdvARB (will be remapped) */ + "iip\0" + "glGetProgramLocalParameterdvARB\0" + "\0" + /* _mesa_function_pool[24200]: GetHistogramParameteriv (offset 363) */ + "iip\0" + "glGetHistogramParameteriv\0" + "glGetHistogramParameterivEXT\0" + "\0" + /* _mesa_function_pool[24260]: MultiTexCoord1iARB (offset 380) */ + "ii\0" + "glMultiTexCoord1i\0" + "glMultiTexCoord1iARB\0" + "\0" + /* _mesa_function_pool[24303]: GetConvolutionFilter (offset 356) */ + "iiip\0" + "glGetConvolutionFilter\0" + "glGetConvolutionFilterEXT\0" + "\0" + /* _mesa_function_pool[24358]: GetProgramivARB (will be remapped) */ + "iip\0" + "glGetProgramivARB\0" + "\0" + /* _mesa_function_pool[24381]: BlendFuncSeparateEXT (will be remapped) */ + "iiii\0" + "glBlendFuncSeparate\0" + "glBlendFuncSeparateEXT\0" + "glBlendFuncSeparateINGR\0" + "\0" + /* _mesa_function_pool[24454]: MapBufferRange (will be remapped) */ + "iiii\0" + "glMapBufferRange\0" + "\0" + /* _mesa_function_pool[24477]: ProgramParameters4dvNV (will be remapped) */ + "iiip\0" + "glProgramParameters4dvNV\0" + "\0" + /* _mesa_function_pool[24508]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glTexCoord2fColor3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[24545]: EvalPoint2 (offset 239) */ + "ii\0" + "glEvalPoint2\0" + "\0" + /* _mesa_function_pool[24562]: EvalPoint1 (offset 237) */ + "i\0" + "glEvalPoint1\0" + "\0" + /* _mesa_function_pool[24578]: Binormal3dvEXT (dynamic) */ + "p\0" + "glBinormal3dvEXT\0" + "\0" + /* _mesa_function_pool[24598]: PopMatrix (offset 297) */ + "\0" + "glPopMatrix\0" + "\0" + /* _mesa_function_pool[24612]: FinishFenceNV (will be remapped) */ + "i\0" + "glFinishFenceNV\0" + "\0" + /* _mesa_function_pool[24631]: GetFogFuncSGIS (dynamic) */ + "p\0" + "glGetFogFuncSGIS\0" + "\0" + /* _mesa_function_pool[24651]: GetUniformLocationARB (will be remapped) */ + "ip\0" + "glGetUniformLocation\0" + "glGetUniformLocationARB\0" + "\0" + /* _mesa_function_pool[24700]: SecondaryColor3fEXT (will be remapped) */ + "fff\0" + "glSecondaryColor3f\0" + "glSecondaryColor3fEXT\0" + "\0" + /* _mesa_function_pool[24746]: GetTexGeniv (offset 280) */ + "iip\0" + "glGetTexGeniv\0" + "\0" + /* _mesa_function_pool[24765]: CombinerInputNV (will be remapped) */ + "iiiiii\0" + "glCombinerInputNV\0" + "\0" + /* _mesa_function_pool[24791]: VertexAttrib3sARB (will be remapped) */ + "iiii\0" + "glVertexAttrib3s\0" + "glVertexAttrib3sARB\0" + "\0" + /* _mesa_function_pool[24834]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[24879]: Map2d (offset 222) */ + "iddiiddiip\0" + "glMap2d\0" + "\0" + /* _mesa_function_pool[24899]: Map2f (offset 223) */ + "iffiiffiip\0" + "glMap2f\0" + "\0" + /* _mesa_function_pool[24919]: ProgramStringARB (will be remapped) */ + "iiip\0" + "glProgramStringARB\0" + "\0" + /* _mesa_function_pool[24944]: Vertex4s (offset 148) */ + "iiii\0" + "glVertex4s\0" + "\0" + /* _mesa_function_pool[24961]: TexCoord4fVertex4fvSUN (dynamic) */ + "pp\0" + "glTexCoord4fVertex4fvSUN\0" + "\0" + /* _mesa_function_pool[24990]: VertexAttrib3sNV (will be remapped) */ + "iiii\0" + "glVertexAttrib3sNV\0" + "\0" + /* _mesa_function_pool[25015]: VertexAttrib1fNV (will be remapped) */ + "if\0" + "glVertexAttrib1fNV\0" + "\0" + /* _mesa_function_pool[25038]: Vertex4f (offset 144) */ + "ffff\0" + "glVertex4f\0" + "\0" + /* _mesa_function_pool[25055]: EvalCoord1d (offset 228) */ + "d\0" + "glEvalCoord1d\0" + "\0" + /* _mesa_function_pool[25072]: Vertex4d (offset 142) */ + "dddd\0" + "glVertex4d\0" + "\0" + /* _mesa_function_pool[25089]: RasterPos4dv (offset 79) */ + "p\0" + "glRasterPos4dv\0" + "\0" + /* _mesa_function_pool[25107]: FragmentLightfSGIX (dynamic) */ + "iif\0" + "glFragmentLightfSGIX\0" + "\0" + /* _mesa_function_pool[25133]: GetCompressedTexImageARB (will be remapped) */ + "iip\0" + "glGetCompressedTexImage\0" + "glGetCompressedTexImageARB\0" + "\0" + /* _mesa_function_pool[25189]: GetTexGenfv (offset 279) */ + "iip\0" + "glGetTexGenfv\0" + "\0" + /* _mesa_function_pool[25208]: Vertex4i (offset 146) */ + "iiii\0" + "glVertex4i\0" + "\0" + /* _mesa_function_pool[25225]: VertexWeightPointerEXT (dynamic) */ + "iiip\0" + "glVertexWeightPointerEXT\0" + "\0" + /* _mesa_function_pool[25256]: GetHistogram (offset 361) */ + "iiiip\0" + "glGetHistogram\0" + "glGetHistogramEXT\0" + "\0" + /* _mesa_function_pool[25296]: ActiveStencilFaceEXT (will be remapped) */ + "i\0" + "glActiveStencilFaceEXT\0" + "\0" + /* _mesa_function_pool[25322]: StencilFuncSeparateATI (will be remapped) */ + "iiii\0" + "glStencilFuncSeparateATI\0" + "\0" + /* _mesa_function_pool[25353]: Materialf (offset 169) */ + "iif\0" + "glMaterialf\0" + "\0" + /* _mesa_function_pool[25370]: GetShaderSourceARB (will be remapped) */ + "iipp\0" + "glGetShaderSource\0" + "glGetShaderSourceARB\0" + "\0" + /* _mesa_function_pool[25415]: IglooInterfaceSGIX (dynamic) */ + "ip\0" + "glIglooInterfaceSGIX\0" + "\0" + /* _mesa_function_pool[25440]: Materiali (offset 171) */ + "iii\0" + "glMateriali\0" + "\0" + /* _mesa_function_pool[25457]: VertexAttrib4dNV (will be remapped) */ + "idddd\0" + "glVertexAttrib4dNV\0" + "\0" + /* _mesa_function_pool[25483]: MultiModeDrawElementsIBM (will be remapped) */ + "ppipii\0" + "glMultiModeDrawElementsIBM\0" + "\0" + /* _mesa_function_pool[25518]: Indexsv (offset 51) */ + "p\0" + "glIndexsv\0" + "\0" + /* _mesa_function_pool[25531]: MultiTexCoord4svARB (offset 407) */ + "ip\0" + "glMultiTexCoord4sv\0" + "glMultiTexCoord4svARB\0" + "\0" + /* _mesa_function_pool[25576]: LightModelfv (offset 164) */ + "ip\0" + "glLightModelfv\0" + "\0" + /* _mesa_function_pool[25595]: TexCoord2dv (offset 103) */ + "p\0" + "glTexCoord2dv\0" + "\0" + /* _mesa_function_pool[25612]: GenQueriesARB (will be remapped) */ + "ip\0" + "glGenQueries\0" + "glGenQueriesARB\0" + "\0" + /* _mesa_function_pool[25645]: EvalCoord1dv (offset 229) */ + "p\0" + "glEvalCoord1dv\0" + "\0" + /* _mesa_function_pool[25663]: ReplacementCodeuiVertex3fSUN (dynamic) */ + "ifff\0" + "glReplacementCodeuiVertex3fSUN\0" + "\0" + /* _mesa_function_pool[25700]: Translated (offset 303) */ + "ddd\0" + "glTranslated\0" + "\0" + /* _mesa_function_pool[25718]: Translatef (offset 304) */ + "fff\0" + "glTranslatef\0" + "\0" + /* _mesa_function_pool[25736]: StencilMask (offset 209) */ + "i\0" + "glStencilMask\0" + "\0" + /* _mesa_function_pool[25753]: Tangent3iEXT (dynamic) */ + "iii\0" + "glTangent3iEXT\0" + "\0" + /* _mesa_function_pool[25773]: GetLightiv (offset 265) */ + "iip\0" + "glGetLightiv\0" + "\0" + /* _mesa_function_pool[25791]: DrawMeshArraysSUN (dynamic) */ + "iiii\0" + "glDrawMeshArraysSUN\0" + "\0" + /* _mesa_function_pool[25817]: IsList (offset 287) */ + "i\0" + "glIsList\0" + "\0" + /* _mesa_function_pool[25829]: IsSync (will be remapped) */ + "i\0" + "glIsSync\0" + "\0" + /* _mesa_function_pool[25841]: RenderMode (offset 196) */ + "i\0" + "glRenderMode\0" + "\0" + /* _mesa_function_pool[25857]: GetMapControlPointsNV (dynamic) */ + "iiiiiip\0" + "glGetMapControlPointsNV\0" + "\0" + /* _mesa_function_pool[25890]: DrawBuffersARB (will be remapped) */ + "ip\0" + "glDrawBuffers\0" + "glDrawBuffersARB\0" + "glDrawBuffersATI\0" + "\0" + /* _mesa_function_pool[25942]: ProgramLocalParameter4fARB (will be remapped) */ + "iiffff\0" + "glProgramLocalParameter4fARB\0" + "\0" + /* _mesa_function_pool[25979]: SpriteParameterivSGIX (dynamic) */ + "ip\0" + "glSpriteParameterivSGIX\0" + "\0" + /* _mesa_function_pool[26007]: ProvokingVertexEXT (will be remapped) */ + "i\0" + "glProvokingVertexEXT\0" + "glProvokingVertex\0" + "\0" + /* _mesa_function_pool[26049]: MultiTexCoord1fARB (offset 378) */ + "if\0" + "glMultiTexCoord1f\0" + "glMultiTexCoord1fARB\0" + "\0" + /* _mesa_function_pool[26092]: LoadName (offset 198) */ + "i\0" + "glLoadName\0" + "\0" + /* _mesa_function_pool[26106]: VertexAttribs4ubvNV (will be remapped) */ + "iip\0" + "glVertexAttribs4ubvNV\0" + "\0" + /* _mesa_function_pool[26133]: WeightsvARB (dynamic) */ + "ip\0" + "glWeightsvARB\0" + "\0" + /* _mesa_function_pool[26151]: Uniform1fvARB (will be remapped) */ + "iip\0" + "glUniform1fv\0" + "glUniform1fvARB\0" + "\0" + /* _mesa_function_pool[26185]: CopyTexSubImage1D (offset 325) */ + "iiiiii\0" + "glCopyTexSubImage1D\0" + "glCopyTexSubImage1DEXT\0" + "\0" + /* _mesa_function_pool[26236]: CullFace (offset 152) */ + "i\0" + "glCullFace\0" + "\0" + /* _mesa_function_pool[26250]: BindTexture (offset 307) */ + "ii\0" + "glBindTexture\0" + "glBindTextureEXT\0" + "\0" + /* _mesa_function_pool[26285]: BeginFragmentShaderATI (will be remapped) */ + "\0" + "glBeginFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[26312]: MultiTexCoord4fARB (offset 402) */ + "iffff\0" + "glMultiTexCoord4f\0" + "glMultiTexCoord4fARB\0" + "\0" + /* _mesa_function_pool[26358]: VertexAttribs3svNV (will be remapped) */ + "iip\0" + "glVertexAttribs3svNV\0" + "\0" + /* _mesa_function_pool[26384]: StencilFunc (offset 243) */ + "iii\0" + "glStencilFunc\0" + "\0" + /* _mesa_function_pool[26403]: CopyPixels (offset 255) */ + "iiiii\0" + "glCopyPixels\0" + "\0" + /* _mesa_function_pool[26423]: Rectsv (offset 93) */ + "pp\0" + "glRectsv\0" + "\0" + /* _mesa_function_pool[26436]: ReplacementCodeuivSUN (dynamic) */ + "p\0" + "glReplacementCodeuivSUN\0" + "\0" + /* _mesa_function_pool[26463]: EnableVertexAttribArrayARB (will be remapped) */ + "i\0" + "glEnableVertexAttribArray\0" + "glEnableVertexAttribArrayARB\0" + "\0" + /* _mesa_function_pool[26521]: NormalPointervINTEL (dynamic) */ + "ip\0" + "glNormalPointervINTEL\0" + "\0" + /* _mesa_function_pool[26547]: CopyConvolutionFilter2D (offset 355) */ + "iiiiii\0" + "glCopyConvolutionFilter2D\0" + "glCopyConvolutionFilter2DEXT\0" + "\0" + /* _mesa_function_pool[26610]: WindowPos3ivMESA (will be remapped) */ + "p\0" + "glWindowPos3iv\0" + "glWindowPos3ivARB\0" + "glWindowPos3ivMESA\0" + "\0" + /* _mesa_function_pool[26665]: CopyBufferSubData (will be remapped) */ + "iiiii\0" + "glCopyBufferSubData\0" + "\0" + /* _mesa_function_pool[26692]: NormalPointer (offset 318) */ + "iip\0" + "glNormalPointer\0" + "\0" + /* _mesa_function_pool[26713]: TexParameterfv (offset 179) */ + "iip\0" + "glTexParameterfv\0" + "\0" + /* _mesa_function_pool[26735]: IsBufferARB (will be remapped) */ + "i\0" + "glIsBuffer\0" + "glIsBufferARB\0" + "\0" + /* _mesa_function_pool[26763]: WindowPos4iMESA (will be remapped) */ + "iiii\0" + "glWindowPos4iMESA\0" + "\0" + /* _mesa_function_pool[26787]: VertexAttrib4uivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4uiv\0" + "glVertexAttrib4uivARB\0" + "\0" + /* _mesa_function_pool[26832]: Tangent3bvEXT (dynamic) */ + "p\0" + "glTangent3bvEXT\0" + "\0" + /* _mesa_function_pool[26851]: UniformMatrix3x4fv (will be remapped) */ + "iiip\0" + "glUniformMatrix3x4fv\0" + "\0" + /* _mesa_function_pool[26878]: ClipPlane (offset 150) */ + "ip\0" + "glClipPlane\0" + "\0" + /* _mesa_function_pool[26894]: Recti (offset 90) */ + "iiii\0" + "glRecti\0" + "\0" + /* _mesa_function_pool[26908]: DrawRangeElementsBaseVertex (will be remapped) */ + "iiiiipi\0" + "glDrawRangeElementsBaseVertex\0" + "\0" + /* _mesa_function_pool[26947]: TexCoordPointervINTEL (dynamic) */ + "iip\0" + "glTexCoordPointervINTEL\0" + "\0" + /* _mesa_function_pool[26976]: DeleteBuffersARB (will be remapped) */ + "ip\0" + "glDeleteBuffers\0" + "glDeleteBuffersARB\0" + "\0" + /* _mesa_function_pool[27015]: WindowPos4fvMESA (will be remapped) */ + "p\0" + "glWindowPos4fvMESA\0" + "\0" + /* _mesa_function_pool[27037]: GetPixelMapuiv (offset 272) */ + "ip\0" + "glGetPixelMapuiv\0" + "\0" + /* _mesa_function_pool[27058]: Rectf (offset 88) */ + "ffff\0" + "glRectf\0" + "\0" + /* _mesa_function_pool[27072]: VertexAttrib1sNV (will be remapped) */ + "ii\0" + "glVertexAttrib1sNV\0" + "\0" + /* _mesa_function_pool[27095]: Indexfv (offset 47) */ + "p\0" + "glIndexfv\0" + "\0" + /* _mesa_function_pool[27108]: SecondaryColor3svEXT (will be remapped) */ + "p\0" + "glSecondaryColor3sv\0" + "glSecondaryColor3svEXT\0" + "\0" + /* _mesa_function_pool[27154]: LoadTransposeMatrixfARB (will be remapped) */ + "p\0" + "glLoadTransposeMatrixf\0" + "glLoadTransposeMatrixfARB\0" + "\0" + /* _mesa_function_pool[27206]: GetPointerv (offset 329) */ + "ip\0" + "glGetPointerv\0" + "glGetPointervEXT\0" + "\0" + /* _mesa_function_pool[27241]: Tangent3bEXT (dynamic) */ + "iii\0" + "glTangent3bEXT\0" + "\0" + /* _mesa_function_pool[27261]: CombinerParameterfNV (will be remapped) */ + "if\0" + "glCombinerParameterfNV\0" + "\0" + /* _mesa_function_pool[27288]: IndexMask (offset 212) */ + "i\0" + "glIndexMask\0" + "\0" + /* _mesa_function_pool[27303]: BindProgramNV (will be remapped) */ + "ii\0" + "glBindProgramARB\0" + "glBindProgramNV\0" + "\0" + /* _mesa_function_pool[27340]: VertexAttrib4svARB (will be remapped) */ + "ip\0" + "glVertexAttrib4sv\0" + "glVertexAttrib4svARB\0" + "\0" + /* _mesa_function_pool[27383]: GetFloatv (offset 262) */ + "ip\0" + "glGetFloatv\0" + "\0" + /* _mesa_function_pool[27399]: CreateDebugObjectMESA (dynamic) */ + "\0" + "glCreateDebugObjectMESA\0" + "\0" + /* _mesa_function_pool[27425]: GetShaderiv (will be remapped) */ + "iip\0" + "glGetShaderiv\0" + "\0" + /* _mesa_function_pool[27444]: ClientWaitSync (will be remapped) */ + "iii\0" + "glClientWaitSync\0" + "\0" + /* _mesa_function_pool[27466]: TexCoord4s (offset 124) */ + "iiii\0" + "glTexCoord4s\0" + "\0" + /* _mesa_function_pool[27485]: TexCoord3sv (offset 117) */ + "p\0" + "glTexCoord3sv\0" + "\0" + /* _mesa_function_pool[27502]: BindFragmentShaderATI (will be remapped) */ + "i\0" + "glBindFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[27529]: PopAttrib (offset 218) */ + "\0" + "glPopAttrib\0" + "\0" + /* _mesa_function_pool[27543]: Fogfv (offset 154) */ + "ip\0" + "glFogfv\0" + "\0" + /* _mesa_function_pool[27555]: UnmapBufferARB (will be remapped) */ + "i\0" + "glUnmapBuffer\0" + "glUnmapBufferARB\0" + "\0" + /* _mesa_function_pool[27589]: InitNames (offset 197) */ + "\0" + "glInitNames\0" + "\0" + /* _mesa_function_pool[27603]: Normal3sv (offset 61) */ + "p\0" + "glNormal3sv\0" + "\0" + /* _mesa_function_pool[27618]: Minmax (offset 368) */ + "iii\0" + "glMinmax\0" + "glMinmaxEXT\0" + "\0" + /* _mesa_function_pool[27644]: TexCoord4d (offset 118) */ + "dddd\0" + "glTexCoord4d\0" + "\0" + /* _mesa_function_pool[27663]: TexCoord4f (offset 120) */ + "ffff\0" + "glTexCoord4f\0" + "\0" + /* _mesa_function_pool[27682]: FogCoorddvEXT (will be remapped) */ + "p\0" + "glFogCoorddv\0" + "glFogCoorddvEXT\0" + "\0" + /* _mesa_function_pool[27714]: FinishTextureSUNX (dynamic) */ + "\0" + "glFinishTextureSUNX\0" + "\0" + /* _mesa_function_pool[27736]: GetFragmentLightfvSGIX (dynamic) */ + "iip\0" + "glGetFragmentLightfvSGIX\0" + "\0" + /* _mesa_function_pool[27766]: Binormal3fvEXT (dynamic) */ + "p\0" + "glBinormal3fvEXT\0" + "\0" + /* _mesa_function_pool[27786]: GetBooleanv (offset 258) */ + "ip\0" + "glGetBooleanv\0" + "\0" + /* _mesa_function_pool[27804]: ColorFragmentOp3ATI (will be remapped) */ + "iiiiiiiiiiiii\0" + "glColorFragmentOp3ATI\0" + "\0" + /* _mesa_function_pool[27841]: Hint (offset 158) */ + "ii\0" + "glHint\0" + "\0" + /* _mesa_function_pool[27852]: Color4dv (offset 28) */ + "p\0" + "glColor4dv\0" + "\0" + /* _mesa_function_pool[27866]: VertexAttrib2svARB (will be remapped) */ + "ip\0" + "glVertexAttrib2sv\0" + "glVertexAttrib2svARB\0" + "\0" + /* _mesa_function_pool[27909]: AreProgramsResidentNV (will be remapped) */ + "ipp\0" + "glAreProgramsResidentNV\0" + "\0" + /* _mesa_function_pool[27938]: WindowPos3svMESA (will be remapped) */ + "p\0" + "glWindowPos3sv\0" + "glWindowPos3svARB\0" + "glWindowPos3svMESA\0" + "\0" + /* _mesa_function_pool[27993]: CopyColorSubTable (offset 347) */ + "iiiii\0" + "glCopyColorSubTable\0" + "glCopyColorSubTableEXT\0" + "\0" + /* _mesa_function_pool[28043]: WeightdvARB (dynamic) */ + "ip\0" + "glWeightdvARB\0" + "\0" + /* _mesa_function_pool[28061]: DeleteRenderbuffersEXT (will be remapped) */ + "ip\0" + "glDeleteRenderbuffers\0" + "glDeleteRenderbuffersEXT\0" + "\0" + /* _mesa_function_pool[28112]: VertexAttrib4NubvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nubv\0" + "glVertexAttrib4NubvARB\0" + "\0" + /* _mesa_function_pool[28159]: VertexAttrib3dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib3dvNV\0" + "\0" + /* _mesa_function_pool[28183]: GetObjectParameterfvARB (will be remapped) */ + "iip\0" + "glGetObjectParameterfvARB\0" + "\0" + /* _mesa_function_pool[28214]: Vertex4iv (offset 147) */ + "p\0" + "glVertex4iv\0" + "\0" + /* _mesa_function_pool[28229]: GetProgramEnvParameterdvARB (will be remapped) */ + "iip\0" + "glGetProgramEnvParameterdvARB\0" + "\0" + /* _mesa_function_pool[28264]: TexCoord4dv (offset 119) */ + "p\0" + "glTexCoord4dv\0" + "\0" + /* _mesa_function_pool[28281]: LockArraysEXT (will be remapped) */ + "ii\0" + "glLockArraysEXT\0" + "\0" + /* _mesa_function_pool[28301]: Begin (offset 7) */ + "i\0" + "glBegin\0" + "\0" + /* _mesa_function_pool[28312]: LightModeli (offset 165) */ + "ii\0" + "glLightModeli\0" + "\0" + /* _mesa_function_pool[28330]: Rectfv (offset 89) */ + "pp\0" + "glRectfv\0" + "\0" + /* _mesa_function_pool[28343]: LightModelf (offset 163) */ + "if\0" + "glLightModelf\0" + "\0" + /* _mesa_function_pool[28361]: GetTexParameterfv (offset 282) */ + "iip\0" + "glGetTexParameterfv\0" + "\0" + /* _mesa_function_pool[28386]: GetLightfv (offset 264) */ + "iip\0" + "glGetLightfv\0" + "\0" + /* _mesa_function_pool[28404]: PixelTransformParameterivEXT (dynamic) */ + "iip\0" + "glPixelTransformParameterivEXT\0" + "\0" + /* _mesa_function_pool[28440]: BinormalPointerEXT (dynamic) */ + "iip\0" + "glBinormalPointerEXT\0" + "\0" + /* _mesa_function_pool[28466]: VertexAttrib1dNV (will be remapped) */ + "id\0" + "glVertexAttrib1dNV\0" + "\0" + /* _mesa_function_pool[28489]: GetCombinerInputParameterivNV (will be remapped) */ + "iiiip\0" + "glGetCombinerInputParameterivNV\0" + "\0" + /* _mesa_function_pool[28528]: Disable (offset 214) */ + "i\0" + "glDisable\0" + "\0" + /* _mesa_function_pool[28541]: MultiTexCoord2fvARB (offset 387) */ + "ip\0" + "glMultiTexCoord2fv\0" + "glMultiTexCoord2fvARB\0" + "\0" + /* _mesa_function_pool[28586]: GetRenderbufferParameterivEXT (will be remapped) */ + "iip\0" + "glGetRenderbufferParameteriv\0" + "glGetRenderbufferParameterivEXT\0" + "\0" + /* _mesa_function_pool[28652]: CombinerParameterivNV (will be remapped) */ + "ip\0" + "glCombinerParameterivNV\0" + "\0" + /* _mesa_function_pool[28680]: GenFragmentShadersATI (will be remapped) */ + "i\0" + "glGenFragmentShadersATI\0" + "\0" + /* _mesa_function_pool[28707]: DrawArrays (offset 310) */ + "iii\0" + "glDrawArrays\0" + "glDrawArraysEXT\0" + "\0" + /* _mesa_function_pool[28741]: WeightuivARB (dynamic) */ + "ip\0" + "glWeightuivARB\0" + "\0" + /* _mesa_function_pool[28760]: VertexAttrib2sARB (will be remapped) */ + "iii\0" + "glVertexAttrib2s\0" + "glVertexAttrib2sARB\0" + "\0" + /* _mesa_function_pool[28802]: ColorMask (offset 210) */ + "iiii\0" + "glColorMask\0" + "\0" + /* _mesa_function_pool[28820]: GenAsyncMarkersSGIX (dynamic) */ + "i\0" + "glGenAsyncMarkersSGIX\0" + "\0" + /* _mesa_function_pool[28845]: Tangent3svEXT (dynamic) */ + "p\0" + "glTangent3svEXT\0" + "\0" + /* _mesa_function_pool[28864]: GetListParameterivSGIX (dynamic) */ + "iip\0" + "glGetListParameterivSGIX\0" + "\0" + /* _mesa_function_pool[28894]: BindBufferARB (will be remapped) */ + "ii\0" + "glBindBuffer\0" + "glBindBufferARB\0" + "\0" + /* _mesa_function_pool[28927]: GetInfoLogARB (will be remapped) */ + "iipp\0" + "glGetInfoLogARB\0" + "\0" + /* _mesa_function_pool[28949]: RasterPos4iv (offset 83) */ + "p\0" + "glRasterPos4iv\0" + "\0" + /* _mesa_function_pool[28967]: Enable (offset 215) */ + "i\0" + "glEnable\0" + "\0" + /* _mesa_function_pool[28979]: LineStipple (offset 167) */ + "ii\0" + "glLineStipple\0" + "\0" + /* _mesa_function_pool[28997]: VertexAttribs4svNV (will be remapped) */ + "iip\0" + "glVertexAttribs4svNV\0" + "\0" + /* _mesa_function_pool[29023]: EdgeFlagPointerListIBM (dynamic) */ + "ipi\0" + "glEdgeFlagPointerListIBM\0" + "\0" + /* _mesa_function_pool[29053]: UniformMatrix3x2fv (will be remapped) */ + "iiip\0" + "glUniformMatrix3x2fv\0" + "\0" + /* _mesa_function_pool[29080]: GetMinmaxParameterfv (offset 365) */ + "iip\0" + "glGetMinmaxParameterfv\0" + "glGetMinmaxParameterfvEXT\0" + "\0" + /* _mesa_function_pool[29134]: VertexAttrib1fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib1fv\0" + "glVertexAttrib1fvARB\0" + "\0" + /* _mesa_function_pool[29177]: GenBuffersARB (will be remapped) */ + "ip\0" + "glGenBuffers\0" + "glGenBuffersARB\0" + "\0" + /* _mesa_function_pool[29210]: VertexAttribs1svNV (will be remapped) */ + "iip\0" + "glVertexAttribs1svNV\0" + "\0" + /* _mesa_function_pool[29236]: Vertex3fv (offset 137) */ + "p\0" + "glVertex3fv\0" + "\0" + /* _mesa_function_pool[29251]: GetTexBumpParameterivATI (will be remapped) */ + "ip\0" + "glGetTexBumpParameterivATI\0" + "\0" + /* _mesa_function_pool[29282]: Binormal3bEXT (dynamic) */ + "iii\0" + "glBinormal3bEXT\0" + "\0" + /* _mesa_function_pool[29303]: FragmentMaterialivSGIX (dynamic) */ + "iip\0" + "glFragmentMaterialivSGIX\0" + "\0" + /* _mesa_function_pool[29333]: IsRenderbufferEXT (will be remapped) */ + "i\0" + "glIsRenderbuffer\0" + "glIsRenderbufferEXT\0" + "\0" + /* _mesa_function_pool[29373]: GenProgramsNV (will be remapped) */ + "ip\0" + "glGenProgramsARB\0" + "glGenProgramsNV\0" + "\0" + /* _mesa_function_pool[29410]: VertexAttrib4dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib4dvNV\0" + "\0" + /* _mesa_function_pool[29434]: EndFragmentShaderATI (will be remapped) */ + "\0" + "glEndFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[29459]: Binormal3iEXT (dynamic) */ + "iii\0" + "glBinormal3iEXT\0" + "\0" + /* _mesa_function_pool[29480]: WindowPos2fMESA (will be remapped) */ + "ff\0" + "glWindowPos2f\0" + "glWindowPos2fARB\0" + "glWindowPos2fMESA\0" + "\0" + ; + +/* these functions need to be remapped */ +static const struct { + GLint pool_index; + GLint remap_index; +} MESA_remap_table_functions[] = { + { 1461, AttachShader_remap_index }, + { 8704, CreateProgram_remap_index }, + { 20158, CreateShader_remap_index }, + { 22418, DeleteProgram_remap_index }, + { 16193, DeleteShader_remap_index }, + { 20604, DetachShader_remap_index }, + { 15717, GetAttachedShaders_remap_index }, + { 4244, GetProgramInfoLog_remap_index }, + { 361, GetProgramiv_remap_index }, + { 5547, GetShaderInfoLog_remap_index }, + { 27425, GetShaderiv_remap_index }, + { 11732, IsProgram_remap_index }, + { 10767, IsShader_remap_index }, + { 8808, StencilFuncSeparate_remap_index }, + { 3487, StencilMaskSeparate_remap_index }, + { 6623, StencilOpSeparate_remap_index }, + { 19535, UniformMatrix2x3fv_remap_index }, + { 2615, UniformMatrix2x4fv_remap_index }, + { 29053, UniformMatrix3x2fv_remap_index }, + { 26851, UniformMatrix3x4fv_remap_index }, + { 14265, UniformMatrix4x2fv_remap_index }, + { 2937, UniformMatrix4x3fv_remap_index }, + { 8722, LoadTransposeMatrixdARB_remap_index }, + { 27154, LoadTransposeMatrixfARB_remap_index }, + { 4817, MultTransposeMatrixdARB_remap_index }, + { 20791, MultTransposeMatrixfARB_remap_index }, + { 172, SampleCoverageARB_remap_index }, + { 4971, CompressedTexImage1DARB_remap_index }, + { 21248, CompressedTexImage2DARB_remap_index }, + { 3550, CompressedTexImage3DARB_remap_index }, + { 16009, CompressedTexSubImage1DARB_remap_index }, + { 1880, CompressedTexSubImage2DARB_remap_index }, + { 17801, CompressedTexSubImage3DARB_remap_index }, + { 25133, GetCompressedTexImageARB_remap_index }, + { 3395, DisableVertexAttribArrayARB_remap_index }, + { 26463, EnableVertexAttribArrayARB_remap_index }, + { 28229, GetProgramEnvParameterdvARB_remap_index }, + { 20671, GetProgramEnvParameterfvARB_remap_index }, + { 24163, GetProgramLocalParameterdvARB_remap_index }, + { 7065, GetProgramLocalParameterfvARB_remap_index }, + { 16100, GetProgramStringARB_remap_index }, + { 24358, GetProgramivARB_remap_index }, + { 17996, GetVertexAttribdvARB_remap_index }, + { 14154, GetVertexAttribfvARB_remap_index }, + { 8617, GetVertexAttribivARB_remap_index }, + { 16905, ProgramEnvParameter4dARB_remap_index }, + { 22218, ProgramEnvParameter4dvARB_remap_index }, + { 14762, ProgramEnvParameter4fARB_remap_index }, + { 7928, ProgramEnvParameter4fvARB_remap_index }, + { 3513, ProgramLocalParameter4dARB_remap_index }, + { 11442, ProgramLocalParameter4dvARB_remap_index }, + { 25942, ProgramLocalParameter4fARB_remap_index }, + { 22736, ProgramLocalParameter4fvARB_remap_index }, + { 24919, ProgramStringARB_remap_index }, + { 17155, VertexAttrib1dARB_remap_index }, + { 13808, VertexAttrib1dvARB_remap_index }, + { 3688, VertexAttrib1fARB_remap_index }, + { 29134, VertexAttrib1fvARB_remap_index }, + { 6149, VertexAttrib1sARB_remap_index }, + { 2054, VertexAttrib1svARB_remap_index }, + { 13239, VertexAttrib2dARB_remap_index }, + { 15336, VertexAttrib2dvARB_remap_index }, + { 1480, VertexAttrib2fARB_remap_index }, + { 15449, VertexAttrib2fvARB_remap_index }, + { 28760, VertexAttrib2sARB_remap_index }, + { 27866, VertexAttrib2svARB_remap_index }, + { 9926, VertexAttrib3dARB_remap_index }, + { 7631, VertexAttrib3dvARB_remap_index }, + { 1567, VertexAttrib3fARB_remap_index }, + { 19772, VertexAttrib3fvARB_remap_index }, + { 24791, VertexAttrib3sARB_remap_index }, + { 17738, VertexAttrib3svARB_remap_index }, + { 4270, VertexAttrib4NbvARB_remap_index }, + { 15672, VertexAttrib4NivARB_remap_index }, + { 19727, VertexAttrib4NsvARB_remap_index }, + { 20623, VertexAttrib4NubARB_remap_index }, + { 28112, VertexAttrib4NubvARB_remap_index }, + { 16566, VertexAttrib4NuivARB_remap_index }, + { 2810, VertexAttrib4NusvARB_remap_index }, + { 9549, VertexAttrib4bvARB_remap_index }, + { 23571, VertexAttrib4dARB_remap_index }, + { 18721, VertexAttrib4dvARB_remap_index }, + { 10033, VertexAttrib4fARB_remap_index }, + { 10403, VertexAttrib4fvARB_remap_index }, + { 9001, VertexAttrib4ivARB_remap_index }, + { 15150, VertexAttrib4sARB_remap_index }, + { 27340, VertexAttrib4svARB_remap_index }, + { 14567, VertexAttrib4ubvARB_remap_index }, + { 26787, VertexAttrib4uivARB_remap_index }, + { 17549, VertexAttrib4usvARB_remap_index }, + { 19409, VertexAttribPointerARB_remap_index }, + { 28894, BindBufferARB_remap_index }, + { 5862, BufferDataARB_remap_index }, + { 1382, BufferSubDataARB_remap_index }, + { 26976, DeleteBuffersARB_remap_index }, + { 29177, GenBuffersARB_remap_index }, + { 15492, GetBufferParameterivARB_remap_index }, + { 14714, GetBufferPointervARB_remap_index }, + { 1335, GetBufferSubDataARB_remap_index }, + { 26735, IsBufferARB_remap_index }, + { 23167, MapBufferARB_remap_index }, + { 27555, UnmapBufferARB_remap_index }, + { 268, BeginQueryARB_remap_index }, + { 17250, DeleteQueriesARB_remap_index }, + { 10664, EndQueryARB_remap_index }, + { 25612, GenQueriesARB_remap_index }, + { 1772, GetQueryObjectivARB_remap_index }, + { 15194, GetQueryObjectuivARB_remap_index }, + { 1624, GetQueryivARB_remap_index }, + { 17456, IsQueryARB_remap_index }, + { 7241, AttachObjectARB_remap_index }, + { 16155, CompileShaderARB_remap_index }, + { 2879, CreateProgramObjectARB_remap_index }, + { 5807, CreateShaderObjectARB_remap_index }, + { 12656, DeleteObjectARB_remap_index }, + { 21022, DetachObjectARB_remap_index }, + { 10475, GetActiveUniformARB_remap_index }, + { 8320, GetAttachedObjectsARB_remap_index }, + { 8599, GetHandleARB_remap_index }, + { 28927, GetInfoLogARB_remap_index }, + { 28183, GetObjectParameterfvARB_remap_index }, + { 24037, GetObjectParameterivARB_remap_index }, + { 25370, GetShaderSourceARB_remap_index }, + { 24651, GetUniformLocationARB_remap_index }, + { 20893, GetUniformfvARB_remap_index }, + { 11064, GetUniformivARB_remap_index }, + { 17594, LinkProgramARB_remap_index }, + { 17652, ShaderSourceARB_remap_index }, + { 6523, Uniform1fARB_remap_index }, + { 26151, Uniform1fvARB_remap_index }, + { 19378, Uniform1iARB_remap_index }, + { 18410, Uniform1ivARB_remap_index }, + { 2003, Uniform2fARB_remap_index }, + { 12492, Uniform2fvARB_remap_index }, + { 23054, Uniform2iARB_remap_index }, + { 2123, Uniform2ivARB_remap_index }, + { 16265, Uniform3fARB_remap_index }, + { 8350, Uniform3fvARB_remap_index }, + { 5481, Uniform3iARB_remap_index }, + { 14820, Uniform3ivARB_remap_index }, + { 16711, Uniform4fARB_remap_index }, + { 20757, Uniform4fvARB_remap_index }, + { 21897, Uniform4iARB_remap_index }, + { 17962, Uniform4ivARB_remap_index }, + { 7293, UniformMatrix2fvARB_remap_index }, + { 17, UniformMatrix3fvARB_remap_index }, + { 2475, UniformMatrix4fvARB_remap_index }, + { 22330, UseProgramObjectARB_remap_index }, + { 12927, ValidateProgramARB_remap_index }, + { 18764, BindAttribLocationARB_remap_index }, + { 4315, GetActiveAttribARB_remap_index }, + { 14501, GetAttribLocationARB_remap_index }, + { 25890, DrawBuffersARB_remap_index }, + { 11547, RenderbufferStorageMultisample_remap_index }, + { 16759, FlushMappedBufferRange_remap_index }, + { 24454, MapBufferRange_remap_index }, + { 14376, BindVertexArray_remap_index }, + { 12786, GenVertexArrays_remap_index }, + { 26665, CopyBufferSubData_remap_index }, + { 27444, ClientWaitSync_remap_index }, + { 2394, DeleteSync_remap_index }, + { 6190, FenceSync_remap_index }, + { 13298, GetInteger64v_remap_index }, + { 19834, GetSynciv_remap_index }, + { 25829, IsSync_remap_index }, + { 8268, WaitSync_remap_index }, + { 3363, DrawElementsBaseVertex_remap_index }, + { 26908, DrawRangeElementsBaseVertex_remap_index }, + { 23198, MultiDrawElementsBaseVertex_remap_index }, + { 4680, PolygonOffsetEXT_remap_index }, + { 20393, GetPixelTexGenParameterfvSGIS_remap_index }, + { 3895, GetPixelTexGenParameterivSGIS_remap_index }, + { 20126, PixelTexGenParameterfSGIS_remap_index }, + { 580, PixelTexGenParameterfvSGIS_remap_index }, + { 11102, PixelTexGenParameteriSGIS_remap_index }, + { 12063, PixelTexGenParameterivSGIS_remap_index }, + { 14464, SampleMaskSGIS_remap_index }, + { 17396, SamplePatternSGIS_remap_index }, + { 23127, ColorPointerEXT_remap_index }, + { 15379, EdgeFlagPointerEXT_remap_index }, + { 5135, IndexPointerEXT_remap_index }, + { 5215, NormalPointerEXT_remap_index }, + { 13892, TexCoordPointerEXT_remap_index }, + { 5985, VertexPointerEXT_remap_index }, + { 3165, PointParameterfEXT_remap_index }, + { 6830, PointParameterfvEXT_remap_index }, + { 28281, LockArraysEXT_remap_index }, + { 12991, UnlockArraysEXT_remap_index }, + { 7837, CullParameterdvEXT_remap_index }, + { 10270, CullParameterfvEXT_remap_index }, + { 1151, SecondaryColor3bEXT_remap_index }, + { 6989, SecondaryColor3bvEXT_remap_index }, + { 9178, SecondaryColor3dEXT_remap_index }, + { 22476, SecondaryColor3dvEXT_remap_index }, + { 24700, SecondaryColor3fEXT_remap_index }, + { 15945, SecondaryColor3fvEXT_remap_index }, + { 426, SecondaryColor3iEXT_remap_index }, + { 14202, SecondaryColor3ivEXT_remap_index }, + { 8836, SecondaryColor3sEXT_remap_index }, + { 27108, SecondaryColor3svEXT_remap_index }, + { 23873, SecondaryColor3ubEXT_remap_index }, + { 18655, SecondaryColor3ubvEXT_remap_index }, + { 11297, SecondaryColor3uiEXT_remap_index }, + { 20013, SecondaryColor3uivEXT_remap_index }, + { 22688, SecondaryColor3usEXT_remap_index }, + { 11370, SecondaryColor3usvEXT_remap_index }, + { 10346, SecondaryColorPointerEXT_remap_index }, + { 22537, MultiDrawArraysEXT_remap_index }, + { 18345, MultiDrawElementsEXT_remap_index }, + { 18540, FogCoordPointerEXT_remap_index }, + { 4044, FogCoorddEXT_remap_index }, + { 27682, FogCoorddvEXT_remap_index }, + { 4105, FogCoordfEXT_remap_index }, + { 23796, FogCoordfvEXT_remap_index }, + { 16663, PixelTexGenSGIX_remap_index }, + { 24381, BlendFuncSeparateEXT_remap_index }, + { 5897, FlushVertexArrayRangeNV_remap_index }, + { 4629, VertexArrayRangeNV_remap_index }, + { 24765, CombinerInputNV_remap_index }, + { 1946, CombinerOutputNV_remap_index }, + { 27261, CombinerParameterfNV_remap_index }, + { 4549, CombinerParameterfvNV_remap_index }, + { 19584, CombinerParameteriNV_remap_index }, + { 28652, CombinerParameterivNV_remap_index }, + { 6267, FinalCombinerInputNV_remap_index }, + { 8665, GetCombinerInputParameterfvNV_remap_index }, + { 28489, GetCombinerInputParameterivNV_remap_index }, + { 6066, GetCombinerOutputParameterfvNV_remap_index }, + { 12024, GetCombinerOutputParameterivNV_remap_index }, + { 5642, GetFinalCombinerInputParameterfvNV_remap_index }, + { 21769, GetFinalCombinerInputParameterivNV_remap_index }, + { 11042, ResizeBuffersMESA_remap_index }, + { 9753, WindowPos2dMESA_remap_index }, + { 944, WindowPos2dvMESA_remap_index }, + { 29480, WindowPos2fMESA_remap_index }, + { 6934, WindowPos2fvMESA_remap_index }, + { 15892, WindowPos2iMESA_remap_index }, + { 17869, WindowPos2ivMESA_remap_index }, + { 18444, WindowPos2sMESA_remap_index }, + { 4885, WindowPos2svMESA_remap_index }, + { 6759, WindowPos3dMESA_remap_index }, + { 12271, WindowPos3dvMESA_remap_index }, + { 472, WindowPos3fMESA_remap_index }, + { 13052, WindowPos3fvMESA_remap_index }, + { 21064, WindowPos3iMESA_remap_index }, + { 26610, WindowPos3ivMESA_remap_index }, + { 16409, WindowPos3sMESA_remap_index }, + { 27938, WindowPos3svMESA_remap_index }, + { 9704, WindowPos4dMESA_remap_index }, + { 14905, WindowPos4dvMESA_remap_index }, + { 12230, WindowPos4fMESA_remap_index }, + { 27015, WindowPos4fvMESA_remap_index }, + { 26763, WindowPos4iMESA_remap_index }, + { 10881, WindowPos4ivMESA_remap_index }, + { 16542, WindowPos4sMESA_remap_index }, + { 2857, WindowPos4svMESA_remap_index }, + { 23539, MultiModeDrawArraysIBM_remap_index }, + { 25483, MultiModeDrawElementsIBM_remap_index }, + { 10692, DeleteFencesNV_remap_index }, + { 24612, FinishFenceNV_remap_index }, + { 3287, GenFencesNV_remap_index }, + { 14885, GetFenceivNV_remap_index }, + { 7226, IsFenceNV_remap_index }, + { 11951, SetFenceNV_remap_index }, + { 3744, TestFenceNV_remap_index }, + { 27909, AreProgramsResidentNV_remap_index }, + { 27303, BindProgramNV_remap_index }, + { 22771, DeleteProgramsNV_remap_index }, + { 18873, ExecuteProgramNV_remap_index }, + { 29373, GenProgramsNV_remap_index }, + { 20472, GetProgramParameterdvNV_remap_index }, + { 9240, GetProgramParameterfvNV_remap_index }, + { 23101, GetProgramStringNV_remap_index }, + { 21458, GetProgramivNV_remap_index }, + { 20706, GetTrackMatrixivNV_remap_index }, + { 22921, GetVertexAttribPointervNV_remap_index }, + { 21702, GetVertexAttribdvNV_remap_index }, + { 16382, GetVertexAttribfvNV_remap_index }, + { 16073, GetVertexAttribivNV_remap_index }, + { 16789, IsProgramNV_remap_index }, + { 8246, LoadProgramNV_remap_index }, + { 24477, ProgramParameters4dvNV_remap_index }, + { 21388, ProgramParameters4fvNV_remap_index }, + { 18173, RequestResidentProgramsNV_remap_index }, + { 19562, TrackMatrixNV_remap_index }, + { 28466, VertexAttrib1dNV_remap_index }, + { 11892, VertexAttrib1dvNV_remap_index }, + { 25015, VertexAttrib1fNV_remap_index }, + { 2245, VertexAttrib1fvNV_remap_index }, + { 27072, VertexAttrib1sNV_remap_index }, + { 13125, VertexAttrib1svNV_remap_index }, + { 4220, VertexAttrib2dNV_remap_index }, + { 11807, VertexAttrib2dvNV_remap_index }, + { 17628, VertexAttrib2fNV_remap_index }, + { 11418, VertexAttrib2fvNV_remap_index }, + { 5045, VertexAttrib2sNV_remap_index }, + { 16463, VertexAttrib2svNV_remap_index }, + { 9901, VertexAttrib3dNV_remap_index }, + { 28159, VertexAttrib3dvNV_remap_index }, + { 9052, VertexAttrib3fNV_remap_index }, + { 21729, VertexAttrib3fvNV_remap_index }, + { 24990, VertexAttrib3sNV_remap_index }, + { 20733, VertexAttrib3svNV_remap_index }, + { 25457, VertexAttrib4dNV_remap_index }, + { 29410, VertexAttrib4dvNV_remap_index }, + { 3945, VertexAttrib4fNV_remap_index }, + { 8296, VertexAttrib4fvNV_remap_index }, + { 23423, VertexAttrib4sNV_remap_index }, + { 1293, VertexAttrib4svNV_remap_index }, + { 4378, VertexAttrib4ubNV_remap_index }, + { 734, VertexAttrib4ubvNV_remap_index }, + { 19053, VertexAttribPointerNV_remap_index }, + { 2097, VertexAttribs1dvNV_remap_index }, + { 16487, VertexAttribs1fvNV_remap_index }, + { 29210, VertexAttribs1svNV_remap_index }, + { 9077, VertexAttribs2dvNV_remap_index }, + { 22291, VertexAttribs2fvNV_remap_index }, + { 15405, VertexAttribs2svNV_remap_index }, + { 4577, VertexAttribs3dvNV_remap_index }, + { 1977, VertexAttribs3fvNV_remap_index }, + { 26358, VertexAttribs3svNV_remap_index }, + { 23513, VertexAttribs4dvNV_remap_index }, + { 4603, VertexAttribs4fvNV_remap_index }, + { 28997, VertexAttribs4svNV_remap_index }, + { 26106, VertexAttribs4ubvNV_remap_index }, + { 23615, GetTexBumpParameterfvATI_remap_index }, + { 29251, GetTexBumpParameterivATI_remap_index }, + { 16127, TexBumpParameterfvATI_remap_index }, + { 18044, TexBumpParameterivATI_remap_index }, + { 13671, AlphaFragmentOp1ATI_remap_index }, + { 9592, AlphaFragmentOp2ATI_remap_index }, + { 21645, AlphaFragmentOp3ATI_remap_index }, + { 26285, BeginFragmentShaderATI_remap_index }, + { 27502, BindFragmentShaderATI_remap_index }, + { 20862, ColorFragmentOp1ATI_remap_index }, + { 3823, ColorFragmentOp2ATI_remap_index }, + { 27804, ColorFragmentOp3ATI_remap_index }, + { 4722, DeleteFragmentShaderATI_remap_index }, + { 29434, EndFragmentShaderATI_remap_index }, + { 28680, GenFragmentShadersATI_remap_index }, + { 22395, PassTexCoordATI_remap_index }, + { 5965, SampleMapATI_remap_index }, + { 5738, SetFragmentShaderConstantATI_remap_index }, + { 319, PointParameteriNV_remap_index }, + { 12432, PointParameterivNV_remap_index }, + { 25296, ActiveStencilFaceEXT_remap_index }, + { 24137, BindVertexArrayAPPLE_remap_index }, + { 2522, DeleteVertexArraysAPPLE_remap_index }, + { 15744, GenVertexArraysAPPLE_remap_index }, + { 20537, IsVertexArrayAPPLE_remap_index }, + { 775, GetProgramNamedParameterdvNV_remap_index }, + { 3128, GetProgramNamedParameterfvNV_remap_index }, + { 23646, ProgramNamedParameter4dNV_remap_index }, + { 12707, ProgramNamedParameter4dvNV_remap_index }, + { 7862, ProgramNamedParameter4fNV_remap_index }, + { 10311, ProgramNamedParameter4fvNV_remap_index }, + { 21367, DepthBoundsEXT_remap_index }, + { 1043, BlendEquationSeparateEXT_remap_index }, + { 12826, BindFramebufferEXT_remap_index }, + { 22582, BindRenderbufferEXT_remap_index }, + { 8515, CheckFramebufferStatusEXT_remap_index }, + { 19853, DeleteFramebuffersEXT_remap_index }, + { 28061, DeleteRenderbuffersEXT_remap_index }, + { 11831, FramebufferRenderbufferEXT_remap_index }, + { 11968, FramebufferTexture1DEXT_remap_index }, + { 10139, FramebufferTexture2DEXT_remap_index }, + { 9806, FramebufferTexture3DEXT_remap_index }, + { 20429, GenFramebuffersEXT_remap_index }, + { 15291, GenRenderbuffersEXT_remap_index }, + { 5684, GenerateMipmapEXT_remap_index }, + { 19084, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 28586, GetRenderbufferParameterivEXT_remap_index }, + { 17924, IsFramebufferEXT_remap_index }, + { 29333, IsRenderbufferEXT_remap_index }, + { 7173, RenderbufferStorageEXT_remap_index }, + { 651, BlitFramebufferEXT_remap_index }, + { 12526, BufferParameteriAPPLE_remap_index }, + { 16821, FlushMappedBufferRangeAPPLE_remap_index }, + { 2701, FramebufferTextureLayerEXT_remap_index }, + { 26007, ProvokingVertexEXT_remap_index }, + { 9461, GetTexParameterPointervAPPLE_remap_index }, + { 4405, TextureRangeAPPLE_remap_index }, + { 25322, StencilFuncSeparateATI_remap_index }, + { 15811, ProgramEnvParameters4fvEXT_remap_index }, + { 15029, ProgramLocalParameters4fvEXT_remap_index }, + { 12360, GetQueryObjecti64vEXT_remap_index }, + { 9103, GetQueryObjectui64vEXT_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 */ + { 2440, _gloffset_BlendColor }, + /* from GL_EXT_blend_minmax */ + { 9863, _gloffset_BlendEquation }, + /* from GL_EXT_color_subtable */ + { 14927, _gloffset_ColorSubTable }, + { 27993, _gloffset_CopyColorSubTable }, + /* from GL_EXT_convolution */ + { 213, _gloffset_ConvolutionFilter1D }, + { 2284, _gloffset_CopyConvolutionFilter1D }, + { 3624, _gloffset_GetConvolutionParameteriv }, + { 7522, _gloffset_ConvolutionFilter2D }, + { 7688, _gloffset_ConvolutionParameteriv }, + { 8148, _gloffset_ConvolutionParameterfv }, + { 18072, _gloffset_GetSeparableFilter }, + { 21118, _gloffset_SeparableFilter2D }, + { 21947, _gloffset_ConvolutionParameteri }, + { 22070, _gloffset_ConvolutionParameterf }, + { 23449, _gloffset_GetConvolutionParameterfv }, + { 24303, _gloffset_GetConvolutionFilter }, + { 26547, _gloffset_CopyConvolutionFilter2D }, + /* from GL_EXT_copy_texture */ + { 13185, _gloffset_CopyTexSubImage3D }, + { 14667, _gloffset_CopyTexImage2D }, + { 21555, _gloffset_CopyTexImage1D }, + { 23984, _gloffset_CopyTexSubImage2D }, + { 26185, _gloffset_CopyTexSubImage1D }, + /* from GL_EXT_draw_range_elements */ + { 8402, _gloffset_DrawRangeElements }, + /* from GL_EXT_histogram */ + { 812, _gloffset_Histogram }, + { 3088, _gloffset_ResetHistogram }, + { 8774, _gloffset_GetMinmax }, + { 13519, _gloffset_GetHistogramParameterfv }, + { 21480, _gloffset_GetMinmaxParameteriv }, + { 23339, _gloffset_ResetMinmax }, + { 24200, _gloffset_GetHistogramParameteriv }, + { 25256, _gloffset_GetHistogram }, + { 27618, _gloffset_Minmax }, + { 29080, _gloffset_GetMinmaxParameterfv }, + /* from GL_EXT_paletted_texture */ + { 7384, _gloffset_ColorTable }, + { 13365, _gloffset_GetColorTable }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, + /* from GL_EXT_subtexture */ + { 6105, _gloffset_TexSubImage1D }, + { 9388, _gloffset_TexSubImage2D }, + /* from GL_EXT_texture3D */ + { 1658, _gloffset_TexImage3D }, + { 19945, _gloffset_TexSubImage3D }, + /* from GL_EXT_texture_object */ + { 2964, _gloffset_PrioritizeTextures }, + { 6554, _gloffset_AreTexturesResident }, + { 11916, _gloffset_GenTextures }, + { 13851, _gloffset_DeleteTextures }, + { 17102, _gloffset_IsTexture }, + { 26250, _gloffset_BindTexture }, + /* from GL_EXT_vertex_array */ + { 21307, _gloffset_ArrayElement }, + { 27206, _gloffset_GetPointerv }, + { 28707, _gloffset_DrawArrays }, + /* from GL_SGI_color_table */ + { 6672, _gloffset_ColorTableParameteriv }, + { 7384, _gloffset_ColorTable }, + { 13365, _gloffset_GetColorTable }, + { 13475, _gloffset_CopyColorTable }, + { 16963, _gloffset_ColorTableParameterfv }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, + /* from GL_VERSION_1_3 */ + { 381, _gloffset_MultiTexCoord3sARB }, + { 613, _gloffset_ActiveTextureARB }, + { 3761, _gloffset_MultiTexCoord1fvARB }, + { 5240, _gloffset_MultiTexCoord3dARB }, + { 5285, _gloffset_MultiTexCoord2iARB }, + { 5409, _gloffset_MultiTexCoord2svARB }, + { 7340, _gloffset_MultiTexCoord2fARB }, + { 9133, _gloffset_MultiTexCoord3fvARB }, + { 9625, _gloffset_MultiTexCoord4sARB }, + { 10225, _gloffset_MultiTexCoord2dvARB }, + { 10607, _gloffset_MultiTexCoord1svARB }, + { 10903, _gloffset_MultiTexCoord3svARB }, + { 10964, _gloffset_MultiTexCoord4iARB }, + { 11687, _gloffset_MultiTexCoord3iARB }, + { 12389, _gloffset_MultiTexCoord1dARB }, + { 12555, _gloffset_MultiTexCoord3dvARB }, + { 13719, _gloffset_MultiTexCoord3ivARB }, + { 13764, _gloffset_MultiTexCoord2sARB }, + { 14984, _gloffset_MultiTexCoord4ivARB }, + { 16613, _gloffset_ClientActiveTextureARB }, + { 18829, _gloffset_MultiTexCoord2dARB }, + { 19204, _gloffset_MultiTexCoord4dvARB }, + { 19490, _gloffset_MultiTexCoord4fvARB }, + { 20317, _gloffset_MultiTexCoord3fARB }, + { 22627, _gloffset_MultiTexCoord4dARB }, + { 22831, _gloffset_MultiTexCoord1sARB }, + { 23009, _gloffset_MultiTexCoord1dvARB }, + { 23828, _gloffset_MultiTexCoord1ivARB }, + { 23921, _gloffset_MultiTexCoord2ivARB }, + { 24260, _gloffset_MultiTexCoord1iARB }, + { 25531, _gloffset_MultiTexCoord4svARB }, + { 26049, _gloffset_MultiTexCoord1fARB }, + { 26312, _gloffset_MultiTexCoord4fARB }, + { 28541, _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[] = { + { 8206, -1 }, /* TbufferMask3DFX */ + { -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_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_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_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_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_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[] = { + { 3339, -1 }, /* MatrixIndexusvARB */ + { 11508, -1 }, /* MatrixIndexuivARB */ + { 12677, -1 }, /* MatrixIndexPointerARB */ + { 17351, -1 }, /* CurrentPaletteMatrixARB */ + { 20061, -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_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_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_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[] = { + { 2226, -1 }, /* WeightubvARB */ + { 5572, -1 }, /* WeightivARB */ + { 9728, -1 }, /* WeightPointerARB */ + { 12146, -1 }, /* WeightfvARB */ + { 15431, -1 }, /* WeightbvARB */ + { 18497, -1 }, /* WeightusvARB */ + { 21044, -1 }, /* VertexBlendARB */ + { 26133, -1 }, /* WeightsvARB */ + { 28043, -1 }, /* WeightdvARB */ + { 28741, -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[] = { + { 2440, _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[] = { + { 9863, _gloffset_BlendEquation }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_color_subtable) +static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { + { 14927, _gloffset_ColorSubTable }, + { 27993, _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[] = { + { 213, _gloffset_ConvolutionFilter1D }, + { 2284, _gloffset_CopyConvolutionFilter1D }, + { 3624, _gloffset_GetConvolutionParameteriv }, + { 7522, _gloffset_ConvolutionFilter2D }, + { 7688, _gloffset_ConvolutionParameteriv }, + { 8148, _gloffset_ConvolutionParameterfv }, + { 18072, _gloffset_GetSeparableFilter }, + { 21118, _gloffset_SeparableFilter2D }, + { 21947, _gloffset_ConvolutionParameteri }, + { 22070, _gloffset_ConvolutionParameterf }, + { 23449, _gloffset_GetConvolutionParameterfv }, + { 24303, _gloffset_GetConvolutionFilter }, + { 26547, _gloffset_CopyConvolutionFilter2D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { + { 9272, -1 }, /* TangentPointerEXT */ + { 11022, -1 }, /* Binormal3ivEXT */ + { 11640, -1 }, /* Tangent3sEXT */ + { 12742, -1 }, /* Tangent3fvEXT */ + { 16363, -1 }, /* Tangent3dvEXT */ + { 17049, -1 }, /* Binormal3bvEXT */ + { 18125, -1 }, /* Binormal3dEXT */ + { 19993, -1 }, /* Tangent3fEXT */ + { 22019, -1 }, /* Binormal3sEXT */ + { 22437, -1 }, /* Tangent3ivEXT */ + { 22456, -1 }, /* Tangent3dEXT */ + { 23236, -1 }, /* Binormal3svEXT */ + { 23726, -1 }, /* Binormal3fEXT */ + { 24578, -1 }, /* Binormal3dvEXT */ + { 25753, -1 }, /* Tangent3iEXT */ + { 26832, -1 }, /* Tangent3bvEXT */ + { 27241, -1 }, /* Tangent3bEXT */ + { 27766, -1 }, /* Binormal3fvEXT */ + { 28440, -1 }, /* BinormalPointerEXT */ + { 28845, -1 }, /* Tangent3svEXT */ + { 29282, -1 }, /* Binormal3bEXT */ + { 29459, -1 }, /* Binormal3iEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { + { 13185, _gloffset_CopyTexSubImage3D }, + { 14667, _gloffset_CopyTexImage2D }, + { 21555, _gloffset_CopyTexImage1D }, + { 23984, _gloffset_CopyTexSubImage2D }, + { 26185, _gloffset_CopyTexSubImage1D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_cull_vertex) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = { + { -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_range_elements) +static const struct gl_function_remap GL_EXT_draw_range_elements_functions[] = { + { 8402, _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_histogram) +static const struct gl_function_remap GL_EXT_histogram_functions[] = { + { 812, _gloffset_Histogram }, + { 3088, _gloffset_ResetHistogram }, + { 8774, _gloffset_GetMinmax }, + { 13519, _gloffset_GetHistogramParameterfv }, + { 21480, _gloffset_GetMinmaxParameteriv }, + { 23339, _gloffset_ResetMinmax }, + { 24200, _gloffset_GetHistogramParameteriv }, + { 25256, _gloffset_GetHistogram }, + { 27618, _gloffset_Minmax }, + { 29080, _gloffset_GetMinmaxParameterfv }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_index_func) +static const struct gl_function_remap GL_EXT_index_func_functions[] = { + { 10090, -1 }, /* IndexFuncEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_index_material) +static const struct gl_function_remap GL_EXT_index_material_functions[] = { + { 18584, -1 }, /* IndexMaterialEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_light_texture) +static const struct gl_function_remap GL_EXT_light_texture_functions[] = { + { 23256, -1 }, /* ApplyTextureEXT */ + { 23293, -1 }, /* TextureMaterialEXT */ + { 23318, -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[] = { + { 7384, _gloffset_ColorTable }, + { 13365, _gloffset_GetColorTable }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { + { 9513, -1 }, /* PixelTransformParameterfvEXT */ + { 19169, -1 }, /* PixelTransformParameterfEXT */ + { 19249, -1 }, /* PixelTransformParameteriEXT */ + { 28404, -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_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[] = { + { 6105, _gloffset_TexSubImage1D }, + { 9388, _gloffset_TexSubImage2D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_texture3D) +static const struct gl_function_remap GL_EXT_texture3D_functions[] = { + { 1658, _gloffset_TexImage3D }, + { 19945, _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_object) +static const struct gl_function_remap GL_EXT_texture_object_functions[] = { + { 2964, _gloffset_PrioritizeTextures }, + { 6554, _gloffset_AreTexturesResident }, + { 11916, _gloffset_GenTextures }, + { 13851, _gloffset_DeleteTextures }, + { 17102, _gloffset_IsTexture }, + { 26250, _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[] = { + { 12096, -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_vertex_array) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_vertex_array_functions[] = { + { 21307, _gloffset_ArrayElement }, + { 27206, _gloffset_GetPointerv }, + { 28707, _gloffset_DrawArrays }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_vertex_weighting) +static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { + { 17132, -1 }, /* VertexWeightfvEXT */ + { 23704, -1 }, /* VertexWeightfEXT */ + { 25225, -1 }, /* VertexWeightPointerEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_HP_image_transform) +static const struct gl_function_remap GL_HP_image_transform_functions[] = { + { 2157, -1 }, /* GetImageTransformParameterfvHP */ + { 3305, -1 }, /* ImageTransformParameterfHP */ + { 8966, -1 }, /* ImageTransformParameterfvHP */ + { 10525, -1 }, /* ImageTransformParameteriHP */ + { 10793, -1 }, /* GetImageTransformParameterivHP */ + { 17196, -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[] = { + { 3857, -1 }, /* SecondaryColorPointerListIBM */ + { 5106, -1 }, /* NormalPointerListIBM */ + { 6728, -1 }, /* FogCoordPointerListIBM */ + { 7035, -1 }, /* VertexPointerListIBM */ + { 10446, -1 }, /* ColorPointerListIBM */ + { 11747, -1 }, /* TexCoordPointerListIBM */ + { 12118, -1 }, /* IndexPointerListIBM */ + { 29023, -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[] = { + { 11134, -1 }, /* VertexPointervINTEL */ + { 13612, -1 }, /* ColorPointervINTEL */ + { 26521, -1 }, /* NormalPointervINTEL */ + { 26947, -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[] = { + { 1522, -1 }, /* GetDebugLogLengthMESA */ + { 3063, -1 }, /* ClearDebugLogMESA */ + { 4018, -1 }, /* GetDebugLogMESA */ + { 27399, -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_evaluators) +static const struct gl_function_remap GL_NV_evaluators_functions[] = { + { 5773, -1 }, /* GetMapAttribParameterivNV */ + { 7490, -1 }, /* MapControlPointsNV */ + { 7589, -1 }, /* MapParameterfvNV */ + { 9371, -1 }, /* EvalMapsNV */ + { 15101, -1 }, /* GetMapAttribParameterfvNV */ + { 15267, -1 }, /* MapParameterivNV */ + { 21870, -1 }, /* GetMapParameterivNV */ + { 22368, -1 }, /* GetMapParameterfvNV */ + { 25857, -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_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[] = { + { 14004, -1 }, /* CombinerStageParameterfvNV */ + { 14319, -1 }, /* GetCombinerStageParameterfvNV */ + { -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_PGI_misc_hints) +static const struct gl_function_remap GL_PGI_misc_hints_functions[] = { + { 7674, -1 }, /* HintPGI */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_detail_texture) +static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { + { 14292, -1 }, /* GetDetailTexFuncSGIS */ + { 14612, -1 }, /* DetailTexFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_fog_function) +static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { + { 23966, -1 }, /* FogFuncSGIS */ + { 24631, -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[] = { + { 5834, -1 }, /* GetSharpenTexFuncSGIS */ + { 19464, -1 }, /* SharpenTexFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_texture4D) +static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { + { 894, -1 }, /* TexImage4DSGIS */ + { 13920, -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[] = { + { 13318, -1 }, /* TextureColorMaskSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_texture_filter4) +static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { + { 6011, -1 }, /* GetTexFilterFuncSGIS */ + { 14438, -1 }, /* TexFilterFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_async) +static const struct gl_function_remap GL_SGIX_async_functions[] = { + { 3014, -1 }, /* AsyncMarkerSGIX */ + { 3997, -1 }, /* FinishAsyncSGIX */ + { 4703, -1 }, /* PollAsyncSGIX */ + { 19611, -1 }, /* DeleteAsyncMarkersSGIX */ + { 19640, -1 }, /* IsAsyncMarkerSGIX */ + { 28820, -1 }, /* GenAsyncMarkersSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_flush_raster) +static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = { + { 6382, -1 }, /* FlushRasterSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { + { 2410, -1 }, /* FragmentMaterialfvSGIX */ + { 2906, -1 }, /* FragmentLightModelivSGIX */ + { 4654, -1 }, /* FragmentLightiSGIX */ + { 5514, -1 }, /* GetFragmentMaterialfvSGIX */ + { 7102, -1 }, /* FragmentMaterialfSGIX */ + { 7263, -1 }, /* GetFragmentLightivSGIX */ + { 8100, -1 }, /* FragmentLightModeliSGIX */ + { 9434, -1 }, /* FragmentLightivSGIX */ + { 9671, -1 }, /* GetFragmentMaterialivSGIX */ + { 17019, -1 }, /* FragmentLightModelfSGIX */ + { 17319, -1 }, /* FragmentColorMaterialSGIX */ + { 17691, -1 }, /* FragmentMaterialiSGIX */ + { 18912, -1 }, /* LightEnviSGIX */ + { 20268, -1 }, /* FragmentLightModelfvSGIX */ + { 20577, -1 }, /* FragmentLightfvSGIX */ + { 25107, -1 }, /* FragmentLightfSGIX */ + { 27736, -1 }, /* GetFragmentLightfvSGIX */ + { 29303, -1 }, /* FragmentMaterialivSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_framezoom) +static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { + { 19663, -1 }, /* FrameZoomSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_igloo_interface) +static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { + { 25415, -1 }, /* IglooInterfaceSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_instruments) +static const struct gl_function_remap GL_SGIX_instruments_functions[] = { + { 2573, -1 }, /* ReadInstrumentsSGIX */ + { 5590, -1 }, /* PollInstrumentsSGIX */ + { 9332, -1 }, /* GetInstrumentsSGIX */ + { 11345, -1 }, /* StartInstrumentsSGIX */ + { 14038, -1 }, /* StopInstrumentsSGIX */ + { 15644, -1 }, /* InstrumentsBufferSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { + { 1125, -1 }, /* ListParameterfSGIX */ + { 2763, -1 }, /* GetListParameterfvSGIX */ + { 15559, -1 }, /* ListParameteriSGIX */ + { 16313, -1 }, /* ListParameterfvSGIX */ + { 18318, -1 }, /* ListParameterivSGIX */ + { 28864, -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[] = { + { 3251, -1 }, /* LoadIdentityDeformationMapSGIX */ + { 10713, -1 }, /* DeformationMap3dSGIX */ + { 14138, -1 }, /* DeformSGIX */ + { 21419, -1 }, /* DeformationMap3fSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_reference_plane) +static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { + { 12869, -1 }, /* ReferencePlaneSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_sprite) +static const struct gl_function_remap GL_SGIX_sprite_functions[] = { + { 8487, -1 }, /* SpriteParameterfvSGIX */ + { 18146, -1 }, /* SpriteParameteriSGIX */ + { 23373, -1 }, /* SpriteParameterfSGIX */ + { 25979, -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[] = { + { 18205, -1 }, /* TagSampleBufferSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGI_color_table) +static const struct gl_function_remap GL_SGI_color_table_functions[] = { + { 6672, _gloffset_ColorTableParameteriv }, + { 7384, _gloffset_ColorTable }, + { 13365, _gloffset_GetColorTable }, + { 13475, _gloffset_CopyColorTable }, + { 16963, _gloffset_ColorTableParameterfv }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUNX_constant_data) +static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { + { 27714, -1 }, /* FinishTextureSUNX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { + { 3035, -1 }, /* GlobalAlphaFactorubSUN */ + { 4193, -1 }, /* GlobalAlphaFactoriSUN */ + { 5615, -1 }, /* GlobalAlphaFactordSUN */ + { 8571, -1 }, /* GlobalAlphaFactoruiSUN */ + { 8923, -1 }, /* GlobalAlphaFactorbSUN */ + { 11660, -1 }, /* GlobalAlphaFactorfSUN */ + { 11779, -1 }, /* GlobalAlphaFactorusSUN */ + { 19902, -1 }, /* GlobalAlphaFactorsSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_mesh_array) +static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { + { 25791, -1 }, /* DrawMeshArraysSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { + { 3971, -1 }, /* ReplacementCodeubSUN */ + { 5454, -1 }, /* ReplacementCodeubvSUN */ + { 16684, -1 }, /* ReplacementCodeusvSUN */ + { 16872, -1 }, /* ReplacementCodePointerSUN */ + { 18229, -1 }, /* ReplacementCodeusSUN */ + { 18976, -1 }, /* ReplacementCodeuiSUN */ + { 26436, -1 }, /* ReplacementCodeuivSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_vertex) +static const struct gl_function_remap GL_SUN_vertex_functions[] = { + { 999, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */ + { 1197, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */ + { 1423, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */ + { 1699, -1 }, /* ReplacementCodeuiVertex3fvSUN */ + { 1833, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */ + { 2346, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */ + { 2642, -1 }, /* Color4ubVertex3fvSUN */ + { 4074, -1 }, /* Color4ubVertex3fSUN */ + { 4150, -1 }, /* TexCoord2fVertex3fSUN */ + { 4449, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ + { 4779, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ + { 5349, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ + { 6419, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ + { 7131, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ + { 7899, -1 }, /* Color3fVertex3fSUN */ + { 8882, -1 }, /* Color3fVertex3fvSUN */ + { 9297, -1 }, /* Color4fNormal3fVertex3fvSUN */ + { 9969, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ + { 11208, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 12600, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 13011, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 14063, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 14397, -1 }, /* Color4ubVertex2fvSUN */ + { 14637, -1 }, /* Normal3fVertex3fSUN */ + { 15585, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 15846, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 16513, -1 }, /* TexCoord2fVertex3fvSUN */ + { 17289, -1 }, /* Color4ubVertex2fSUN */ + { 17482, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 19335, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 19682, -1 }, /* Normal3fVertex3fvSUN */ + { 20085, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 20951, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 21171, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 22874, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 24082, -1 }, /* TexCoord4fVertex4fSUN */ + { 24508, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 24834, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 24961, -1 }, /* TexCoord4fVertex4fvSUN */ + { 25663, -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[] = { + { 381, _gloffset_MultiTexCoord3sARB }, + { 613, _gloffset_ActiveTextureARB }, + { 3761, _gloffset_MultiTexCoord1fvARB }, + { 5240, _gloffset_MultiTexCoord3dARB }, + { 5285, _gloffset_MultiTexCoord2iARB }, + { 5409, _gloffset_MultiTexCoord2svARB }, + { 7340, _gloffset_MultiTexCoord2fARB }, + { 9133, _gloffset_MultiTexCoord3fvARB }, + { 9625, _gloffset_MultiTexCoord4sARB }, + { 10225, _gloffset_MultiTexCoord2dvARB }, + { 10607, _gloffset_MultiTexCoord1svARB }, + { 10903, _gloffset_MultiTexCoord3svARB }, + { 10964, _gloffset_MultiTexCoord4iARB }, + { 11687, _gloffset_MultiTexCoord3iARB }, + { 12389, _gloffset_MultiTexCoord1dARB }, + { 12555, _gloffset_MultiTexCoord3dvARB }, + { 13719, _gloffset_MultiTexCoord3ivARB }, + { 13764, _gloffset_MultiTexCoord2sARB }, + { 14984, _gloffset_MultiTexCoord4ivARB }, + { 16613, _gloffset_ClientActiveTextureARB }, + { 18829, _gloffset_MultiTexCoord2dARB }, + { 19204, _gloffset_MultiTexCoord4dvARB }, + { 19490, _gloffset_MultiTexCoord4fvARB }, + { 20317, _gloffset_MultiTexCoord3fARB }, + { 22627, _gloffset_MultiTexCoord4dARB }, + { 22831, _gloffset_MultiTexCoord1sARB }, + { 23009, _gloffset_MultiTexCoord1dvARB }, + { 23828, _gloffset_MultiTexCoord1ivARB }, + { 23921, _gloffset_MultiTexCoord2ivARB }, + { 24260, _gloffset_MultiTexCoord1iARB }, + { 25531, _gloffset_MultiTexCoord4svARB }, + { 26049, _gloffset_MultiTexCoord1fARB }, + { 26312, _gloffset_MultiTexCoord4fARB }, + { 28541, _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 + diff --git a/mesalib/src/mesa/main/renderbuffer.c b/mesalib/src/mesa/main/renderbuffer.c index 5bef7c84f..3bb062bae 100644 --- a/mesalib/src/mesa/main/renderbuffer.c +++ b/mesalib/src/mesa/main/renderbuffer.c @@ -43,6 +43,8 @@ #include "glheader.h" #include "imports.h" #include "context.h" +#include "fbobject.h" +#include "formats.h" #include "mtypes.h" #include "fbobject.h" #include "renderbuffer.h" @@ -72,7 +74,7 @@ get_pointer_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb->Data) return NULL; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - /* Can't assert _ActualFormat since these funcs may be used for serveral + /* Can't assert rb->Format since these funcs may be used for serveral * different formats (GL_ALPHA8, GL_STENCIL_INDEX8, etc). */ return (GLubyte *) rb->Data + y * rb->Width + x; @@ -448,7 +450,7 @@ static void * get_pointer_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) { - ASSERT(rb->_ActualFormat == GL_RGB8); + 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. */ @@ -463,7 +465,7 @@ get_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) rb->Data + 3 * (y * rb->Width + x); GLubyte *dst = (GLubyte *) values; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + 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]; @@ -480,7 +482,7 @@ get_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { GLubyte *dst = (GLubyte *) values; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { const GLubyte *src @@ -501,7 +503,7 @@ put_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) values; GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -521,7 +523,7 @@ put_row_rgb_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) values; GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -542,7 +544,7 @@ put_mono_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte val1 = ((const GLubyte *) value)[1]; const GLubyte val2 = ((const GLubyte *) value)[2]; GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); if (!mask && val0 == val1 && val1 == val2) { /* optimized case */ @@ -569,7 +571,7 @@ put_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, /* note: incoming values are RGB+A! */ const GLubyte *src = (const GLubyte *) values; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -592,7 +594,7 @@ put_mono_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, const GLubyte val1 = ((const GLubyte *) value)[1]; const GLubyte val2 = ((const GLubyte *) value)[2]; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -617,7 +619,7 @@ get_pointer_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb->Data) return NULL; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); return (GLubyte *) rb->Data + 4 * (y * rb->Width + x); } @@ -628,7 +630,7 @@ get_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const GLubyte *src = (const GLubyte *) rb->Data + 4 * (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); _mesa_memcpy(values, src, 4 * count * sizeof(GLubyte)); } @@ -641,7 +643,7 @@ get_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLuint *dst = (GLuint *) values; GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { const GLuint *src = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); dst[i] = *src; @@ -657,7 +659,7 @@ put_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *src = (const GLuint *) values; GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); if (mask) { GLuint i; for (i = 0; i < count; i++) { @@ -681,7 +683,7 @@ put_row_rgb_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLubyte *dst = (GLubyte *) rb->Data + 4 * (y * rb->Width + x); GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { if (!mask || mask[i]) { dst[i * 4 + 0] = src[i * 3 + 0]; @@ -701,7 +703,7 @@ put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint val = *((const GLuint *) value); GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); if (!mask && val == 0) { /* common case */ _mesa_bzero(dst, count * 4 * sizeof(GLubyte)); @@ -735,7 +737,7 @@ put_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *src = (const GLuint *) values; GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { if (!mask || mask[i]) { GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); @@ -754,7 +756,7 @@ put_mono_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, const GLuint val = *((const GLuint *) value); GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { if (!mask || mask[i]) { GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); @@ -947,15 +949,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, { GLuint pixelSize; - /* first clear these fields */ - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; - switch (internalFormat) { case GL_RGB: case GL_R3_G3_B2: @@ -965,8 +958,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->_ActualFormat = GL_RGB8; - rb->_BaseFormat = GL_RGB; + rb->Format = MESA_FORMAT_RGB888; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte3; rb->GetRow = get_row_ubyte3; @@ -976,10 +968,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte3; rb->PutValues = put_values_ubyte3; rb->PutMonoValues = put_mono_values_ubyte3; - rb->RedBits = 8 * sizeof(GLubyte); - rb->GreenBits = 8 * sizeof(GLubyte); - rb->BlueBits = 8 * sizeof(GLubyte); - rb->AlphaBits = 0; pixelSize = 3 * sizeof(GLubyte); break; case GL_RGBA: @@ -987,8 +975,11 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, case GL_RGBA4: case GL_RGB5_A1: case GL_RGBA8: - rb->_ActualFormat = GL_RGBA8; - rb->_BaseFormat = GL_RGBA; +#if 1 + case GL_RGB10_A2: + case GL_RGBA12: +#endif + rb->Format = MESA_FORMAT_RGBA8888; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte4; rb->GetRow = get_row_ubyte4; @@ -998,18 +989,12 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte4; rb->PutValues = put_values_ubyte4; rb->PutMonoValues = put_mono_values_ubyte4; - rb->RedBits = 8 * sizeof(GLubyte); - rb->GreenBits = 8 * sizeof(GLubyte); - rb->BlueBits = 8 * sizeof(GLubyte); - rb->AlphaBits = 8 * sizeof(GLubyte); pixelSize = 4 * sizeof(GLubyte); break; - case GL_RGB10_A2: - case GL_RGBA12: case GL_RGBA16: - rb->_ActualFormat = GL_RGBA16; - rb->_BaseFormat = GL_RGBA; - rb->DataType = GL_UNSIGNED_SHORT; + /* for accum buffer */ + rb->Format = MESA_FORMAT_SIGNED_RGBA_16; + rb->DataType = GL_SHORT; rb->GetPointer = get_pointer_ushort4; rb->GetRow = get_row_ushort4; rb->GetValues = get_values_ushort4; @@ -1018,16 +1003,11 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ushort4; rb->PutValues = put_values_ushort4; rb->PutMonoValues = put_mono_values_ushort4; - rb->RedBits = 8 * sizeof(GLushort); - rb->GreenBits = 8 * sizeof(GLushort); - rb->BlueBits = 8 * sizeof(GLushort); - rb->AlphaBits = 8 * sizeof(GLushort); pixelSize = 4 * sizeof(GLushort); break; -#if 00 +#if 0 case GL_ALPHA8: - rb->_ActualFormat = GL_ALPHA8; - rb->_BaseFormat = GL_RGBA; /* Yes, not GL_ALPHA! */ + rb->Format = MESA_FORMAT_A8; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_alpha8; rb->GetRow = get_row_alpha8; @@ -1037,10 +1017,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_alpha8; rb->PutValues = put_values_alpha8; rb->PutMonoValues = put_mono_values_alpha8; - rb->RedBits = 0; /*red*/ - rb->GreenBits = 0; /*green*/ - rb->BlueBits = 0; /*blue*/ - rb->AlphaBits = 8 * sizeof(GLubyte); pixelSize = sizeof(GLubyte); break; #endif @@ -1048,8 +1024,8 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, case GL_STENCIL_INDEX1_EXT: case GL_STENCIL_INDEX4_EXT: case GL_STENCIL_INDEX8_EXT: - rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - rb->_BaseFormat = GL_STENCIL_INDEX; + case GL_STENCIL_INDEX16_EXT: + rb->Format = MESA_FORMAT_S8; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte; rb->GetRow = get_row_ubyte; @@ -1059,28 +1035,11 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte; rb->PutValues = put_values_ubyte; rb->PutMonoValues = put_mono_values_ubyte; - rb->StencilBits = 8 * sizeof(GLubyte); pixelSize = sizeof(GLubyte); break; - case GL_STENCIL_INDEX16_EXT: - rb->_ActualFormat = GL_STENCIL_INDEX16_EXT; - rb->_BaseFormat = GL_STENCIL_INDEX; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - 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; - rb->StencilBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: - rb->_ActualFormat = GL_DEPTH_COMPONENT16; - rb->_BaseFormat = GL_DEPTH_COMPONENT; + rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; rb->GetPointer = get_pointer_ushort; rb->GetRow = get_row_ushort; @@ -1090,12 +1049,22 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ushort; rb->PutValues = put_values_ushort; rb->PutMonoValues = put_mono_values_ushort; - rb->DepthBits = 8 * sizeof(GLushort); pixelSize = sizeof(GLushort); break; case GL_DEPTH_COMPONENT24: + rb->DataType = GL_UNSIGNED_INT; + rb->GetPointer = get_pointer_uint; + rb->GetRow = get_row_uint; + 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; + rb->Format = MESA_FORMAT_X8_Z24; + pixelSize = sizeof(GLuint); + break; case GL_DEPTH_COMPONENT32: - rb->_BaseFormat = GL_DEPTH_COMPONENT; rb->DataType = GL_UNSIGNED_INT; rb->GetPointer = get_pointer_uint; rb->GetRow = get_row_uint; @@ -1105,20 +1074,12 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_uint; rb->PutValues = put_values_uint; rb->PutMonoValues = put_mono_values_uint; - if (internalFormat == GL_DEPTH_COMPONENT24) { - rb->_ActualFormat = GL_DEPTH_COMPONENT24; - rb->DepthBits = 24; - } - else { - rb->_ActualFormat = GL_DEPTH_COMPONENT32; - rb->DepthBits = 32; - } + rb->Format = MESA_FORMAT_Z32; pixelSize = sizeof(GLuint); break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; - rb->_BaseFormat = GL_DEPTH_STENCIL_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; rb->GetPointer = get_pointer_uint; rb->GetRow = get_row_uint; @@ -1128,13 +1089,12 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_uint; rb->PutValues = put_values_uint; rb->PutMonoValues = put_mono_values_uint; - rb->DepthBits = 24; - rb->StencilBits = 8; pixelSize = sizeof(GLuint); break; case GL_COLOR_INDEX8_EXT: - rb->_ActualFormat = GL_COLOR_INDEX8_EXT; - rb->_BaseFormat = GL_COLOR_INDEX; + case GL_COLOR_INDEX16_EXT: + case COLOR_INDEX32: + rb->Format = MESA_FORMAT_CI8; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte; rb->GetRow = get_row_ubyte; @@ -1144,39 +1104,8 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte; rb->PutValues = put_values_ubyte; rb->PutMonoValues = put_mono_values_ubyte; - rb->IndexBits = 8 * sizeof(GLubyte); pixelSize = sizeof(GLubyte); break; - case GL_COLOR_INDEX16_EXT: - rb->_ActualFormat = GL_COLOR_INDEX16_EXT; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - 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; - rb->IndexBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; - case COLOR_INDEX32: - rb->_ActualFormat = COLOR_INDEX32; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_INT; - rb->GetPointer = get_pointer_uint; - rb->GetRow = get_row_uint; - 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; - rb->IndexBits = 8 * sizeof(GLuint); - pixelSize = sizeof(GLuint); - break; default: _mesa_problem(ctx, "Bad internalFormat in _mesa_soft_renderbuffer_storage"); return GL_FALSE; @@ -1213,6 +1142,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; + rb->_BaseFormat = _mesa_base_fbo_format(ctx, rb->InternalFormat); return GL_TRUE; } @@ -1239,7 +1169,7 @@ alloc_storage_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLenum internalFormat, GLuint width, GLuint height) { ASSERT(arb != arb->Wrapped); - ASSERT(arb->_ActualFormat == GL_ALPHA8); + ASSERT(arb->Format == MESA_FORMAT_A8); /* first, pass the call to the wrapped RGB buffer */ if (!arb->Wrapped->AllocStorage(ctx, arb->Wrapped, internalFormat, @@ -1439,8 +1369,8 @@ put_mono_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, static void copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src) { - ASSERT(dst->_ActualFormat == GL_ALPHA8); - ASSERT(src->_ActualFormat == GL_ALPHA8); + ASSERT(dst->Format == MESA_FORMAT_A8); + ASSERT(src->Format == MESA_FORMAT_A8); ASSERT(dst->Width == src->Width); ASSERT(dst->Height == src->Height); @@ -1486,16 +1416,7 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) rb->Width = 0; rb->Height = 0; rb->InternalFormat = GL_NONE; - rb->_ActualFormat = GL_NONE; - rb->_BaseFormat = GL_NONE; - - rb->ComponentType = GL_UNSIGNED_NORMALIZED; /* ARB_fbo */ - rb->ColorEncoding = GL_LINEAR; /* ARB_fbo */ - - rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = 0; - rb->IndexBits = 0; - rb->DepthBits = 0; - rb->StencilBits = 0; + rb->Format = MESA_FORMAT_NONE; rb->DataType = GL_NONE; rb->Data = NULL; @@ -1612,18 +1533,15 @@ _mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, if (rgbBits <= 8) { if (alphaBits) - rb->_ActualFormat = GL_RGBA8; + rb->Format = MESA_FORMAT_RGBA8888; else - rb->_ActualFormat = GL_RGB8; + rb->Format = MESA_FORMAT_RGB888; } else { assert(rgbBits <= 16); - if (alphaBits) - rb->_ActualFormat = GL_RGBA16; - else - rb->_ActualFormat = GL_RGBA16; /* don't really have RGB16 yet */ + rb->Format = MESA_FORMAT_NONE; /*XXX RGBA16;*/ } - rb->InternalFormat = rb->_ActualFormat; + rb->InternalFormat = GL_RGBA; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, b, rb); @@ -1677,15 +1595,9 @@ _mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - if (indexBits <= 8) { - /* only support GLuint for now */ - /*rb->InternalFormat = GL_COLOR_INDEX8_EXT;*/ - rb->_ActualFormat = COLOR_INDEX32; - } - else { - rb->_ActualFormat = COLOR_INDEX32; - } - rb->InternalFormat = rb->_ActualFormat; + assert(indexBits <= 8); + rb->Format = MESA_FORMAT_CI8; + rb->InternalFormat = GL_COLOR_INDEX; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, b, rb); @@ -1758,8 +1670,7 @@ _mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, * values. */ arb->InternalFormat = arb->Wrapped->InternalFormat; - arb->_ActualFormat = GL_ALPHA8; - arb->_BaseFormat = arb->Wrapped->_BaseFormat; + arb->Format = MESA_FORMAT_A8; arb->DataType = arb->Wrapped->DataType; arb->AllocStorage = alloc_storage_alpha8; arb->Delete = delete_renderbuffer_alpha8; @@ -1833,15 +1744,17 @@ _mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, } if (depthBits <= 16) { - rb->_ActualFormat = GL_DEPTH_COMPONENT16; + rb->Format = MESA_FORMAT_Z16; + rb->InternalFormat = GL_DEPTH_COMPONENT16; } else if (depthBits <= 24) { - rb->_ActualFormat = GL_DEPTH_COMPONENT24; + rb->Format = MESA_FORMAT_X8_Z24; + rb->InternalFormat = GL_DEPTH_COMPONENT24; } else { - rb->_ActualFormat = GL_DEPTH_COMPONENT32; + rb->Format = MESA_FORMAT_Z32; + rb->InternalFormat = GL_DEPTH_COMPONENT32; } - rb->InternalFormat = rb->_ActualFormat; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); @@ -1878,14 +1791,9 @@ _mesa_add_stencil_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - if (stencilBits <= 8) { - rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - } - else { - /* not really supported (see s_stencil.c code) */ - rb->_ActualFormat = GL_STENCIL_INDEX16_EXT; - } - rb->InternalFormat = rb->_ActualFormat; + 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); @@ -1923,7 +1831,7 @@ _mesa_add_accum_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - rb->_ActualFormat = GL_RGBA16; + rb->Format = MESA_FORMAT_SIGNED_RGBA_16; rb->InternalFormat = GL_RGBA16; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb); @@ -1967,13 +1875,9 @@ _mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - if (colorBits <= 8) { - rb->_ActualFormat = GL_RGBA8; - } - else { - rb->_ActualFormat = GL_RGBA16; - } - rb->InternalFormat = rb->_ActualFormat; + 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); @@ -2071,6 +1975,8 @@ void _mesa_add_renderbuffer(struct gl_framebuffer *fb, GLuint bufferName, struct gl_renderbuffer *rb) { + GLenum baseFormat; + assert(fb); assert(rb); assert(bufferName < BUFFER_COUNT); @@ -2095,7 +2001,8 @@ _mesa_add_renderbuffer(struct gl_framebuffer *fb, * and the device driver is expecting 8-bit values (GLubyte), we can * use a "renderbuffer adaptor/wrapper" to do the necessary conversions. */ - if (rb->_BaseFormat == GL_RGBA) { + baseFormat = _mesa_get_format_base_format(rb->Format); + if (baseFormat == GL_RGBA) { if (CHAN_BITS == 16 && rb->DataType == GL_UNSIGNED_BYTE) { GET_CURRENT_CONTEXT(ctx); rb = _mesa_new_renderbuffer_16wrap8(ctx, rb); @@ -2202,7 +2109,7 @@ _mesa_new_depthstencil_renderbuffer(GLcontext *ctx, GLuint name) /* init fields not covered by _mesa_new_renderbuffer() */ dsrb->InternalFormat = GL_DEPTH24_STENCIL8_EXT; - dsrb->_ActualFormat = 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/shaders.c b/mesalib/src/mesa/main/shaders.c index bc76b9129..d0dc7e551 100644 --- a/mesalib/src/mesa/main/shaders.c +++ b/mesalib/src/mesa/main/shaders.c @@ -26,6 +26,12 @@ #include "glheader.h" #include "context.h" #include "shaders.h" +#include "shader/shader_api.h" + + +/** Define this to enable shader substitution (see below) */ +#define SHADER_SUBST 0 + /** @@ -388,7 +394,6 @@ _mesa_read_shader(const char *fname) int len; if (!f) { - _mesa_fprintf(stderr, "Unable to open shader file %s\n", fname); return NULL; } @@ -401,16 +406,10 @@ _mesa_read_shader(const char *fname) shader = _mesa_strdup(buffer); free(buffer); - if (0) { - _mesa_fprintf(stderr, "Read shader %s:\n", fname); - _mesa_fprintf(stderr, "%s\n", shader); - } - return shader; } - /** * Called via glShaderSource() and glShaderSourceARB() API functions. * Basically, concatenate the source code strings into one long string @@ -424,6 +423,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, GLint *offsets; GLsizei i, totalLength; GLcharARB *source; + GLuint checksum; if (!shaderObj || string == NULL) { _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB"); @@ -475,22 +475,35 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, source[totalLength - 1] = '\0'; source[totalLength - 2] = '\0'; -#if 0 - if (0) { + if (SHADER_SUBST) { + /* Compute the shader's source code checksum then try to open a file + * named newshader_. If it exists, use it in place of the + * original shader source code. For debugging. + */ + char filename[100]; GLcharARB *newSource; - newSource = _mesa_read_shader("newshader.frag"); + checksum = _mesa_str_checksum(source); + + sprintf(filename, "newshader_%d", checksum); + + newSource = _mesa_read_shader(filename); if (newSource) { + _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", + shaderObj, checksum, filename); _mesa_free(source); source = newSource; } - } -#else - (void) _mesa_read_shader; -#endif + } ctx->Driver.ShaderSource(ctx, shaderObj, source); + if (SHADER_SUBST) { + struct gl_shader *sh = _mesa_lookup_shader(ctx, shaderObj); + if (sh) + sh->SourceChecksum = checksum; /* save original checksum */ + } + _mesa_free(offsets); } diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c index 643ad3354..4d01e8abc 100644 --- a/mesalib/src/mesa/main/shared.c +++ b/mesalib/src/mesa/main/shared.c @@ -37,9 +37,7 @@ #include "shared.h" #include "shader/program.h" #include "shader/shader_api.h" -#if FEATURE_dlist #include "dlist.h" -#endif #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif @@ -143,11 +141,9 @@ _mesa_alloc_shared_state(GLcontext *ctx) static void delete_displaylist_cb(GLuint id, void *data, void *userData) { -#if FEATURE_dlist struct gl_display_list *list = (struct gl_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); -#endif } diff --git a/mesalib/src/mesa/main/sources b/mesalib/src/mesa/main/sources deleted file mode 100644 index 5d9d99040..000000000 --- a/mesalib/src/mesa/main/sources +++ /dev/null @@ -1,158 +0,0 @@ -# List of source files in this directory used for X.org xserver build -MESA_MAIN_SOURCES = \ -accum.c \ -api_arrayelt.c \ -api_exec.c \ -api_loopback.c \ -api_noop.c \ -api_validate.c \ -arrayobj.c \ -attrib.c \ -blend.c \ -bufferobj.c \ -buffers.c \ -clear.c \ -clip.c \ -colortab.c \ -context.c \ -convolve.c \ -debug.c \ -depth.c \ -depthstencil.c \ -dlist.c \ -dlopen.c \ -drawpix.c \ -enable.c \ -enums.c \ -eval.c \ -execmem.c \ -extensions.c \ -fbobject.c \ -feedback.c \ -fog.c \ -framebuffer.c \ -get.c \ -getstring.c \ -hash.c \ -hint.c \ -histogram.c \ -image.c \ -imports.c \ -light.c \ -lines.c \ -matrix.c \ -mipmap.c \ -mm.c \ -multisample.c \ -occlude.c \ -pixel.c \ -pixelstore.c \ -points.c \ -polygon.c \ -readpix.c \ -rastpos.c \ -rbadaptors.c \ -renderbuffer.c \ -scissor.c \ -state.c \ -stencil.c \ -texcompress.c \ -texcompress_fxt1.c \ -texcompress_s3tc.c \ -texenv.c \ -texenvprogram.c \ -texformat.c \ -texgen.c \ -texgetimage.c \ -teximage.c \ -texobj.c \ -texparam.c \ -texrender.c \ -texstate.c \ -texstore.c \ -varray.c \ -$(VSNPRINTF_SOURCES) \ -vtxfmt.c - -MESA_VSNPRINTF_SOURCES = \ -vsnprintf.c - -MESA_MAIN_HEADERS = \ -accum.h \ -api_arrayelt.h \ -api_exec.h \ -api_loopback.h \ -api_noop.h \ -api_validate.h \ -arrayobj.h \ -attrib.h \ -bitset.h \ -blend.h \ -bufferobj.h \ -buffers.h \ -clear.h \ -clip.h \ -colormac.h \ -colortab.h \ -config.h \ -context.h \ -convolve.h \ -dd.h \ -debug.h \ -depth.h \ -depthstencil.h \ -dlist.h \ -dlopen.h \ -drawpix.h \ -enable.h \ -enums.h \ -eval.h \ -extensions.h \ -fbobject.h \ -feedback.h \ -fog.h \ -framebuffer.h \ -get.h \ -glheader.h \ -hash.h \ -hint.h \ -histogram.h \ -image.h \ -imports.h \ -light.h \ -lines.h \ -macros.h \ -matrix.h \ -mipmap.h \ -mm.h \ -mtypes.h \ -multisample.h \ -occlude.h \ -pixel.h \ -pixelstore.h \ -points.h \ -polygon.h \ -rastpos.h \ -rbadaptors.h \ -readpix.h \ -renderbuffer.h \ -simple_list.h \ -scissor.h \ -state.h \ -stencil.h \ -texcompress.h \ -texenv.h \ -texenvprogram.h \ -texformat.h \ -texformat_tmp.h \ -texgen.h \ -teximage.h \ -texobj.h \ -texparam.h \ -texrender.h \ -texstate.h \ -texstore.h \ -varray.h \ -version.h \ -vtxfmt.h \ -vtxfmt_tmp.h diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c index 140a998df..f10e6b04b 100644 --- a/mesalib/src/mesa/main/state.c +++ b/mesalib/src/mesa/main/state.c @@ -40,9 +40,7 @@ #include "framebuffer.h" #include "light.h" #include "matrix.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "shader/program.h" #include "shader/prog_parameter.h" #include "state.h" @@ -585,10 +583,8 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & (_NEW_STENCIL | _NEW_BUFFERS)) _mesa_update_stencil( ctx ); -#if FEATURE_pixel_transfer if (new_state & _MESA_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); -#endif if (new_state & _DD_NEW_SEPARATE_SPECULAR) update_separate_specular( ctx ); diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c index 2cda4dd85..a4f1926ab 100644 --- a/mesalib/src/mesa/main/texcompress.c +++ b/mesalib/src/mesa/main/texcompress.c @@ -34,10 +34,10 @@ #include "imports.h" #include "colormac.h" #include "context.h" +#include "formats.h" #include "image.h" #include "mipmap.h" #include "texcompress.h" -#include "texformat.h" #include "texstore.h" @@ -113,252 +113,43 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) } - /** - * Return number of bytes needed to store a texture of the given size - * using the specified compressed format. - * This is called via the ctx->Driver.CompressedTextureSize function, - * unless a device driver overrides it. - * - * \param width texture width in texels. - * \param height texture height in texels. - * \param depth texture depth in texels. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * - * \return size in bytes, or zero if bad format + * Convert a compressed MESA_FORMAT_x to a GLenum. */ -GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat ) +gl_format +_mesa_glenum_to_compressed_format(GLenum format) { - GLuint size; - - ASSERT(depth == 1); - (void) depth; - (void) size; - - switch (mesaFormat) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - /* round up width to next multiple of 8, height to next multiple of 4 */ - width = (width + 7) & ~7; - height = (height + 3) & ~3; - /* 16 bytes per 8x4 tile of RGB[A] texels */ - size = width * height / 2; - /* Textures smaller than 8x4 will effectively be made into 8x4 and - * take 16 bytes. - */ - return size; -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: -#endif - /* round up width, height to next multiple of 4 */ - width = (width + 3) & ~3; - height = (height + 3) & ~3; - /* 8 bytes per 4x4 tile of RGB[A] texels */ - size = width * height / 2; - /* Textures smaller than 4x4 will effectively be made into 4x4 and - * take 8 bytes. - */ - return size; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - /* round up width, height to next multiple of 4 */ - width = (width + 3) & ~3; - height = (height + 3) & ~3; - /* 16 bytes per 4x4 tile of RGBA texels */ - size = width * height; /* simple! */ - /* Textures smaller than 4x4 will effectively be made into 4x4 and - * take 16 bytes. - */ - return size; -#endif - default: - _mesa_problem(ctx, "bad mesaFormat in _mesa_compressed_texture_size"); - return 0; - } -} - - -/** - * As above, but format is specified by a GLenum (GL_COMPRESSED_*) token. - * - * Note: This function CAN NOT return a padded hardware texture size. - * That's why we don't call the ctx->Driver.CompressedTextureSize() function. - * - * We use this function to validate the parameter - * of glCompressedTex[Sub]Image1/2/3D(), which must be an exact match. - */ -GLuint -_mesa_compressed_texture_size_glenum(GLcontext *ctx, - GLsizei width, GLsizei height, - GLsizei depth, GLenum glformat) -{ - GLuint mesaFormat; - - switch (glformat) { -#if FEATURE_texture_fxt1 + switch (format) { case GL_COMPRESSED_RGB_FXT1_3DFX: - mesaFormat = MESA_FORMAT_RGB_FXT1; - break; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - mesaFormat = MESA_FORMAT_RGBA_FXT1; - break; -#endif -#if FEATURE_texture_s3tc + return MESA_FORMAT_RGBA_FXT1; + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_RGB_S3TC: - mesaFormat = MESA_FORMAT_RGB_DXT1; - break; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_RGB4_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT1; - break; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_RGBA_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT3; - break; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: case GL_RGBA4_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT5; - break; -#if FEATURE_EXT_texture_sRGB + return MESA_FORMAT_RGBA_DXT5; + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - mesaFormat = MESA_FORMAT_SRGB_DXT1; - break; + return MESA_FORMAT_SRGB_DXT1; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - mesaFormat = MESA_FORMAT_SRGBA_DXT1; - break; + return MESA_FORMAT_SRGBA_DXT1; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - mesaFormat = MESA_FORMAT_SRGBA_DXT3; - break; + return MESA_FORMAT_SRGBA_DXT3; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - mesaFormat = MESA_FORMAT_SRGBA_DXT5; - break; -#endif -#endif - default: - return 0; - } - - return _mesa_compressed_texture_size(ctx, width, height, depth, mesaFormat); -} - - -/* - * Compute the bytes per row in a compressed texture image. - * We use this for computing the destination address for sub-texture updates. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * \param width image width in pixels - * \return stride, in bytes, between rows for compressed image - */ -GLint -_mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width) -{ - GLint stride; - - switch (mesaFormat) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - stride = ((width + 7) / 8) * 16; /* 16 bytes per 8x4 tile */ - break; -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: -#endif - stride = ((width + 3) / 4) * 8; /* 8 bytes per 4x4 tile */ - break; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - stride = ((width + 3) / 4) * 16; /* 16 bytes per 4x4 tile */ - break; -#endif - default: - _mesa_problem(NULL, "bad mesaFormat in _mesa_compressed_row_stride"); - return 0; - } - - return stride; -} - + return MESA_FORMAT_SRGBA_DXT5; -/* - * Return the address of the pixel at (col, row, img) in a - * compressed texture image. - * \param col, row, img - image position (3D) - * \param format - compressed image format - * \param width - image width - * \param image - the image address - * \return address of pixel at (row, col) - */ -GLubyte * -_mesa_compressed_image_address(GLint col, GLint row, GLint img, - GLuint mesaFormat, - GLsizei width, const GLubyte *image) -{ - GLubyte *addr; - - (void) img; - - /* We try to spot a "complete" subtexture "above" ROW, COL; - * this texture is given by appropriate rounding of WIDTH x ROW. - * Then we just add the amount left (usually on the left). - * - * Example for X*Y microtiles (Z bytes each) - * offset = Z * (((width + X - 1) / X) * (row / Y) + col / X); - */ - - switch (mesaFormat) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - addr = (GLubyte *) image + 16 * (((width + 7) / 8) * (row / 4) + col / 8); - break; -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: -#endif - addr = (GLubyte *) image + 8 * (((width + 3) / 4) * (row / 4) + col / 4); - break; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - addr = (GLubyte *) image + 16 * (((width + 3) / 4) * (row / 4) + col / 4); - break; -#endif default: - _mesa_problem(NULL, "bad mesaFormat in _mesa_compressed_image_address"); - addr = NULL; + return MESA_FORMAT_NONE; } - - return addr; } @@ -410,3 +201,33 @@ _mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat) } +/* + * 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.h b/mesalib/src/mesa/main/texcompress.h index 0f1a38f88..5e73a3149 100644 --- a/mesalib/src/mesa/main/texcompress.h +++ b/mesalib/src/mesa/main/texcompress.h @@ -26,50 +26,28 @@ #define TEXCOMPRESS_H #include "mtypes.h" +#include "formats.h" #if _HAVE_FULL_GL extern GLuint _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); -extern GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat ); - -extern GLuint -_mesa_compressed_texture_size_glenum(GLcontext *ctx, - GLsizei width, GLsizei height, - GLsizei depth, GLenum glformat); - -extern GLint -_mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width); +extern gl_format +_mesa_glenum_to_compressed_format(GLenum format); +extern GLenum +_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat); extern GLubyte * _mesa_compressed_image_address(GLint col, GLint row, GLint img, - GLuint mesaFormat, + gl_format mesaFormat, GLsizei width, const GLubyte *image); - -extern GLenum -_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat); - - -extern void -_mesa_init_texture_s3tc( GLcontext *ctx ); - -extern void -_mesa_init_texture_fxt1( GLcontext *ctx ); - - #else /* _HAVE_FULL_GL */ /* no-op macros */ #define _mesa_get_compressed_formats( c, f ) 0 -#define _mesa_compressed_texture_size( c, w, h, d, f ) 0 -#define _mesa_compressed_texture_size_glenum( c, w, h, d, f ) 0 -#define _mesa_compressed_row_stride( f, w) 0 #define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 #define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0) diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c index fc151605c..85becb80d 100644 --- a/mesalib/src/mesa/main/texcompress_fxt1.c +++ b/mesalib/src/mesa/main/texcompress_fxt1.c @@ -37,10 +37,13 @@ #include "image.h" #include "mipmap.h" #include "texcompress.h" -#include "texformat.h" +#include "texcompress_fxt1.h" #include "texstore.h" +#if FEATURE_texture_fxt1 + + static void fxt1_encode (GLuint width, GLuint height, GLint comps, const void *source, GLint srcRowStride, @@ -52,20 +55,10 @@ fxt1_decode_1 (const void *texture, GLint stride, /** - * Called during context initialization. - */ -void -_mesa_init_texture_fxt1( GLcontext *ctx ) -{ - (void) ctx; -} - - -/** - * Called via TexFormat->StoreImage to store an RGB_FXT1 texture. + * Store user's image in rgb_fxt1 format. */ -static GLboolean -texstore_rgb_fxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -73,7 +66,7 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgb_fxt1); + ASSERT(dstFormat == MESA_FORMAT_RGB_FXT1); ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); @@ -87,7 +80,7 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS) /* convert image to RGB/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -105,7 +98,7 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride, @@ -119,10 +112,10 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_FXT1 texture. + * Store user's image in rgba_fxt1 format. */ -static GLboolean -texstore_rgba_fxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -130,7 +123,7 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS) GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_fxt1); + ASSERT(dstFormat == MESA_FORMAT_RGBA_FXT1); ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); @@ -144,7 +137,7 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -162,7 +155,7 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride, @@ -175,18 +168,9 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS) } -static void -fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); -} - - -static void -fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgba_fxt1( 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]; @@ -199,19 +183,9 @@ fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); - texel[ACOMP] = 255; -} - - -static void -fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgb_fxt1( 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]; @@ -225,55 +199,6 @@ fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, -const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { - MESA_FORMAT_RGB_FXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgb_fxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_fxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_fxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { - MESA_FORMAT_RGBA_FXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_fxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_fxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_fxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - - /***************************************************************************\ * FXT1 encoder * @@ -1722,3 +1647,6 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ decode_1[mode](code, t, rgba); } + + +#endif /* FEATURE_texture_fxt1 */ diff --git a/mesalib/src/mesa/main/texcompress_fxt1.h b/mesalib/src/mesa/main/texcompress_fxt1.h new file mode 100644 index 000000000..d63ca71e2 --- /dev/null +++ b/mesalib/src/mesa/main/texcompress_fxt1.h @@ -0,0 +1,59 @@ +/* + * 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 TEXCOMPRESS_FXT1_H +#define TEXCOMPRESS_FXT1_H + +#include "main/mtypes.h" +#include "texstore.h" + +#if FEATURE_texture_fxt1 + +extern GLboolean +_mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS); + +extern void +_mesa_fetch_texel_2d_f_rgba_fxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgb_fxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +#else /* FEATURE_texture_fxt1 */ + +/* these are used only in texstore_funcs[] */ +#define _mesa_texstore_rgb_fxt1 NULL +#define _mesa_texstore_rgba_fxt1 NULL + +/* these are used only in texfetch_funcs[] */ +#define _mesa_fetch_texel_2d_f_rgba_fxt1 NULL +#define _mesa_fetch_texel_2d_f_rgb_fxt1 NULL + +#endif /* FEATURE_texture_fxt1 */ + +#endif /* TEXCOMPRESS_FXT1_H */ diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c index a1c0f18f3..b271a539a 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.c +++ b/mesalib/src/mesa/main/texcompress_s3tc.c @@ -41,9 +41,13 @@ #include "dlopen.h" #include "image.h" #include "texcompress.h" -#include "texformat.h" +#include "texcompress_s3tc.h" #include "texstore.h" + +#if FEATURE_texture_s3tc + + #ifdef __MINGW32__ #define DXTN_LIBNAME "dxtn.dll" #define RTLD_LAZY 0 @@ -153,10 +157,10 @@ _mesa_init_texture_s3tc( GLcontext *ctx ) } /** - * Called via TexFormat->StoreImage to store an RGB_DXT1 texture. + * Store user's image in rgb_dxt1 format. */ -static GLboolean -texstore_rgb_dxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -164,7 +168,7 @@ texstore_rgb_dxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgb_dxt1); + ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -178,7 +182,7 @@ texstore_rgb_dxt1(TEXSTORE_PARAMS) /* convert image to RGB/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -196,7 +200,7 @@ texstore_rgb_dxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { @@ -216,10 +220,10 @@ texstore_rgb_dxt1(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_DXT1 texture. + * Store user's image in rgba_dxt1 format. */ -static GLboolean -texstore_rgba_dxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -227,7 +231,7 @@ texstore_rgba_dxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt1); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -241,7 +245,7 @@ texstore_rgba_dxt1(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -259,7 +263,7 @@ texstore_rgba_dxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, @@ -278,10 +282,10 @@ texstore_rgba_dxt1(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_DXT3 texture. + * Store user's image in rgba_dxt3 format. */ -static GLboolean -texstore_rgba_dxt3(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -289,7 +293,7 @@ texstore_rgba_dxt3(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt3); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -303,7 +307,7 @@ texstore_rgba_dxt3(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -320,7 +324,7 @@ texstore_rgba_dxt3(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, @@ -339,10 +343,10 @@ texstore_rgba_dxt3(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_DXT5 texture. + * Store user's image in rgba_dxt5 format. */ -static GLboolean -texstore_rgba_dxt5(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -350,7 +354,7 @@ texstore_rgba_dxt5(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt5); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -364,7 +368,7 @@ texstore_rgba_dxt5(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -381,7 +385,7 @@ texstore_rgba_dxt5(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, @@ -414,9 +418,9 @@ fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgb_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -442,9 +446,9 @@ fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgba_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -471,9 +475,9 @@ fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgba_dxt3( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -499,9 +503,9 @@ fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -513,9 +517,9 @@ fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, } #if FEATURE_EXT_texture_sRGB -static void -fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -526,9 +530,9 @@ fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -static void -fetch_texel_2d_f_srgba_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -539,9 +543,9 @@ fetch_texel_2d_f_srgba_dxt1( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -static void -fetch_texel_2d_f_srgba_dxt3( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -552,9 +556,9 @@ fetch_texel_2d_f_srgba_dxt3( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -static void -fetch_texel_2d_f_srgba_dxt5( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +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]; @@ -564,198 +568,7 @@ fetch_texel_2d_f_srgba_dxt5( const struct gl_texture_image *texImage, texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -#endif +#endif /* FEATURE_EXT_texture_sRGB */ -const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { - MESA_FORMAT_RGB_DXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgb_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_dxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { - MESA_FORMAT_RGBA_DXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt1, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { - MESA_FORMAT_RGBA_DXT3, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 4, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt3, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt3, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt3, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { - MESA_FORMAT_RGBA_DXT5, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4,/*approx*/ /* RedBits */ - 4,/*approx*/ /* GreenBits */ - 4,/*approx*/ /* BlueBits */ - 4,/*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt5, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt5, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt5, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; -#if FEATURE_EXT_texture_sRGB -const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { - MESA_FORMAT_SRGB_DXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgb_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgb_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { - MESA_FORMAT_SRGBA_DXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt1, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgba_dxt1, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { - MESA_FORMAT_SRGBA_DXT3, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 4, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt3, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgba_dxt3, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { - MESA_FORMAT_SRGBA_DXT5, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4,/*approx*/ /* RedBits */ - 4,/*approx*/ /* GreenBits */ - 4,/*approx*/ /* BlueBits */ - 4,/*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - texstore_rgba_dxt5, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgba_dxt5, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; -#endif +#endif /* FEATURE_texture_s3tc */ diff --git a/mesalib/src/mesa/main/texcompress_s3tc.h b/mesalib/src/mesa/main/texcompress_s3tc.h new file mode 100644 index 000000000..2e7688d36 --- /dev/null +++ b/mesalib/src/mesa/main/texcompress_s3tc.h @@ -0,0 +1,106 @@ +/* + * 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 TEXCOMPRESS_S3TC_H +#define TEXCOMPRESS_S3TC_H + +#include "main/mtypes.h" +#include "texstore.h" + + +#if FEATURE_texture_s3tc + +extern GLboolean +_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS); + +extern void +_mesa_fetch_texel_2d_f_rgb_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_dxt3(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_dxt5(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgb_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgba_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgba_dxt3(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_init_texture_s3tc(GLcontext *ctx); + +#else /* FEATURE_texture_s3tc */ + +/* these are used only in texstore_funcs[] */ +#define _mesa_texstore_rgb_dxt1 NULL +#define _mesa_texstore_rgba_dxt1 NULL +#define _mesa_texstore_rgba_dxt3 NULL +#define _mesa_texstore_rgba_dxt5 NULL + +/* these are used only in texfetch_funcs[] */ +#define _mesa_fetch_texel_2d_f_rgb_dxt1 NULL +#define _mesa_fetch_texel_2d_f_rgba_dxt1 NULL +#define _mesa_fetch_texel_2d_f_rgba_dxt3 NULL +#define _mesa_fetch_texel_2d_f_rgba_dxt5 NULL +#define _mesa_fetch_texel_2d_f_srgb_dxt1 NULL +#define _mesa_fetch_texel_2d_f_srgba_dxt1 NULL +#define _mesa_fetch_texel_2d_f_srgba_dxt3 NULL +#define _mesa_fetch_texel_2d_f_srgba_dxt5 NULL + +static INLINE void +_mesa_init_texture_s3tc(GLcontext *ctx) +{ +} + +#endif /* FEATURE_texture_s3tc */ + +#endif /* TEXCOMPRESS_S3TC_H */ diff --git a/mesalib/src/mesa/main/texenv.c b/mesalib/src/mesa/main/texenv.c index 6d86a4275..4442fb8cf 100644 --- a/mesalib/src/mesa/main/texenv.c +++ b/mesalib/src/mesa/main/texenv.c @@ -598,7 +598,10 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) void GLAPIENTRY _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) { - _mesa_TexEnvfv( target, pname, ¶m ); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0; + _mesa_TexEnvfv( target, pname, p ); } diff --git a/mesalib/src/mesa/main/texenvprogram.c b/mesalib/src/mesa/main/texenvprogram.c index d7e77e759..f439d4add 100644 --- a/mesalib/src/mesa/main/texenvprogram.c +++ b/mesalib/src/mesa/main/texenvprogram.c @@ -367,7 +367,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) else { /* calculate from vp->outputs */ struct gl_vertex_program *vprog; - GLbitfield vp_outputs; + GLbitfield64 vp_outputs; /* Choose GLSL vertex shader over ARB vertex program. Need this * since vertex shader state validation comes after fragment state diff --git a/mesalib/src/mesa/main/texfetch.c b/mesalib/src/mesa/main/texfetch.c new file mode 100644 index 000000000..b37039429 --- /dev/null +++ b/mesalib/src/mesa/main/texfetch.c @@ -0,0 +1,693 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * 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. + */ + + +/** + * \file texfetch.c + * + * Texel fetch/store functions + * + * \author Gareth Hughes + */ + + +#include "colormac.h" +#include "context.h" +#include "texcompress.h" +#include "texcompress_fxt1.h" +#include "texcompress_s3tc.h" +#include "texfetch.h" + + +/** + * 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) _mesa_pow((cs + 0.055) / 1.055, 2.4); + } + } + tableReady = GL_TRUE; + } + return table[cs8]; +} + + + +/* Texel fetch routines for all supported formats + */ +#define DIM 1 +#include "texfetch_tmp.h" + +#define DIM 2 +#include "texfetch_tmp.h" + +#define DIM 3 +#include "texfetch_tmp.h" + +/** + * Null texel fetch function. + * + * Have to have this so the FetchTexel function pointer is never NULL. + */ +static void fetch_null_texelf( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + (void) texImage; (void) i; (void) j; (void) k; + texel[RCOMP] = 0.0; + texel[GCOMP] = 0.0; + texel[BCOMP] = 0.0; + texel[ACOMP] = 0.0; + _mesa_warning(NULL, "fetch_null_texelf() called!"); +} + +static void store_null_texel(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + (void) texImage; + (void) i; + (void) j; + (void) k; + (void) texel; + /* no-op */ +} + + + +/** + * Table to map MESA_FORMAT_ to texel fetch/store funcs. + * XXX this is somewhat temporary. + */ +static struct { + GLuint Name; + FetchTexelFuncF Fetch1D; + FetchTexelFuncF Fetch2D; + FetchTexelFuncF Fetch3D; + StoreTexelFunc StoreTexel; +} +texfetch_funcs[MESA_FORMAT_COUNT] = +{ + { + MESA_FORMAT_SRGB8, + fetch_texel_1d_srgb8, + fetch_texel_2d_srgb8, + fetch_texel_3d_srgb8, + store_texel_srgb8 + }, + { + MESA_FORMAT_SRGBA8, + fetch_texel_1d_srgba8, + fetch_texel_2d_srgba8, + fetch_texel_3d_srgba8, + store_texel_srgba8 + }, + { + MESA_FORMAT_SARGB8, + fetch_texel_1d_sargb8, + fetch_texel_2d_sargb8, + fetch_texel_3d_sargb8, + store_texel_sargb8 + }, + { + MESA_FORMAT_SL8, + fetch_texel_1d_sl8, + fetch_texel_2d_sl8, + fetch_texel_3d_sl8, + store_texel_sl8 + }, + { + MESA_FORMAT_SLA8, + fetch_texel_1d_sla8, + fetch_texel_2d_sla8, + fetch_texel_3d_sla8, + store_texel_sla8 + }, + { + MESA_FORMAT_RGB_FXT1, + NULL, + _mesa_fetch_texel_2d_f_rgb_fxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_FXT1, + NULL, + _mesa_fetch_texel_2d_f_rgba_fxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGB_DXT1, + NULL, + _mesa_fetch_texel_2d_f_rgb_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT1, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT3, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt3, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT5, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt5, + NULL, + NULL + }, + { + MESA_FORMAT_SRGB_DXT1, + NULL, + _mesa_fetch_texel_2d_f_srgb_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT1, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT3, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt3, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT5, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt5, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_FLOAT32, + fetch_texel_1d_f_rgba_f32, + fetch_texel_2d_f_rgba_f32, + fetch_texel_3d_f_rgba_f32, + store_texel_rgba_f32 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + fetch_texel_1d_f_rgba_f16, + fetch_texel_2d_f_rgba_f16, + fetch_texel_3d_f_rgba_f16, + store_texel_rgba_f16 + }, + { + MESA_FORMAT_RGB_FLOAT32, + fetch_texel_1d_f_rgb_f32, + fetch_texel_2d_f_rgb_f32, + fetch_texel_3d_f_rgb_f32, + store_texel_rgb_f32 + }, + { + MESA_FORMAT_RGB_FLOAT16, + fetch_texel_1d_f_rgb_f16, + fetch_texel_2d_f_rgb_f16, + fetch_texel_3d_f_rgb_f16, + store_texel_rgb_f16 + }, + { + MESA_FORMAT_ALPHA_FLOAT32, + fetch_texel_1d_f_alpha_f32, + fetch_texel_2d_f_alpha_f32, + fetch_texel_3d_f_alpha_f32, + store_texel_alpha_f32 + }, + { + MESA_FORMAT_ALPHA_FLOAT16, + fetch_texel_1d_f_alpha_f16, + fetch_texel_2d_f_alpha_f16, + fetch_texel_3d_f_alpha_f16, + store_texel_alpha_f16 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT32, + fetch_texel_1d_f_luminance_f32, + fetch_texel_2d_f_luminance_f32, + fetch_texel_3d_f_luminance_f32, + store_texel_luminance_f32 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT16, + fetch_texel_1d_f_luminance_f16, + fetch_texel_2d_f_luminance_f16, + fetch_texel_3d_f_luminance_f16, + store_texel_luminance_f16 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + fetch_texel_1d_f_luminance_alpha_f32, + fetch_texel_2d_f_luminance_alpha_f32, + fetch_texel_3d_f_luminance_alpha_f32, + store_texel_luminance_alpha_f32 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + fetch_texel_1d_f_luminance_alpha_f16, + fetch_texel_2d_f_luminance_alpha_f16, + fetch_texel_3d_f_luminance_alpha_f16, + store_texel_luminance_alpha_f16 + }, + { + MESA_FORMAT_INTENSITY_FLOAT32, + fetch_texel_1d_f_intensity_f32, + fetch_texel_2d_f_intensity_f32, + fetch_texel_3d_f_intensity_f32, + store_texel_intensity_f32 + }, + { + MESA_FORMAT_INTENSITY_FLOAT16, + fetch_texel_1d_f_intensity_f16, + fetch_texel_2d_f_intensity_f16, + fetch_texel_3d_f_intensity_f16, + store_texel_intensity_f16 + }, + { + MESA_FORMAT_DUDV8, + fetch_texel_1d_dudv8, + fetch_texel_2d_dudv8, + fetch_texel_3d_dudv8, + NULL + }, + { + MESA_FORMAT_SIGNED_RGBA8888, + fetch_texel_1d_signed_rgba8888, + fetch_texel_2d_signed_rgba8888, + fetch_texel_3d_signed_rgba8888, + store_texel_signed_rgba8888 + }, + { + MESA_FORMAT_SIGNED_RGBA8888_REV, + fetch_texel_1d_signed_rgba8888_rev, + fetch_texel_2d_signed_rgba8888_rev, + fetch_texel_3d_signed_rgba8888_rev, + store_texel_signed_rgba8888_rev + }, + { + MESA_FORMAT_SIGNED_RGBA_16, + NULL, /* XXX to do */ + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA8888, + fetch_texel_1d_f_rgba8888, + fetch_texel_2d_f_rgba8888, + fetch_texel_3d_f_rgba8888, + store_texel_rgba8888 + }, + { + MESA_FORMAT_RGBA8888_REV, + fetch_texel_1d_f_rgba8888_rev, + fetch_texel_2d_f_rgba8888_rev, + fetch_texel_3d_f_rgba8888_rev, + store_texel_rgba8888_rev + }, + { + MESA_FORMAT_ARGB8888, + fetch_texel_1d_f_argb8888, + fetch_texel_2d_f_argb8888, + fetch_texel_3d_f_argb8888, + store_texel_argb8888 + }, + { + MESA_FORMAT_ARGB8888_REV, + fetch_texel_1d_f_argb8888_rev, + fetch_texel_2d_f_argb8888_rev, + fetch_texel_3d_f_argb8888_rev, + store_texel_argb8888_rev + }, + { + MESA_FORMAT_XRGB8888, + fetch_texel_1d_f_xrgb8888, + fetch_texel_2d_f_xrgb8888, + fetch_texel_3d_f_xrgb8888, + store_texel_xrgb8888 + }, + { + MESA_FORMAT_XRGB8888_REV, + fetch_texel_1d_f_xrgb8888_rev, + fetch_texel_2d_f_xrgb8888_rev, + fetch_texel_3d_f_xrgb8888_rev, + store_texel_xrgb8888_rev, + }, + { + MESA_FORMAT_RGB888, + fetch_texel_1d_f_rgb888, + fetch_texel_2d_f_rgb888, + fetch_texel_3d_f_rgb888, + store_texel_rgb888 + }, + { + MESA_FORMAT_BGR888, + fetch_texel_1d_f_bgr888, + fetch_texel_2d_f_bgr888, + fetch_texel_3d_f_bgr888, + store_texel_bgr888 + }, + { + MESA_FORMAT_RGB565, + fetch_texel_1d_f_rgb565, + fetch_texel_2d_f_rgb565, + fetch_texel_3d_f_rgb565, + store_texel_rgb565 + }, + { + MESA_FORMAT_RGB565_REV, + fetch_texel_1d_f_rgb565_rev, + fetch_texel_2d_f_rgb565_rev, + fetch_texel_3d_f_rgb565_rev, + store_texel_rgb565_rev + }, + { + MESA_FORMAT_ARGB4444, + fetch_texel_1d_f_argb4444, + fetch_texel_2d_f_argb4444, + fetch_texel_3d_f_argb4444, + store_texel_argb4444 + }, + { + MESA_FORMAT_ARGB4444_REV, + fetch_texel_1d_f_argb4444_rev, + fetch_texel_2d_f_argb4444_rev, + fetch_texel_3d_f_argb4444_rev, + store_texel_argb4444_rev + }, + { + MESA_FORMAT_RGBA5551, + fetch_texel_1d_f_rgba5551, + fetch_texel_2d_f_rgba5551, + fetch_texel_3d_f_rgba5551, + store_texel_rgba5551 + }, + { + MESA_FORMAT_ARGB1555, + fetch_texel_1d_f_argb1555, + fetch_texel_2d_f_argb1555, + fetch_texel_3d_f_argb1555, + store_texel_argb1555 + }, + { + MESA_FORMAT_ARGB1555_REV, + fetch_texel_1d_f_argb1555_rev, + fetch_texel_2d_f_argb1555_rev, + fetch_texel_3d_f_argb1555_rev, + store_texel_argb1555_rev + }, + { + MESA_FORMAT_AL88, + fetch_texel_1d_f_al88, + fetch_texel_2d_f_al88, + fetch_texel_3d_f_al88, + store_texel_al88 + }, + { + MESA_FORMAT_AL88_REV, + fetch_texel_1d_f_al88_rev, + fetch_texel_2d_f_al88_rev, + fetch_texel_3d_f_al88_rev, + store_texel_al88_rev + }, + { + MESA_FORMAT_AL1616, + fetch_texel_1d_f_al1616, + fetch_texel_2d_f_al1616, + fetch_texel_3d_f_al1616, + store_texel_al1616 + }, + { + MESA_FORMAT_AL1616_REV, + fetch_texel_1d_f_al1616_rev, + fetch_texel_2d_f_al1616_rev, + fetch_texel_3d_f_al1616_rev, + store_texel_al1616_rev + }, + { + MESA_FORMAT_RGB332, + fetch_texel_1d_f_rgb332, + fetch_texel_2d_f_rgb332, + fetch_texel_3d_f_rgb332, + store_texel_rgb332 + }, + { + MESA_FORMAT_A8, + fetch_texel_1d_f_a8, + fetch_texel_2d_f_a8, + fetch_texel_3d_f_a8, + store_texel_a8 + }, + { + MESA_FORMAT_L8, + fetch_texel_1d_f_l8, + fetch_texel_2d_f_l8, + fetch_texel_3d_f_l8, + store_texel_l8 + }, + { + MESA_FORMAT_I8, + fetch_texel_1d_f_i8, + fetch_texel_2d_f_i8, + fetch_texel_3d_f_i8, + store_texel_i8 + }, + { + MESA_FORMAT_CI8, + fetch_texel_1d_f_ci8, + fetch_texel_2d_f_ci8, + fetch_texel_3d_f_ci8, + store_texel_ci8 + }, + { + MESA_FORMAT_YCBCR, + fetch_texel_1d_f_ycbcr, + fetch_texel_2d_f_ycbcr, + fetch_texel_3d_f_ycbcr, + store_texel_ycbcr + }, + { + MESA_FORMAT_YCBCR_REV, + fetch_texel_1d_f_ycbcr_rev, + fetch_texel_2d_f_ycbcr_rev, + fetch_texel_3d_f_ycbcr_rev, + store_texel_ycbcr_rev + }, + { + MESA_FORMAT_Z24_S8, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8, + store_texel_z24_s8 + }, + { + MESA_FORMAT_S8_Z24, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24, + store_texel_s8_z24 + }, + { + MESA_FORMAT_Z16, + fetch_texel_1d_f_z16, + fetch_texel_2d_f_z16, + fetch_texel_3d_f_z16, + store_texel_z16 + }, + { + MESA_FORMAT_X8_Z24, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24, + store_texel_s8_z24 + }, + { + MESA_FORMAT_Z24_X8, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8, + store_texel_z24_s8 + }, + { + MESA_FORMAT_Z32, + fetch_texel_1d_f_z32, + fetch_texel_2d_f_z32, + fetch_texel_3d_f_z32, + store_texel_z32 + } +}; + + +static FetchTexelFuncF +_mesa_get_texel_fetch_func(gl_format format, GLuint dims) +{ + FetchTexelFuncF f = NULL; + GLuint i; + /* XXX replace loop with direct table lookup */ + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texfetch_funcs[i].Name == format) { + switch (dims) { + case 1: + f = texfetch_funcs[i].Fetch1D; + break; + case 2: + f = texfetch_funcs[i].Fetch2D; + break; + case 3: + f = texfetch_funcs[i].Fetch3D; + break; + } + if (!f) + f = fetch_null_texelf; + return f; + } + } + return NULL; +} + + +StoreTexelFunc +_mesa_get_texel_store_func(gl_format format) +{ + GLuint i; + /* XXX replace loop with direct table lookup */ + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texfetch_funcs[i].Name == format) { + if (texfetch_funcs[i].StoreTexel) + return texfetch_funcs[i].StoreTexel; + else + return store_null_texel; + } + } + return NULL; +} + + + +/** + * Adaptor for fetching a GLchan texel from a float-valued texture. + */ +static void +fetch_texel_float_to_chan(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texelOut) +{ + GLfloat temp[4]; + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); + + ASSERT(texImage->FetchTexelf); + texImage->FetchTexelf(texImage, i, j, k, temp); + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* just one channel */ + UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); + } + else { + /* four channels */ + UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); + UNCLAMPED_FLOAT_TO_CHAN(texelOut[1], temp[1]); + UNCLAMPED_FLOAT_TO_CHAN(texelOut[2], temp[2]); + UNCLAMPED_FLOAT_TO_CHAN(texelOut[3], temp[3]); + } +} + + +#if 0 +/** + * Adaptor for fetching a float texel from a GLchan-valued texture. + */ +static void +fetch_texel_chan_to_float(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texelOut) +{ + GLchan temp[4]; + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); + + ASSERT(texImage->FetchTexelc); + texImage->FetchTexelc(texImage, i, j, k, temp); + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* just one channel */ + texelOut[0] = CHAN_TO_FLOAT(temp[0]); + } + else { + /* four channels */ + texelOut[0] = CHAN_TO_FLOAT(temp[0]); + texelOut[1] = CHAN_TO_FLOAT(temp[1]); + texelOut[2] = CHAN_TO_FLOAT(temp[2]); + texelOut[3] = CHAN_TO_FLOAT(temp[3]); + } +} +#endif + + +/** + * Initialize the texture image's FetchTexelc and FetchTexelf methods. + */ +void +_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) +{ + ASSERT(dims == 1 || dims == 2 || dims == 3); + ASSERT(texImage->TexFormat); + + if (!texImage->FetchTexelf) { + texImage->FetchTexelf = + _mesa_get_texel_fetch_func(texImage->TexFormat, dims); + } + + /* now check if we need to use a float/chan adaptor */ + if (!texImage->FetchTexelc) { + texImage->FetchTexelc = fetch_texel_float_to_chan; + } + + ASSERT(texImage->FetchTexelc); + ASSERT(texImage->FetchTexelf); +} diff --git a/mesalib/src/mesa/main/texfetch.h b/mesalib/src/mesa/main/texfetch.h new file mode 100644 index 000000000..ef13bf27f --- /dev/null +++ b/mesalib/src/mesa/main/texfetch.h @@ -0,0 +1,40 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * 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 TEXFETCH_H +#define TEXFETCH_H + +#include "mtypes.h" +#include "formats.h" + + +extern StoreTexelFunc +_mesa_get_texel_store_func(gl_format format); + +extern void +_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); + +#endif diff --git a/mesalib/src/mesa/main/texfetch_tmp.h b/mesalib/src/mesa/main/texfetch_tmp.h new file mode 100644 index 000000000..e6772c89f --- /dev/null +++ b/mesalib/src/mesa/main/texfetch_tmp.h @@ -0,0 +1,1394 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-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. + */ + + +/** + * \file texfetch_tmp.h + * Texel fetch functions template. + * + * This template file is used by texfetch.c to generate texel fetch functions + * for 1-D, 2-D and 3-D texture images. + * + * It should be expanded by defining \p DIM as the number texture dimensions + * (1, 2 or 3). According to the value of \p DIM a series of macros is defined + * for the texel lookup in the gl_texture_image::Data. + * + * \author Gareth Hughes + * \author Brian Paul + */ + + +#if DIM == 1 + +#define TEXEL_ADDR( type, image, i, j, k, size ) \ + ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size))) + +#define FETCH(x) fetch_texel_1d_##x + +#elif DIM == 2 + +#define TEXEL_ADDR( type, image, i, j, k, size ) \ + ((void) (k), \ + ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size))) + +#define FETCH(x) fetch_texel_2d_##x + +#elif DIM == 3 + +#define TEXEL_ADDR( type, image, i, j, k, size ) \ + ((type *)(image)->Data + ((image)->ImageOffsets[k] \ + + (image)->RowStride * (j) + (i)) * (size)) + +#define FETCH(x) fetch_texel_3d_##x + +#else +#error illegal number of texture dimensions +#endif + + +/* MESA_FORMAT_Z32 ***********************************************************/ + +/* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture, + * returning 1 GLfloat. + * Note: no GLchan version of this function. + */ +static void FETCH(f_z32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[0] = src[0] * (1.0F / 0xffffffff); +} + +#if DIM == 3 +static void store_texel_z32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLuint *depth = (const GLuint *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_Z16 ***********************************************************/ + +/* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture, + * returning 1 GLfloat. + * Note: no GLchan version of this function. + */ +static void FETCH(f_z16)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[0] = src[0] * (1.0F / 65535.0F); +} + +#if DIM == 3 +static void store_texel_z16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *depth = (const GLushort *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_RGBA_F32 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. + */ +static void FETCH(f_rgba_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); + texel[RCOMP] = src[0]; + texel[GCOMP] = src[1]; + texel[BCOMP] = src[2]; + texel[ACOMP] = src[3]; +} + +#if DIM == 3 +static void store_texel_rgba_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = depth[RCOMP]; + dst[1] = depth[GCOMP]; + dst[2] = depth[BCOMP]; + dst[3] = depth[ACOMP]; +} +#endif + + +/* MESA_FORMAT_RGBA_F16 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); + texel[RCOMP] = _mesa_half_to_float(src[0]); + texel[GCOMP] = _mesa_half_to_float(src[1]); + texel[BCOMP] = _mesa_half_to_float(src[2]); + texel[ACOMP] = _mesa_half_to_float(src[3]); +} + +#if DIM == 3 +static void store_texel_rgba_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(*depth); +} +#endif + +/* MESA_FORMAT_RGB_F32 *******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); + texel[RCOMP] = src[0]; + texel[GCOMP] = src[1]; + texel[BCOMP] = src[2]; + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_RGB_F16 *******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); + texel[RCOMP] = _mesa_half_to_float(src[0]); + texel[GCOMP] = _mesa_half_to_float(src[1]); + texel[BCOMP] = _mesa_half_to_float(src[2]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(*depth); +} +#endif + + +/* MESA_FORMAT_ALPHA_F32 *****************************************************/ + +/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_alpha_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = src[0]; +} + +#if DIM == 3 +static void store_texel_alpha_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_ALPHA_F32 *****************************************************/ + +/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_alpha_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = _mesa_half_to_float(src[0]); +} + +#if DIM == 3 +static void store_texel_alpha_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = src[0]; + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_luminance_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = _mesa_half_to_float(src[0]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_luminance_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = src[0]; + texel[ACOMP] = src[1]; +} + +#if DIM == 3 +static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = _mesa_half_to_float(src[0]); + texel[ACOMP] = _mesa_half_to_float(src[1]); +} + +#if DIM == 3 +static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); + dst[1] = _mesa_float_to_half(rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_INTENSITY_F32 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = src[0]; +} + +#if DIM == 3 +static void store_texel_intensity_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_INTENSITY_F16 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = _mesa_half_to_float(src[0]); +} + +#if DIM == 3 +static void store_texel_intensity_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); +} +#endif + + + + +/* + * Begin Hardware formats + */ + +/* MESA_FORMAT_RGBA8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */ +static void FETCH(f_rgba8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); +} + + + +#if DIM == 3 +static void store_texel_rgba8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGBA888_REV ***************************************************/ + +/* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ +static void FETCH(f_rgba8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ +static void FETCH(f_argb8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_argb8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB8888_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */ +static void FETCH(f_argb8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); +} + +#if DIM == 3 +static void store_texel_argb8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_XRGB8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */ +static void FETCH(f_xrgb8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[ACOMP] = 1.0f; +} + +#if DIM == 3 +static void store_texel_xrgb8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(0xff, rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_XRGB8888_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D xrgb8888_rev texture, return 4 GLfloats */ +static void FETCH(f_xrgb8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[ACOMP] = 1.0f; +} + +#if DIM == 3 +static void store_texel_xrgb8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], 0xff); +} +#endif + + +/* MESA_FORMAT_RGB888 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ +static void FETCH(f_rgb888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + texel[RCOMP] = UBYTE_TO_FLOAT( src[2] ); + texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); + texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + dst[0] = rgba[BCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_BGR888 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ +static void FETCH(f_bgr888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + texel[RCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); + texel[BCOMP] = UBYTE_TO_FLOAT( src[2] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_bgr888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[BCOMP]; +} +#endif + + +/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding) + instead of slow (g << 2) * 255 / 252 (always rounds down) */ + +/* MESA_FORMAT_RGB565 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ +static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 5 ) & 0x3f) * (1.0F / 63.0F); + texel[BCOMP] = ((s ) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb565(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_RGB565_REV ****************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ +static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ + texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); + texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); + texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb565_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB4444 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ +static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); +} + +#if DIM == 3 +static void store_texel_argb4444(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB4444_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ +static void FETCH(f_argb4444_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); +} + +#if DIM == 3 +static void store_texel_argb4444_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); +} +#endif + +/* MESA_FORMAT_RGBA5551 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ +static void FETCH(f_rgba5551)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 6) & 0x1f) * (1.0F / 31.0F); + texel[BCOMP] = ((s >> 1) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = ((s ) & 0x01) * 1.0F; +} + +#if DIM == 3 +static void store_texel_rgba5551(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +/* MESA_FORMAT_ARGB1555 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ +static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); + texel[BCOMP] = ((s >> 0) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F; +} + +#if DIM == 3 +static void store_texel_argb1555(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB1555_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ +static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ + texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); + texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); + texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); + texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 ); +} + +#if DIM == 3 +static void store_texel_argb1555_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_AL88 **********************************************************/ + +/* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ +static void FETCH(f_al88)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); +} + +#if DIM == 3 +static void store_texel_al88(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_AL88_REV ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ +static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); + texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); +} + +#if DIM == 3 +static void store_texel_al88_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_AL1616 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D al1616 texture, return 4 GLchans */ +static void FETCH(f_al1616)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff ); + texel[ACOMP] = USHORT_TO_FLOAT( s >> 16 ); +} + +#if DIM == 3 +static void store_texel_al1616(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_1616(rgba[ACOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_AL1616_REV ****************************************************/ + +/* Fetch texel from 1D, 2D or 3D al1616_rev texture, return 4 GLchans */ +static void FETCH(f_al1616_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = USHORT_TO_FLOAT( s >> 16 ); + texel[ACOMP] = USHORT_TO_FLOAT( s & 0xffff ); +} + +#if DIM == 3 +static void store_texel_al1616_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_1616(rgba[RCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGB332 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ +static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + const GLubyte s = *src; + texel[RCOMP] = ((s >> 5) & 0x7) * (1.0F / 7.0F); + texel[GCOMP] = ((s >> 2) & 0x7) * (1.0F / 7.0F); + texel[BCOMP] = ((s ) & 0x3) * (1.0F / 3.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb332(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_A8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ +static void FETCH(f_a8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); +} + +#if DIM == 3 +static void store_texel_a8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_L8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ +static void FETCH(f_l8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_l8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_I8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ +static void FETCH(f_i8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); +} + +#if DIM == 3 +static void store_texel_i8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_CI8 ***********************************************************/ + +/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a + * color table, and return 4 GLchans. + */ +static void FETCH(f_ci8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + const struct gl_color_table *palette; + GLuint index; + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Texture.SharedPalette) { + palette = &ctx->Texture.Palette; + } + else { + palette = &texImage->TexObject->Palette; + } + if (palette->Size == 0) + return; /* undefined results */ + + /* Mask the index against size of palette to avoid going out of bounds */ + index = (*src) & (palette->Size - 1); + + { + const GLfloat *table = palette->TableF; + switch (palette->_BaseFormat) { + case GL_ALPHA: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = table[index]; + break; + case GL_LUMINANCE: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = table[index]; + texel[ACOMP] = 1.0F; + break; + case GL_INTENSITY: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = table[index]; + break; + case GL_LUMINANCE_ALPHA: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = table[index * 2 + 0]; + texel[ACOMP] = table[index * 2 + 1]; + break; + case GL_RGB: + texel[RCOMP] = table[index * 3 + 0]; + texel[GCOMP] = table[index * 3 + 1]; + texel[BCOMP] = table[index * 3 + 2]; + texel[ACOMP] = 1.0F; + break; + case GL_RGBA: + texel[RCOMP] = table[index * 4 + 0]; + texel[GCOMP] = table[index * 4 + 1]; + texel[BCOMP] = table[index * 4 + 2]; + texel[ACOMP] = table[index * 4 + 3]; + break; + default: + _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); + return; + } + } +} + +#if DIM == 3 +static void store_texel_ci8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *index = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = *index; +} +#endif + + +/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ +/* Note: component order is same as for MESA_FORMAT_RGB888 */ +static void FETCH(srgb8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + texel[RCOMP] = nonlinear_to_linear(src[2]); + texel[GCOMP] = nonlinear_to_linear(src[1]); + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_srgb8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + dst[0] = rgba[BCOMP]; /* no conversion */ + dst[1] = rgba[GCOMP]; + dst[2] = rgba[RCOMP]; +} +#endif + +/* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */ +static void FETCH(srgba8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s >> 24) ); + texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */ +} + +#if DIM == 3 +static void store_texel_srgba8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */ +static void FETCH(sargb8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */ +} + +#if DIM == 3 +static void store_texel_sargb8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + +/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ +static void FETCH(sl8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_sl8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + +/* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */ +static void FETCH(sla8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */ +} + +#if DIM == 3 +static void store_texel_sla8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_DUDV8 ********************************************************/ + +/* this format by definition produces 0,0,0,1 as rgba values, + however we'll return the dudv values as rg and fix up elsewhere */ +static void FETCH(dudv8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLbyte *src = TEXEL_ADDR(GLbyte, texImage, i, j, k, 2); + texel[RCOMP] = BYTE_TO_FLOAT(src[0]); + texel[GCOMP] = BYTE_TO_FLOAT(src[1]); + texel[BCOMP] = 0; + texel[ACOMP] = 0; +} + +/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/ + +static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLbyte *rgba = (const GLbyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +static void FETCH(signed_rgba8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + + +/* MESA_FORMAT_YCBCR *********************************************************/ + +/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats. + * We convert YCbCr to RGB here. + */ +static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ + const GLushort *src1 = src0 + 1; /* odd */ + const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ + const GLubyte cb = *src0 & 0xff; /* chroma U */ + const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ + const GLubyte cr = *src1 & 0xff; /* chroma V */ + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); + GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); + GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); + r *= (1.0F / 255.0F); + g *= (1.0F / 255.0F); + b *= (1.0F / 255.0F); + texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); + texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); + texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_ycbcr(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + (void) texImage; + (void) i; + (void) j; + (void) k; + (void) texel; + /* XXX to do */ +} +#endif + + +/* MESA_FORMAT_YCBCR_REV *****************************************************/ + +/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLfloats. + * We convert YCbCr to RGB here. + */ +static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ + const GLushort *src1 = src0 + 1; /* odd */ + const GLubyte y0 = *src0 & 0xff; /* luminance */ + const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ + const GLubyte y1 = *src1 & 0xff; /* luminance */ + const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); + GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); + GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); + r *= (1.0F / 255.0F); + g *= (1.0F / 255.0F); + b *= (1.0F / 255.0F); + texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); + texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); + texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + (void) texImage; + (void) i; + (void) j; + (void) k; + (void) texel; + /* XXX to do */ +} +#endif + + +/* MESA_TEXFORMAT_Z24_S8 ***************************************************/ + +static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* only return Z, not stencil data */ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLfloat scale = 1.0F / (GLfloat) 0xffffff; + texel[0] = ((*src) >> 8) * scale; + ASSERT(texImage->TexFormat == MESA_FORMAT_Z24_S8); + ASSERT(texel[0] >= 0.0F); + ASSERT(texel[0] <= 1.0F); +} + +#if DIM == 3 +static void store_texel_z24_s8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* only store Z, not stencil */ + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + GLfloat depth = *((GLfloat *) texel); + GLuint zi = ((GLuint) (depth * 0xffffff)) << 8; + *dst = zi | (*dst & 0xff); +} +#endif + + +/* MESA_TEXFORMAT_S8_Z24 ***************************************************/ + +static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* only return Z, not stencil data */ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLfloat scale = 1.0F / (GLfloat) 0xffffff; + texel[0] = ((*src) & 0x00ffffff) * scale; + ASSERT(texImage->TexFormat == MESA_FORMAT_S8_Z24); + ASSERT(texel[0] >= 0.0F); + ASSERT(texel[0] <= 1.0F); +} + +#if DIM == 3 +static void store_texel_s8_z24(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* only store Z, not stencil */ + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + GLfloat depth = *((GLfloat *) texel); + GLuint zi = (GLuint) (depth * 0xffffff); + *dst = zi | (*dst & 0xff000000); +} +#endif + + +#undef TEXEL_ADDR +#undef DIM +#undef FETCH diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c index 9d5534e39..1a374e7be 100644 --- a/mesalib/src/mesa/main/texformat.c +++ b/mesalib/src/mesa/main/texformat.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.7 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (c) 2008 VMware, Inc. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-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"), @@ -29,1435 +29,15 @@ * Texture formats. * * \author Gareth Hughes + * \author Brian Paul */ -#include "colormac.h" #include "context.h" +#include "texcompress.h" +#include "texcompress_fxt1.h" +#include "texcompress_s3tc.h" #include "texformat.h" -#include "texstore.h" - - -#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) _mesa_pow((cs + 0.055) / 1.055, 2.4); - } - } - tableReady = GL_TRUE; - } - return table[cs8]; -} - - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/* Texel fetch routines for all supported formats - */ -#define DIM 1 -#include "texformat_tmp.h" - -#define DIM 2 -#include "texformat_tmp.h" - -#define DIM 3 -#include "texformat_tmp.h" - -/** - * Null texel fetch function. - * - * Have to have this so the FetchTexel function pointer is never NULL. - */ -static void fetch_null_texel( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) texImage; (void) i; (void) j; (void) k; - texel[RCOMP] = 0; - texel[GCOMP] = 0; - texel[BCOMP] = 0; - texel[ACOMP] = 0; - _mesa_warning(NULL, "fetch_null_texel() called!"); -} - -static void fetch_null_texelf( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - (void) texImage; (void) i; (void) j; (void) k; - texel[RCOMP] = 0.0; - texel[GCOMP] = 0.0; - texel[BCOMP] = 0.0; - texel[ACOMP] = 0.0; - _mesa_warning(NULL, "fetch_null_texelf() called!"); -} - -static void store_null_texel(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* no-op */ -} - - -/** - * Notes about the predefined gl_texture_formats: - * - * 1. There are 1D, 2D and 3D functions for fetching texels from texture - * images, returning both GLchan values and GLfloat values. (six - * functions in total) - * You don't have to provide both the GLchan and GLfloat functions; - * just one or the other is OK. Mesa will use an "adaptor" to convert - * between GLchan/GLfloat when needed. - * Since the adaptors have small performance penalty, we provide both - * GLchan and GLfloat functions for some common formats like RGB, RGBA. - */ - - -/***************************************************************/ -/** \name Default GLchan-based formats */ -/*@{*/ - -const struct gl_texture_format _mesa_texformat_rgba = { - MESA_FORMAT_RGBA, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - CHAN_BITS, /* RedBits */ - CHAN_BITS, /* GreenBits */ - CHAN_BITS, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba, /* FetchTexel3Df */ - store_texel_rgba /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb = { - MESA_FORMAT_RGB, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - CHAN_BITS, /* RedBits */ - CHAN_BITS, /* GreenBits */ - CHAN_BITS, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb, /* FetchTexel3Df */ - store_texel_rgb /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_alpha = { - MESA_FORMAT_ALPHA, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_alpha, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha, /* FetchTexel3Df */ - store_texel_alpha /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance = { - MESA_FORMAT_LUMINANCE, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - CHAN_BITS, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance, /* FetchTexel3Df */ - store_texel_luminance /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha = { - MESA_FORMAT_LUMINANCE_ALPHA, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - CHAN_BITS, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha, /* FetchTexel3Df */ - store_texel_luminance_alpha /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_intensity = { - MESA_FORMAT_INTENSITY, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - CHAN_BITS, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity, /* FetchTexel3Df */ - store_texel_intensity /* StoreTexel */ -}; - - -#if FEATURE_EXT_texture_sRGB - -const struct gl_texture_format _mesa_texformat_srgb8 = { - MESA_FORMAT_SRGB8, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ - _mesa_texstore_srgb8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_srgb8, /* FetchTexel1Df */ - fetch_texel_2d_srgb8, /* FetchTexel2Df */ - fetch_texel_3d_srgb8, /* FetchTexel3Df */ - store_texel_srgb8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_srgba8 = { - MESA_FORMAT_SRGBA8, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_srgba8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_srgba8, /* FetchTexel1Df */ - fetch_texel_2d_srgba8, /* FetchTexel2Df */ - fetch_texel_3d_srgba8, /* FetchTexel3Df */ - store_texel_srgba8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_sargb8 = { - MESA_FORMAT_SARGB8, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_sargb8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_sargb8, /* FetchTexel1Df */ - fetch_texel_2d_sargb8, /* FetchTexel2Df */ - fetch_texel_3d_sargb8, /* FetchTexel3Df */ - store_texel_sargb8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_sl8 = { - MESA_FORMAT_SL8, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_sl8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_sl8, /* FetchTexel1Df */ - fetch_texel_2d_sl8, /* FetchTexel2Df */ - fetch_texel_3d_sl8, /* FetchTexel3Df */ - store_texel_sl8 /* StoreTexel */ -}; - -/* Note: this format name looks like a misnomer, make it sal8? */ -const struct gl_texture_format _mesa_texformat_sla8 = { - MESA_FORMAT_SLA8, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_sla8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_sla8, /* FetchTexel1Df */ - fetch_texel_2d_sla8, /* FetchTexel2Df */ - fetch_texel_3d_sla8, /* FetchTexel3Df */ - store_texel_sla8 /* StoreTexel */ -}; - -#endif /* FEATURE_EXT_texture_sRGB */ - -const struct gl_texture_format _mesa_texformat_rgba_float32 = { - MESA_FORMAT_RGBA_FLOAT32, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLfloat), /* RedBits */ - 8 * sizeof(GLfloat), /* GreenBits */ - 8 * sizeof(GLfloat), /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgba_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba_f32, /* FetchTexel3Df */ - store_texel_rgba_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_float16 = { - MESA_FORMAT_RGBA_FLOAT16, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLhalfARB), /* RedBits */ - 8 * sizeof(GLhalfARB), /* GreenBits */ - 8 * sizeof(GLhalfARB), /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgba_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba_f16, /* FetchTexel3Df */ - store_texel_rgba_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb_float32 = { - MESA_FORMAT_RGB_FLOAT32, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLfloat), /* RedBits */ - 8 * sizeof(GLfloat), /* GreenBits */ - 8 * sizeof(GLfloat), /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgb_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f32, /* FetchTexel3Df */ - store_texel_rgb_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb_float16 = { - MESA_FORMAT_RGB_FLOAT16, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLhalfARB), /* RedBits */ - 8 * sizeof(GLhalfARB), /* GreenBits */ - 8 * sizeof(GLhalfARB), /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgb_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f16, /* FetchTexel3Df */ - store_texel_rgb_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_alpha_float32 = { - MESA_FORMAT_ALPHA_FLOAT32, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_alpha_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f32, /* FetchTexel3Df */ - store_texel_alpha_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_alpha_float16 = { - MESA_FORMAT_ALPHA_FLOAT16, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_alpha_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f16, /* FetchTexel3Df */ - store_texel_alpha_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_float32 = { - MESA_FORMAT_LUMINANCE_FLOAT32, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8 * sizeof(GLfloat), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f32, /* FetchTexel3Df */ - store_texel_luminance_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_float16 = { - MESA_FORMAT_LUMINANCE_FLOAT16, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8 * sizeof(GLhalfARB), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f16, /* FetchTexel3Df */ - store_texel_luminance_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 8 * sizeof(GLfloat), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha_f32,/* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha_f32,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f32,/* FetchTexel3Df */ - store_texel_luminance_alpha_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 8 * sizeof(GLhalfARB), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha_f16,/* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha_f16,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f16,/* FetchTexel3Df */ - store_texel_luminance_alpha_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_intensity_float32 = { - MESA_FORMAT_INTENSITY_FLOAT32, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8 * sizeof(GLfloat), /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f32, /* FetchTexel3Df */ - store_texel_intensity_f32 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_intensity_float16 = { - MESA_FORMAT_INTENSITY_FLOAT16, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8 * sizeof(GLhalfARB), /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f16, /* FetchTexel3Df */ - store_texel_intensity_f16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_dudv8 = { - MESA_FORMAT_DUDV8, /* MesaFormat */ - GL_DUDV_ATI, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - /* maybe should add dudvBits field, but spec seems to be - lacking the ability to query with GetTexLevelParameter anyway */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_dudv8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_dudv8, /* FetchTexel1Df */ - fetch_texel_2d_dudv8, /* FetchTexel2Df */ - fetch_texel_3d_dudv8, /* FetchTexel3Df */ - NULL /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { - MESA_FORMAT_SIGNED_RGBA8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_signed_rgba8888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_signed_rgba8888, /* FetchTexel1Df */ - fetch_texel_2d_signed_rgba8888, /* FetchTexel2Df */ - fetch_texel_3d_signed_rgba8888, /* FetchTexel3Df */ - store_texel_signed_rgba8888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { - MESA_FORMAT_SIGNED_RGBA8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_signed_rgba8888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_signed_rgba8888_rev, /* FetchTexel1Df */ - fetch_texel_2d_signed_rgba8888_rev, /* FetchTexel2Df */ - fetch_texel_3d_signed_rgba8888_rev, /* FetchTexel3Df */ - store_texel_signed_rgba8888_rev /* StoreTexel */ -}; - -/*@}*/ - - -/***************************************************************/ -/** \name Hardware formats */ -/*@{*/ - -const struct gl_texture_format _mesa_texformat_rgba8888 = { - MESA_FORMAT_RGBA8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_rgba8888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba8888, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba8888, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba8888, /* FetchTexel3Df */ - store_texel_rgba8888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba8888_rev = { - MESA_FORMAT_RGBA8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_rgba8888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba8888_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba8888_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba8888_rev, /* FetchTexel3Df */ - store_texel_rgba8888_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb8888 = { - MESA_FORMAT_ARGB8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb8888, /* FetchTexel1Df */ - fetch_texel_2d_f_argb8888, /* FetchTexel2Df */ - fetch_texel_3d_f_argb8888, /* FetchTexel3Df */ - store_texel_argb8888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb8888_rev = { - MESA_FORMAT_ARGB8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb8888_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_argb8888_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_argb8888_rev, /* FetchTexel3Df */ - store_texel_argb8888_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb888 = { - MESA_FORMAT_RGB888, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ - _mesa_texstore_rgb888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb888, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb888, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb888, /* FetchTexel3Df */ - store_texel_rgb888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_bgr888 = { - MESA_FORMAT_BGR888, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ - _mesa_texstore_bgr888, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_bgr888, /* FetchTexel1Df */ - fetch_texel_2d_f_bgr888, /* FetchTexel2Df */ - fetch_texel_3d_f_bgr888, /* FetchTexel3Df */ - store_texel_bgr888 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb565 = { - MESA_FORMAT_RGB565, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 6, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgb565, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb565, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb565, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb565, /* FetchTexel3Df */ - store_texel_rgb565 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb565_rev = { - MESA_FORMAT_RGB565_REV, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 6, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgb565, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb565_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb565_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb565_rev, /* FetchTexel3Df */ - store_texel_rgb565_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba4444 = { - MESA_FORMAT_RGBA4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgba4444, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba4444, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba4444, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba4444, /* FetchTexel3Df */ - store_texel_rgba4444 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb4444 = { - MESA_FORMAT_ARGB4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb4444, /* FetchTexel1Df */ - fetch_texel_2d_f_argb4444, /* FetchTexel2Df */ - fetch_texel_3d_f_argb4444, /* FetchTexel3Df */ - store_texel_argb4444 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb4444_rev = { - MESA_FORMAT_ARGB4444_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb4444_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_argb4444_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_argb4444_rev, /* FetchTexel3Df */ - store_texel_argb4444_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgba5551 = { - MESA_FORMAT_RGBA5551, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_rgba5551, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba5551, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba5551, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba5551, /* FetchTexel3Df */ - store_texel_rgba5551 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb1555 = { - MESA_FORMAT_ARGB1555, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb1555, /* FetchTexel1Df */ - fetch_texel_2d_f_argb1555, /* FetchTexel2Df */ - fetch_texel_3d_f_argb1555, /* FetchTexel3Df */ - store_texel_argb1555 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_argb1555_rev = { - MESA_FORMAT_ARGB1555_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb1555_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_argb1555_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_argb1555_rev, /* FetchTexel3Df */ - store_texel_argb1555_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_al88 = { - MESA_FORMAT_AL88, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_al88, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_al88, /* FetchTexel1Df */ - fetch_texel_2d_f_al88, /* FetchTexel2Df */ - fetch_texel_3d_f_al88, /* FetchTexel3Df */ - store_texel_al88 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_al88_rev = { - MESA_FORMAT_AL88_REV, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_al88, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_al88_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_al88_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_al88_rev, /* FetchTexel3Df */ - store_texel_al88_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_rgb332 = { - MESA_FORMAT_RGB332, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 3, /* RedBits */ - 3, /* GreenBits */ - 2, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_rgb332, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb332, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb332, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb332, /* FetchTexel3Df */ - store_texel_rgb332 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_a8 = { - MESA_FORMAT_A8, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_a8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_a8, /* FetchTexel1Df */ - fetch_texel_2d_f_a8, /* FetchTexel2Df */ - fetch_texel_3d_f_a8, /* FetchTexel3Df */ - store_texel_a8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_l8 = { - MESA_FORMAT_L8, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_l8, /* FetchTexel1Df */ - fetch_texel_2d_f_l8, /* FetchTexel2Df */ - fetch_texel_3d_f_l8, /* FetchTexel3Df */ - store_texel_l8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_i8 = { - MESA_FORMAT_I8, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_i8, /* FetchTexel1Df */ - fetch_texel_2d_f_i8, /* FetchTexel2Df */ - fetch_texel_3d_f_i8, /* FetchTexel3Df */ - store_texel_i8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_ci8 = { - MESA_FORMAT_CI8, /* MesaFormat */ - GL_COLOR_INDEX, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 8, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ - _mesa_texstore_ci8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_ci8, /* FetchTexel1Df */ - fetch_texel_2d_f_ci8, /* FetchTexel2Df */ - fetch_texel_3d_f_ci8, /* FetchTexel3Df */ - store_texel_ci8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_ycbcr = { - MESA_FORMAT_YCBCR, /* MesaFormat */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_ycbcr, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_ycbcr, /* FetchTexel1Df */ - fetch_texel_2d_f_ycbcr, /* FetchTexel2Df */ - fetch_texel_3d_f_ycbcr, /* FetchTexel3Df */ - store_texel_ycbcr /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_ycbcr_rev = { - MESA_FORMAT_YCBCR_REV, /* MesaFormat */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ - _mesa_texstore_ycbcr, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_ycbcr_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_ycbcr_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_ycbcr_rev, /* FetchTexel3Df */ - store_texel_ycbcr_rev /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_z24_s8 = { - MESA_FORMAT_Z24_S8, /* MesaFormat */ - GL_DEPTH_STENCIL_EXT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 24, /* DepthBits */ - 8, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_z24_s8, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_z24_s8, /* FetchTexel1Df */ - fetch_texel_2d_f_z24_s8, /* FetchTexel2Df */ - fetch_texel_3d_f_z24_s8, /* FetchTexel3Df */ - store_texel_z24_s8 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_s8_z24 = { - MESA_FORMAT_S8_Z24, /* MesaFormat */ - GL_DEPTH_STENCIL_EXT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 24, /* DepthBits */ - 8, /* StencilBits */ - 4, /* TexelBytes */ - _mesa_texstore_s8_z24, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - fetch_texel_1d_f_s8_z24, /* FetchTexel1Df */ - fetch_texel_2d_f_s8_z24, /* FetchTexel2Df */ - fetch_texel_3d_f_s8_z24, /* FetchTexel3Df */ - store_texel_s8_z24 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_z16 = { - MESA_FORMAT_Z16, /* MesaFormat */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - sizeof(GLushort) * 8, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLushort), /* TexelBytes */ - _mesa_texstore_z16, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_z16, /* FetchTexel1Df */ - fetch_texel_2d_f_z16, /* FetchTexel2Df */ - fetch_texel_3d_f_z16, /* FetchTexel3Df */ - store_texel_z16 /* StoreTexel */ -}; - -const struct gl_texture_format _mesa_texformat_z32 = { - MESA_FORMAT_Z32, /* MesaFormat */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - sizeof(GLuint) * 8, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLuint), /* TexelBytes */ - _mesa_texstore_z32, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - fetch_texel_1d_f_z32, /* FetchTexel1Df */ - fetch_texel_2d_f_z32, /* FetchTexel2Df */ - fetch_texel_3d_f_z32, /* FetchTexel3Df */ - store_texel_z32 /* StoreTexel */ -}; - -/*@}*/ - - -/***************************************************************/ -/** \name Null format (useful for proxy textures) */ -/*@{*/ - -const struct gl_texture_format _mesa_null_texformat = { - -1, /* MesaFormat */ - 0, /* BaseFormat */ - GL_NONE, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - fetch_null_texel, /* FetchTexel1D */ - fetch_null_texel, /* FetchTexel2D */ - fetch_null_texel, /* FetchTexel3D */ - fetch_null_texelf, /* FetchTexel1Df */ - fetch_null_texelf, /* FetchTexel2Df */ - fetch_null_texelf, /* FetchTexel3Df */ - store_null_texel /* StoreTexel */ -}; - -/*@}*/ /** @@ -1475,7 +55,7 @@ const struct gl_texture_format _mesa_null_texformat = { * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers * will typically override this function with a specialized version. */ -const struct gl_texture_format * +gl_format _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -1489,15 +69,14 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return &_mesa_texformat_rgba; case GL_RGBA8: - return &_mesa_texformat_rgba8888; + return MESA_FORMAT_RGBA8888; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGBA2: - return &_mesa_texformat_argb4444_rev; /* just to test another format*/ + return MESA_FORMAT_ARGB4444_REV; /* just to test another format*/ case GL_RGBA4: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; /* RGB formats */ case 3: @@ -1505,24 +84,22 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return &_mesa_texformat_rgb; case GL_RGB8: - return &_mesa_texformat_rgb888; + return MESA_FORMAT_RGB888; case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; + return MESA_FORMAT_RGB332; case GL_RGB4: - return &_mesa_texformat_rgb565_rev; /* just to test another format */ + return MESA_FORMAT_RGB565_REV; /* just to test another format */ case GL_RGB5: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; /* Alpha formats */ case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA12: case GL_ALPHA16: - return &_mesa_texformat_alpha; case GL_ALPHA8: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; /* Luminance formats */ case 1: @@ -1530,29 +107,28 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE4: case GL_LUMINANCE12: case GL_LUMINANCE16: - return &_mesa_texformat_luminance; case GL_LUMINANCE8: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; /* Luminance/Alpha formats */ case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + return MESA_FORMAT_AL88; + case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - return &_mesa_texformat_luminance_alpha; - case GL_LUMINANCE8_ALPHA8: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL1616; case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY12: case GL_INTENSITY16: - return &_mesa_texformat_intensity; case GL_INTENSITY8: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -1561,7 +137,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: case GL_COLOR_INDEX8_EXT: - return &_mesa_texformat_ci8; + return MESA_FORMAT_CI8; default: ; /* fallthrough */ @@ -1572,9 +148,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - return &_mesa_texformat_z32; + return MESA_FORMAT_Z32; case GL_DEPTH_COMPONENT16: - return &_mesa_texformat_z16; + return MESA_FORMAT_Z16; default: ; /* fallthrough */ } @@ -1582,35 +158,27 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_COMPRESSED_ALPHA_ARB: - return &_mesa_texformat_alpha; + return MESA_FORMAT_A8; case GL_COMPRESSED_LUMINANCE_ARB: - return &_mesa_texformat_luminance; + return MESA_FORMAT_L8; case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return &_mesa_texformat_luminance_alpha; + return MESA_FORMAT_AL88; case GL_COMPRESSED_INTENSITY_ARB: - return &_mesa_texformat_intensity; + return MESA_FORMAT_I8; case GL_COMPRESSED_RGB_ARB: -#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgb_dxt1; -#endif -#if FEATURE_texture_fxt1 + return MESA_FORMAT_RGB_DXT1; if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgb_fxt1; -#endif - return &_mesa_texformat_rgb; + return MESA_FORMAT_RGB_FXT1; + return MESA_FORMAT_RGB888; case GL_COMPRESSED_RGBA_ARB: -#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgba_dxt5; /* Not rgba_dxt1, see spec */ -#endif -#if FEATURE_texture_fxt1 + return MESA_FORMAT_RGBA_DXT3; /* Not rgba_dxt1, see spec */ if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgba_fxt1; -#endif - return &_mesa_texformat_rgba; + return MESA_FORMAT_RGBA_FXT1; + return MESA_FORMAT_RGBA8888; default: ; /* fallthrough */ } @@ -1618,9 +186,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.MESA_ycbcr_texture) { if (internalFormat == GL_YCBCR_MESA) { if (type == GL_UNSIGNED_SHORT_8_8_MESA) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; } } @@ -1628,9 +196,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; default: ; /* fallthrough */ } @@ -1641,13 +209,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.EXT_texture_compression_s3tc) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; default: ; /* fallthrough */ } @@ -1657,10 +225,10 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_RGB_S3TC: case GL_RGB4_S3TC: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; default: ; /* fallthrough */ } @@ -1670,29 +238,29 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.ARB_texture_float) { switch (internalFormat) { case GL_ALPHA16F_ARB: - return &_mesa_texformat_alpha_float16; + return MESA_FORMAT_ALPHA_FLOAT16; case GL_ALPHA32F_ARB: - return &_mesa_texformat_alpha_float32; + return MESA_FORMAT_ALPHA_FLOAT32; case GL_LUMINANCE16F_ARB: - return &_mesa_texformat_luminance_float16; + return MESA_FORMAT_LUMINANCE_FLOAT16; case GL_LUMINANCE32F_ARB: - return &_mesa_texformat_luminance_float32; + return MESA_FORMAT_LUMINANCE_FLOAT32; case GL_LUMINANCE_ALPHA16F_ARB: - return &_mesa_texformat_luminance_alpha_float16; + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; case GL_LUMINANCE_ALPHA32F_ARB: - return &_mesa_texformat_luminance_alpha_float32; + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32; case GL_INTENSITY16F_ARB: - return &_mesa_texformat_intensity_float16; + return MESA_FORMAT_INTENSITY_FLOAT16; case GL_INTENSITY32F_ARB: - return &_mesa_texformat_intensity_float32; + return MESA_FORMAT_INTENSITY_FLOAT32; case GL_RGB16F_ARB: - return &_mesa_texformat_rgb_float16; + return MESA_FORMAT_RGB_FLOAT16; case GL_RGB32F_ARB: - return &_mesa_texformat_rgb_float32; + return MESA_FORMAT_RGB_FLOAT32; case GL_RGBA16F_ARB: - return &_mesa_texformat_rgba_float16; + return MESA_FORMAT_RGBA_FLOAT16; case GL_RGBA32F_ARB: - return &_mesa_texformat_rgba_float32; + return MESA_FORMAT_RGBA_FLOAT32; default: ; /* fallthrough */ } @@ -1702,7 +270,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return &_mesa_texformat_z24_s8; + return MESA_FORMAT_Z24_S8; default: ; /* fallthrough */ } @@ -1712,7 +280,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_DUDV_ATI: case GL_DU8DV8_ATI: - return &_mesa_texformat_dudv8; + return MESA_FORMAT_DUDV8; default: ; /* fallthrough */ } @@ -1722,7 +290,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_RGBA_SNORM: case GL_RGBA8_SNORM: - return &_mesa_texformat_signed_rgba8888; + return MESA_FORMAT_SIGNED_RGBA8888; default: ; /* fallthrough */ } @@ -1734,48 +302,48 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_SRGB_EXT: case GL_SRGB8_EXT: - return &_mesa_texformat_srgb8; + return MESA_FORMAT_SRGB8; case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: - return &_mesa_texformat_srgba8; + return MESA_FORMAT_SRGBA8; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; case GL_COMPRESSED_SLUMINANCE_EXT: - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; case GL_COMPRESSED_SRGB_EXT: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgb_dxt1; + return MESA_FORMAT_SRGB_DXT1; #endif - return &_mesa_texformat_srgb8; + return MESA_FORMAT_SRGB8; case GL_COMPRESSED_SRGB_ALPHA_EXT: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt3; /* Not srgba_dxt1, see spec */ + return MESA_FORMAT_SRGBA_DXT3; /* Not srgba_dxt1, see spec */ #endif - return &_mesa_texformat_srgba8; + return MESA_FORMAT_SRGBA8; #if FEATURE_texture_s3tc case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgb_dxt1; + return MESA_FORMAT_SRGB_DXT1; break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt1; + return MESA_FORMAT_SRGBA_DXT1; break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt3; + return MESA_FORMAT_SRGBA_DXT3; break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt5; + return MESA_FORMAT_SRGBA_DXT5; break; #endif default: @@ -1785,205 +353,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, #endif /* FEATURE_EXT_texture_sRGB */ _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); - return NULL; + return MESA_FORMAT_NONE; } - - -/** - * Return datatype and number of components per texel for the - * given gl_texture_format. - */ -void -_mesa_format_to_type_and_comps(const struct gl_texture_format *format, - GLenum *datatype, GLuint *comps) -{ - switch (format->MesaFormat) { - case MESA_FORMAT_RGBA8888: - case MESA_FORMAT_RGBA8888_REV: - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_ARGB8888_REV: - *datatype = CHAN_TYPE; - *comps = 4; - return; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: - *datatype = GL_UNSIGNED_BYTE; - *comps = 3; - return; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - *datatype = GL_UNSIGNED_SHORT_5_6_5; - *comps = 3; - return; - - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - *datatype = GL_UNSIGNED_SHORT_4_4_4_4; - *comps = 4; - return; - - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB1555_REV: - *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; - *comps = 4; - return; - - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: - *datatype = GL_UNSIGNED_BYTE; - *comps = 2; - return; - case MESA_FORMAT_RGB332: - *datatype = GL_UNSIGNED_BYTE_3_3_2; - *comps = 3; - return; - - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: - case MESA_FORMAT_CI8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 1; - return; - - case MESA_FORMAT_YCBCR: - case MESA_FORMAT_YCBCR_REV: - *datatype = GL_UNSIGNED_SHORT; - *comps = 2; - return; - - case MESA_FORMAT_Z24_S8: - *datatype = GL_UNSIGNED_INT; - *comps = 1; /* XXX OK? */ - return; - - case MESA_FORMAT_S8_Z24: - *datatype = GL_UNSIGNED_INT; - *comps = 1; /* XXX OK? */ - return; - - case MESA_FORMAT_Z16: - *datatype = GL_UNSIGNED_SHORT; - *comps = 1; - return; - - case MESA_FORMAT_Z32: - *datatype = GL_UNSIGNED_INT; - *comps = 1; - return; - - case MESA_FORMAT_DUDV8: - *datatype = GL_BYTE; - *comps = 2; - return; - - case MESA_FORMAT_SIGNED_RGBA8888: - case MESA_FORMAT_SIGNED_RGBA8888_REV: - *datatype = GL_BYTE; - *comps = 4; - return; - -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 3; - return; - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 4; - return; - case MESA_FORMAT_SL8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 1; - return; - case MESA_FORMAT_SLA8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 2; - return; -#endif - -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - /* XXX generate error instead? */ - *datatype = GL_UNSIGNED_BYTE; - *comps = 0; - return; -#endif - - case MESA_FORMAT_RGBA: - *datatype = CHAN_TYPE; - *comps = 4; - return; - case MESA_FORMAT_RGB: - *datatype = CHAN_TYPE; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA: - *datatype = CHAN_TYPE; - *comps = 2; - return; - case MESA_FORMAT_ALPHA: - case MESA_FORMAT_LUMINANCE: - case MESA_FORMAT_INTENSITY: - *datatype = CHAN_TYPE; - *comps = 1; - return; - - case MESA_FORMAT_RGBA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 4; - return; - case MESA_FORMAT_RGBA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 4; - return; - case MESA_FORMAT_RGB_FLOAT32: - *datatype = GL_FLOAT; - *comps = 3; - return; - case MESA_FORMAT_RGB_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 2; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 2; - return; - case MESA_FORMAT_ALPHA_FLOAT32: - case MESA_FORMAT_LUMINANCE_FLOAT32: - case MESA_FORMAT_INTENSITY_FLOAT32: - *datatype = GL_FLOAT; - *comps = 1; - return; - case MESA_FORMAT_ALPHA_FLOAT16: - case MESA_FORMAT_LUMINANCE_FLOAT16: - case MESA_FORMAT_INTENSITY_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 1; - return; - - default: - _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps"); - *datatype = 0; - *comps = 1; - } -} diff --git a/mesalib/src/mesa/main/texformat.h b/mesalib/src/mesa/main/texformat.h index 5aa1d756c..bda5fd6d8 100644 --- a/mesalib/src/mesa/main/texformat.h +++ b/mesalib/src/mesa/main/texformat.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.75 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (c) 2008 VMware, Inc. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-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"), @@ -23,271 +23,17 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -/** - * \file texformat.h - * Texture formats definitions. - * - * \author Gareth Hughes - */ - - #ifndef TEXFORMAT_H #define TEXFORMAT_H #include "mtypes.h" +#include "formats.h" -/** - * Mesa internal texture image formats. - * All texture images are stored in one of these formats. - * - * NOTE: when you add a new format, be sure to update the do_row() - * function in texstore.c used for auto mipmap generation. - */ -enum _format { - /** - * \name Hardware-friendly formats. - * - * Drivers can override the default formats and convert texture images to - * one of these as required. The driver's - * dd_function_table::ChooseTextureFormat function will choose one of these - * formats. - * - * \note In the default case, some of these formats will be duplicates of - * the generic formats listed below. However, these formats guarantee their - * internal component sizes, while GLchan may vary between GLubyte, GLushort - * and GLfloat. - */ - /*@{*/ - /* msb <------ TEXEL BITS -----------> lsb */ - /* ---- ---- ---- ---- ---- ---- ---- ---- */ - MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ - MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ - MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ - MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ - MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ - MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ - MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ - MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ - MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ - MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ - MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ - MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ - MESA_FORMAT_RGB332, /* RRRG GGBB */ - MESA_FORMAT_A8, /* AAAA AAAA */ - MESA_FORMAT_L8, /* LLLL LLLL */ - MESA_FORMAT_I8, /* IIII IIII */ - MESA_FORMAT_CI8, /* CCCC CCCC */ - MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ - MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ - MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ - MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - /*@}*/ - -#if FEATURE_EXT_texture_sRGB - /** - * \name 8-bit/channel sRGB formats - */ - /*@{*/ - MESA_FORMAT_SRGB8, - MESA_FORMAT_SRGBA8, - MESA_FORMAT_SARGB8, - MESA_FORMAT_SL8, - MESA_FORMAT_SLA8, -#if FEATURE_texture_s3tc - MESA_FORMAT_SRGB_DXT1, - MESA_FORMAT_SRGBA_DXT1, - MESA_FORMAT_SRGBA_DXT3, - MESA_FORMAT_SRGBA_DXT5, -#endif - /*@}*/ -#endif - - /** - * \name Compressed texture formats. - */ - /*@{*/ -#if FEATURE_texture_fxt1 - MESA_FORMAT_RGB_FXT1, - MESA_FORMAT_RGBA_FXT1, -#endif -#if FEATURE_texture_s3tc - MESA_FORMAT_RGB_DXT1, - MESA_FORMAT_RGBA_DXT1, - MESA_FORMAT_RGBA_DXT3, - MESA_FORMAT_RGBA_DXT5, -#endif - /*@}*/ - - /** - * \name Generic GLchan-based formats. - * - * Software-oriented texture formats. Texels are arrays of GLchan - * values so there are no byte order issues. - * - * \note Because these are based on the GLchan data type, one cannot assume - * 8 bits per channel with these formats. If you require GLubyte channels, - * use one of the hardware formats above. - */ - /*@{*/ - MESA_FORMAT_RGBA, - MESA_FORMAT_RGB, - MESA_FORMAT_ALPHA, - MESA_FORMAT_LUMINANCE, - MESA_FORMAT_LUMINANCE_ALPHA, - MESA_FORMAT_INTENSITY, - /*@}*/ - - /** - * \name Floating point texture formats. - */ - /*@{*/ - MESA_FORMAT_RGBA_FLOAT32, - MESA_FORMAT_RGBA_FLOAT16, - MESA_FORMAT_RGB_FLOAT32, - MESA_FORMAT_RGB_FLOAT16, - MESA_FORMAT_ALPHA_FLOAT32, - MESA_FORMAT_ALPHA_FLOAT16, - MESA_FORMAT_LUMINANCE_FLOAT32, - MESA_FORMAT_LUMINANCE_FLOAT16, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - MESA_FORMAT_INTENSITY_FLOAT32, - MESA_FORMAT_INTENSITY_FLOAT16, - /*@}*/ - - /** - * \name Signed fixed point texture formats. - */ - /*@{*/ - MESA_FORMAT_DUDV8, - MESA_FORMAT_SIGNED_RGBA8888, - MESA_FORMAT_SIGNED_RGBA8888_REV - /*@}*/ -}; - - -/** GLchan-valued formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba; -extern const struct gl_texture_format _mesa_texformat_rgb; -extern const struct gl_texture_format _mesa_texformat_alpha; -extern const struct gl_texture_format _mesa_texformat_luminance; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha; -extern const struct gl_texture_format _mesa_texformat_intensity; -/*@}*/ - -#if FEATURE_EXT_texture_sRGB -/** sRGB (nonlinear) formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_srgb8; -extern const struct gl_texture_format _mesa_texformat_srgba8; -extern const struct gl_texture_format _mesa_texformat_sargb8; -extern const struct gl_texture_format _mesa_texformat_sl8; -extern const struct gl_texture_format _mesa_texformat_sla8; -#if FEATURE_texture_s3tc -extern const struct gl_texture_format _mesa_texformat_srgb_dxt1; -extern const struct gl_texture_format _mesa_texformat_srgba_dxt1; -extern const struct gl_texture_format _mesa_texformat_srgba_dxt3; -extern const struct gl_texture_format _mesa_texformat_srgba_dxt5; -#endif -/*@}*/ -#endif - -/** Floating point texture formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba_float32; -extern const struct gl_texture_format _mesa_texformat_rgba_float16; -extern const struct gl_texture_format _mesa_texformat_rgb_float32; -extern const struct gl_texture_format _mesa_texformat_rgb_float16; -extern const struct gl_texture_format _mesa_texformat_alpha_float32; -extern const struct gl_texture_format _mesa_texformat_alpha_float16; -extern const struct gl_texture_format _mesa_texformat_luminance_float32; -extern const struct gl_texture_format _mesa_texformat_luminance_float16; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float32; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float16; -extern const struct gl_texture_format _mesa_texformat_intensity_float32; -extern const struct gl_texture_format _mesa_texformat_intensity_float16; -/*@}*/ - -/** Signed fixed point texture formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_dudv8; -extern const struct gl_texture_format _mesa_texformat_signed_rgba8888; -extern const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev; -/*@}*/ - -/** \name Assorted hardware-friendly formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba8888; -extern const struct gl_texture_format _mesa_texformat_rgba8888_rev; -extern const struct gl_texture_format _mesa_texformat_argb8888; -extern const struct gl_texture_format _mesa_texformat_argb8888_rev; -extern const struct gl_texture_format _mesa_texformat_rgb888; -extern const struct gl_texture_format _mesa_texformat_bgr888; -extern const struct gl_texture_format _mesa_texformat_rgb565; -extern const struct gl_texture_format _mesa_texformat_rgb565_rev; -extern const struct gl_texture_format _mesa_texformat_rgba4444; -extern const struct gl_texture_format _mesa_texformat_argb4444; -extern const struct gl_texture_format _mesa_texformat_argb4444_rev; -extern const struct gl_texture_format _mesa_texformat_argb1555; -extern const struct gl_texture_format _mesa_texformat_argb1555_rev; -extern const struct gl_texture_format _mesa_texformat_rgba5551; -extern const struct gl_texture_format _mesa_texformat_al88; -extern const struct gl_texture_format _mesa_texformat_al88_rev; -extern const struct gl_texture_format _mesa_texformat_rgb332; -extern const struct gl_texture_format _mesa_texformat_a8; -extern const struct gl_texture_format _mesa_texformat_l8; -extern const struct gl_texture_format _mesa_texformat_i8; -extern const struct gl_texture_format _mesa_texformat_ci8; -extern const struct gl_texture_format _mesa_texformat_z24_s8; -extern const struct gl_texture_format _mesa_texformat_s8_z24; -extern const struct gl_texture_format _mesa_texformat_z16; -extern const struct gl_texture_format _mesa_texformat_z32; -/*@}*/ - -/** \name YCbCr formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_ycbcr; -extern const struct gl_texture_format _mesa_texformat_ycbcr_rev; -/*@}*/ - -/** \name Compressed formats */ -/*@{*/ -#if FEATURE_texture_fxt1 -extern const struct gl_texture_format _mesa_texformat_rgb_fxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_fxt1; -#endif -#if FEATURE_texture_s3tc -extern const struct gl_texture_format _mesa_texformat_rgb_dxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt3; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt5; -#endif -/*@}*/ - -/** \name The null format */ -/*@{*/ -extern const struct gl_texture_format _mesa_null_texformat; -/*@}*/ - - -extern const struct gl_texture_format * +extern gl_format _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ); -extern void -_mesa_format_to_type_and_comps(const struct gl_texture_format *format, - GLenum *datatype, GLuint *comps); - - #endif diff --git a/mesalib/src/mesa/main/texformat_tmp.h b/mesalib/src/mesa/main/texformat_tmp.h deleted file mode 100644 index eb160deff..000000000 --- a/mesalib/src/mesa/main/texformat_tmp.h +++ /dev/null @@ -1,1474 +0,0 @@ -/* - * 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 texformat_tmp.h - * Texel fetch functions template. - * - * This template file is used by texformat.c to generate texel fetch functions - * for 1-D, 2-D and 3-D texture images. - * - * It should be expanded by defining \p DIM as the number texture dimensions - * (1, 2 or 3). According to the value of \p DIM a series of macros is defined - * for the texel lookup in the gl_texture_image::Data. - * - * \sa texformat.c and FetchTexel. - * - * \author Gareth Hughes - * \author Brian Paul - */ - - -#if DIM == 1 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size))) - -#define FETCH(x) fetch_texel_1d_##x - -#elif DIM == 2 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (k), \ - ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size))) - -#define FETCH(x) fetch_texel_2d_##x - -#elif DIM == 3 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((type *)(image)->Data + ((image)->ImageOffsets[k] \ - + (image)->RowStride * (j) + (i)) * (size)) - -#define FETCH(x) fetch_texel_3d_##x - -#else -#error illegal number of texture dimensions -#endif - - -/* MESA_FORMAT_RGBA **********************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLfloats */ -static void FETCH(f_rgba)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = CHAN_TO_FLOAT(src[3]); -} - -#if DIM == 3 -/* Store a GLchan RGBA texel */ -static void store_texel_rgba(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; - dst[3] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_RGB ***********************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLfloats */ -static void FETCH(f_rgb)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - -/* MESA_FORMAT_ALPHA *********************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA texture, returning 4 GLchans */ -static void FETCH(f_alpha)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = CHAN_TO_FLOAT(src[0]); -} - -#if DIM == 3 -static void store_texel_alpha(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_LUMINANCE *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMIN texture, returning 4 GLchans */ -static void FETCH(f_luminance)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = CHAN_TO_FLOAT(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - -/* MESA_FORMAT_LUMINANCE_ALPHA ***********************************************/ - -/* Fetch texel from 1D, 2D or 3D L_A texture, returning 4 GLchans */ -static void FETCH(f_luminance_alpha)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = CHAN_TO_FLOAT(src[0]); - texel[ACOMP] = CHAN_TO_FLOAT(src[1]); -} - -#if DIM == 3 -static void store_texel_luminance_alpha(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_INTENSITY *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D INT. texture, returning 4 GLchans */ -static void FETCH(f_intensity)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = CHAN_TO_FLOAT(src[0]); -} - -#if DIM == 3 -static void store_texel_intensity(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_Z32 ***********************************************************/ - -/* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture, - * returning 1 GLfloat. - * Note: no GLchan version of this function. - */ -static void FETCH(f_z32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[0] = src[0] * (1.0F / 0xffffffff); -} - -#if DIM == 3 -static void store_texel_z32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLuint *depth = (const GLuint *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_Z16 ***********************************************************/ - -/* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture, - * returning 1 GLfloat. - * Note: no GLchan version of this function. - */ -static void FETCH(f_z16)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[0] = src[0] * (1.0F / 65535.0F); -} - -#if DIM == 3 -static void store_texel_z16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLushort *depth = (const GLushort *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_RGBA_F32 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. - */ -static void FETCH(f_rgba_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = src[3]; -} - -#if DIM == 3 -static void store_texel_rgba_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = depth[RCOMP]; - dst[1] = depth[GCOMP]; - dst[2] = depth[BCOMP]; - dst[3] = depth[ACOMP]; -} -#endif - - -/* MESA_FORMAT_RGBA_F16 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = _mesa_half_to_float(src[3]); -} - -#if DIM == 3 -static void store_texel_rgba_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); -} -#endif - -/* MESA_FORMAT_RGB_F32 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_RGB_F16 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); -} -#endif - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_alpha_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - -#if DIM == 3 -static void store_texel_alpha_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = src[1]; -} - -#if DIM == 3 -static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = _mesa_half_to_float(src[1]); -} - -#if DIM == 3 -static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); - dst[1] = _mesa_float_to_half(rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_INTENSITY_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_intensity_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_INTENSITY_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - -#if DIM == 3 -static void store_texel_intensity_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); -} -#endif - - - - -/* - * Begin Hardware formats - */ - -/* MESA_FORMAT_RGBA8888 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */ -static void FETCH(f_rgba8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); -} - - - -#if DIM == 3 -static void store_texel_rgba8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGBA888_REV ***************************************************/ - -/* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ -static void FETCH(f_rgba8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB8888 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ -static void FETCH(f_argb8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_argb8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB8888_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */ -static void FETCH(f_argb8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); -} - -#if DIM == 3 -static void store_texel_argb8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGB888 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ -static void FETCH(f_rgb888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_FLOAT( src[2] ); - texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); - texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[BCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_BGR888 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ -static void FETCH(f_bgr888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_FLOAT( src[0] ); - texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); - texel[BCOMP] = UBYTE_TO_FLOAT( src[2] ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_bgr888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - - -/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding) - instead of slow (g << 2) * 255 / 252 (always rounds down) */ - -/* MESA_FORMAT_RGB565 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ -static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); - texel[GCOMP] = ((s >> 5 ) & 0x3f) * (1.0F / 63.0F); - texel[BCOMP] = ((s ) & 0x1f) * (1.0F / 31.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb565(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_RGB565_REV ****************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ -static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb565_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); -} -#endif - -/* MESA_FORMAT_RGBA4444 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(f_rgba4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); - texel[GCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); - texel[BCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); - texel[ACOMP] = ((s ) & 0xf) * (1.0F / 15.0F); -} - -#if DIM == 3 -static void store_texel_rgba4444(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB4444 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); - texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); - texel[BCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); - texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); -} - -#if DIM == 3 -static void store_texel_argb4444(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB4444_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ -static void FETCH(f_argb4444_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); - texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); - texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); - texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); -} - -#if DIM == 3 -static void store_texel_argb4444_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); -} -#endif - -/* MESA_FORMAT_RGBA5551 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(f_rgba5551)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); - texel[GCOMP] = ((s >> 6) & 0x1f) * (1.0F / 31.0F); - texel[BCOMP] = ((s >> 1) & 0x1f) * (1.0F / 31.0F); - texel[ACOMP] = ((s ) & 0x01) * 1.0F; -} - -#if DIM == 3 -static void store_texel_rgba5551(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -/* MESA_FORMAT_ARGB1555 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); - texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); - texel[BCOMP] = ((s >> 0) & 0x1f) * (1.0F / 31.0F); - texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F; -} - -#if DIM == 3 -static void store_texel_argb1555(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB1555_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ -static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 ); -} - -#if DIM == 3 -static void store_texel_argb1555_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_AL88 **********************************************************/ - -/* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ -static void FETCH(f_al88)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); -} - -#if DIM == 3 -static void store_texel_al88(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_AL88_REV ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ -static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); - texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); -} - -#if DIM == 3 -static void store_texel_al88_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGB332 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ -static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - const GLubyte s = *src; - texel[RCOMP] = ((s >> 5) & 0x7) * (1.0F / 7.0F); - texel[GCOMP] = ((s >> 2) & 0x7) * (1.0F / 7.0F); - texel[BCOMP] = ((s ) & 0x3) * (1.0F / 3.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb332(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_A8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ -static void FETCH(f_a8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); -} - -#if DIM == 3 -static void store_texel_a8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_L8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ -static void FETCH(f_l8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_l8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_I8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ -static void FETCH(f_i8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); -} - -#if DIM == 3 -static void store_texel_i8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_CI8 ***********************************************************/ - -/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a - * color table, and return 4 GLchans. - */ -static void FETCH(f_ci8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - const struct gl_color_table *palette; - GLuint index; - GET_CURRENT_CONTEXT(ctx); - - if (ctx->Texture.SharedPalette) { - palette = &ctx->Texture.Palette; - } - else { - palette = &texImage->TexObject->Palette; - } - if (palette->Size == 0) - return; /* undefined results */ - - /* Mask the index against size of palette to avoid going out of bounds */ - index = (*src) & (palette->Size - 1); - - { - const GLfloat *table = palette->TableF; - switch (palette->_BaseFormat) { - case GL_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = table[index]; - break; - case GL_LUMINANCE: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = table[index]; - texel[ACOMP] = 1.0F; - break; - case GL_INTENSITY: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = table[index]; - break; - case GL_LUMINANCE_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = table[index * 2 + 0]; - texel[ACOMP] = table[index * 2 + 1]; - break; - case GL_RGB: - texel[RCOMP] = table[index * 3 + 0]; - texel[GCOMP] = table[index * 3 + 1]; - texel[BCOMP] = table[index * 3 + 2]; - texel[ACOMP] = 1.0F; - break; - case GL_RGBA: - texel[RCOMP] = table[index * 4 + 0]; - texel[GCOMP] = table[index * 4 + 1]; - texel[BCOMP] = table[index * 4 + 2]; - texel[ACOMP] = table[index * 4 + 3]; - break; - default: - _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); - return; - } - } -} - -#if DIM == 3 -static void store_texel_ci8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *index = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = *index; -} -#endif - - -#if FEATURE_EXT_texture_sRGB - -/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ -/* Note: component order is same as for MESA_FORMAT_RGB888 */ -static void FETCH(srgb8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = nonlinear_to_linear(src[2]); - texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_srgb8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[BCOMP]; /* no conversion */ - dst[1] = rgba[GCOMP]; - dst[2] = rgba[RCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */ -static void FETCH(srgba8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = nonlinear_to_linear( (s >> 24) ); - texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); - texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */ -} - -#if DIM == 3 -static void store_texel_srgba8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */ -static void FETCH(sargb8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); - texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); - texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */ -} - -#if DIM == 3 -static void store_texel_sargb8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - -/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ -static void FETCH(sl8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_sl8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */ -static void FETCH(sla8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */ -} - -#if DIM == 3 -static void store_texel_sla8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/* MESA_FORMAT_DUDV8 ********************************************************/ - -/* this format by definition produces 0,0,0,1 as rgba values, - however we'll return the dudv values as rg and fix up elsewhere */ -static void FETCH(dudv8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLbyte *src = TEXEL_ADDR(GLbyte, texImage, i, j, k, 2); - texel[RCOMP] = BYTE_TO_FLOAT(src[0]); - texel[GCOMP] = BYTE_TO_FLOAT(src[1]); - texel[BCOMP] = 0; - texel[ACOMP] = 0; -} - -/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/ - -static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); - texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); - texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); - texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); -} - -#if DIM == 3 -static void store_texel_signed_rgba8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLbyte *rgba = (const GLbyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -static void FETCH(signed_rgba8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); - texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); - texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); - texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_signed_rgba8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - - -/* MESA_FORMAT_YCBCR *********************************************************/ - -/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats. - * We convert YCbCr to RGB here. - */ -static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ - const GLushort *src1 = src0 + 1; /* odd */ - const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ - const GLubyte cb = *src0 & 0xff; /* chroma U */ - const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ - const GLubyte cr = *src1 & 0xff; /* chroma V */ - const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ - GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); - GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); - GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); - r *= (1.0F / 255.0F); - g *= (1.0F / 255.0F); - b *= (1.0F / 255.0F); - texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); - texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); - texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_ycbcr(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* XXX to do */ -} -#endif - - -/* MESA_FORMAT_YCBCR_REV *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLfloats. - * We convert YCbCr to RGB here. - */ -static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ - const GLushort *src1 = src0 + 1; /* odd */ - const GLubyte y0 = *src0 & 0xff; /* luminance */ - const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ - const GLubyte y1 = *src1 & 0xff; /* luminance */ - const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ - const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ - GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); - GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); - GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); - r *= (1.0F / 255.0F); - g *= (1.0F / 255.0F); - b *= (1.0F / 255.0F); - texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); - texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); - texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* XXX to do */ -} -#endif - - -/* MESA_TEXFORMAT_Z24_S8 ***************************************************/ - -static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* only return Z, not stencil data */ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 1.0F / (GLfloat) 0xffffff; - texel[0] = ((*src) >> 8) * scale; - ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_Z24_S8); - ASSERT(texel[0] >= 0.0F); - ASSERT(texel[0] <= 1.0F); -} - -#if DIM == 3 -static void store_texel_z24_s8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - /* only store Z, not stencil */ - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat depth = *((GLfloat *) texel); - GLuint zi = ((GLuint) (depth * 0xffffff)) << 8; - *dst = zi | (*dst & 0xff); -} -#endif - - -/* MESA_TEXFORMAT_S8_Z24 ***************************************************/ - -static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* only return Z, not stencil data */ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 1.0F / (GLfloat) 0xffffff; - texel[0] = ((*src) & 0x00ffffff) * scale; - ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_S8_Z24); - ASSERT(texel[0] >= 0.0F); - ASSERT(texel[0] <= 1.0F); -} - -#if DIM == 3 -static void store_texel_s8_z24(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - /* only store Z, not stencil */ - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat depth = *((GLfloat *) texel); - GLuint zi = (GLuint) (depth * 0xffffff); - *dst = zi | (*dst & 0xff000000); -} -#endif - - -#undef TEXEL_ADDR -#undef DIM -#undef FETCH diff --git a/mesalib/src/mesa/main/texgen.c b/mesalib/src/mesa/main/texgen.c index e3feb024c..be4e03bc5 100644 --- a/mesalib/src/mesa/main/texgen.c +++ b/mesalib/src/mesa/main/texgen.c @@ -35,7 +35,12 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texgen.h" +#include "main/texstate.h" #include "math/m_matrix.h" +#include "glapi/dispatch.h" + + +#if FEATURE_texgen /** @@ -79,7 +84,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -161,7 +166,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; @@ -178,15 +183,17 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { - GLfloat p = (GLfloat) param; - _mesa_TexGenfv( coord, pname, &p ); + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv( coord, pname, p ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; @@ -203,22 +210,28 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { - _mesa_TexGenfv(coord, pname, ¶m); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv(coord, pname, p); } void GLAPIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) { - _mesa_TexGeniv( coord, pname, ¶m ); + GLint p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0; + _mesa_TexGeniv( coord, pname, p ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { struct gl_texture_unit *texUnit; @@ -231,7 +244,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -256,7 +269,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { struct gl_texture_unit *texUnit; @@ -269,7 +282,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -294,7 +307,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { struct gl_texture_unit *texUnit; @@ -307,7 +320,7 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -337,3 +350,19 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) } +void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ + SET_GetTexGendv(disp, _mesa_GetTexGendv); + SET_GetTexGenfv(disp, _mesa_GetTexGenfv); + SET_GetTexGeniv(disp, _mesa_GetTexGeniv); + SET_TexGend(disp, _mesa_TexGend); + SET_TexGendv(disp, _mesa_TexGendv); + SET_TexGenf(disp, _mesa_TexGenf); + SET_TexGenfv(disp, _mesa_TexGenfv); + SET_TexGeni(disp, _mesa_TexGeni); + SET_TexGeniv(disp, _mesa_TexGeniv); +} + + +#endif /* FEATURE_texgen */ diff --git a/mesalib/src/mesa/main/texgen.h b/mesalib/src/mesa/main/texgen.h index 073588efc..f6924ef72 100644 --- a/mesalib/src/mesa/main/texgen.h +++ b/mesalib/src/mesa/main/texgen.h @@ -27,36 +27,45 @@ #define TEXGEN_H -#include "main/glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +#if FEATURE_texgen -extern void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) \ + do { \ + (driver)->TexGen = impl ## TexGen; \ + } while (0) extern void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); extern void GLAPIENTRY -_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); -extern void GLAPIENTRY -_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +extern void +_mesa_init_texgen_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); +#else /* FEATURE_texgen */ -extern void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); +static void +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) +{ +} -extern void GLAPIENTRY -_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); +static void INLINE +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ +} + +static INLINE void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_texgen */ #endif /* TEXGEN_H */ diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index 14d6fc765..23765d275 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/src/mesa/main/texgetimage.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.5 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (c) 2009 VMware, Inc. @@ -31,10 +31,11 @@ #include "glheader.h" #include "bufferobj.h" +#include "enums.h" #include "context.h" +#include "formats.h" #include "image.h" #include "texcompress.h" -#include "texformat.h" #include "texgetimage.h" #include "teximage.h" #include "texstate.h" @@ -43,29 +44,6 @@ #if FEATURE_EXT_texture_sRGB -/** - * Test if given texture image is an sRGB format. - */ -static GLboolean -is_srgb_teximage(const struct gl_texture_image *texImage) -{ - switch (texImage->TexFormat->MesaFormat) { - case MESA_FORMAT_SRGB8: - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: - case MESA_FORMAT_SL8: - case MESA_FORMAT_SLA8: - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - /** * Convert a float value from linear space to a * non-linear sRGB value in [0, 255]. @@ -107,9 +85,358 @@ type_with_negative_values(GLenum type) } +/** + * glGetTexImage for color index pixels. + */ +static void +get_tex_color_index(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLuint indexBits = + _mesa_get_format_bits(texImage->TexFormat, GL_TEXTURE_INDEX_SIZE_EXT); + const GLbitfield transferOps = 0x0; + GLint img, row, col; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + GLuint indexRow[MAX_WIDTH]; + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + assert(dest); + + if (indexBits == 8) { + const GLubyte *src = (const GLubyte *) texImage->Data; + src += width * (img * texImage->Height + row); + for (col = 0; col < width; col++) { + indexRow[col] = src[col]; + } + } + else if (indexBits == 16) { + const GLushort *src = (const GLushort *) texImage->Data; + src += width * (img * texImage->Height + row); + for (col = 0; col < width; col++) { + indexRow[col] = src[col]; + } + } + else { + _mesa_problem(ctx, "Color index problem in _mesa_GetTexImage"); + } + _mesa_pack_index_span(ctx, width, type, dest, + indexRow, &ctx->Pack, transferOps); + } + } +} + + +/** + * glGetTexImage for depth/Z pixels. + */ +static void +get_tex_depth(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + GLint img, row, col; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + GLfloat depthRow[MAX_WIDTH]; + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + assert(dest); + + for (col = 0; col < width; col++) { + texImage->FetchTexelf(texImage, col, row, img, depthRow + col); + } + _mesa_pack_depth_span(ctx, width, dest, type, depthRow, &ctx->Pack); + } + } +} + + +/** + * glGetTexImage for depth/stencil pixels. + */ +static void +get_tex_depth_stencil(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLuint *src = (const GLuint *) texImage->Data; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + _mesa_memcpy(dest, src, width * sizeof(GLuint)); + if (ctx->Pack.SwapBytes) { + _mesa_swap4((GLuint *) dest, width); + } + + src += width * row + width * height * img; + } + } +} + + +/** + * glGetTexImage for YCbCr pixels. + */ +static void +get_tex_ycbcr(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLint rowstride = texImage->RowStride; + const GLushort *src = (const GLushort *) texImage->Data; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + _mesa_memcpy(dest, src, width * sizeof(GLushort)); + + /* check for byte swapping */ + if ((texImage->TexFormat == MESA_FORMAT_YCBCR + && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || + (texImage->TexFormat == MESA_FORMAT_YCBCR_REV + && type == GL_UNSIGNED_SHORT_8_8_MESA)) { + if (!ctx->Pack.SwapBytes) + _mesa_swap2((GLushort *) dest, width); + } + else if (ctx->Pack.SwapBytes) { + _mesa_swap2((GLushort *) dest, width); + } + + src += rowstride; + } + } +} + + +/** + * glGetTexImagefor sRGB pixels; + */ +static void +get_tex_srgb(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLbitfield transferOps = 0x0; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + + /* convert row to RGBA format */ + for (col = 0; col < width; col++) { + texImage->FetchTexelf(texImage, col, row, img, rgba[col]); + if (texImage->_BaseFormat == GL_LUMINANCE) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_RGB || + texImage->_BaseFormat == GL_RGBA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); + rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps); + } + } +} + + +/** + * glGetTexImagefor RGBA, Luminance, etc. pixels. + * This is the slow way since we use texture sampling. + */ +static void +get_tex_rgba(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + /* Normally, no pixel transfer ops are performed during glGetTexImage. + * The only possible exception is component clamping to [0,1]. + */ + GLbitfield transferOps = 0x0; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + GLenum dataType = _mesa_get_format_datatype(texImage->TexFormat); + + /* clamp does not apply to GetTexImage (final conversion)? + * Looks like we need clamp though when going from format + * containing negative values to unsigned format. + */ + if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) { + transferOps |= IMAGE_CLAMP_BIT; + } + else if (!type_with_negative_values(type) && + (dataType == GL_FLOAT || + dataType == GL_SIGNED_NORMALIZED)) { + transferOps |= IMAGE_CLAMP_BIT; + } + + for (col = 0; col < width; col++) { + texImage->FetchTexelf(texImage, col, row, img, rgba[col]); + if (texImage->_BaseFormat == GL_ALPHA) { + rgba[col][RCOMP] = 0.0F; + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + } + else if (texImage->_BaseFormat == GL_LUMINANCE) { + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + rgba[col][ACOMP] = 1.0F; + } + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + } + else if (texImage->_BaseFormat == GL_INTENSITY) { + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + rgba[col][ACOMP] = 1.0F; + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps); + } + } +} + + +/** + * Try to do glGetTexImage() with simple memcpy(). + * \return GL_TRUE if done, GL_FALSE otherwise + */ +static GLboolean +get_tex_memcpy(GLcontext *ctx, GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_object *texObj, + const struct gl_texture_image *texImage) +{ + GLboolean memCopy = GL_FALSE; + + /* Texture image should have been mapped already */ + assert(texImage->Data); + + /* + * Check if the src/dst formats are compatible. + * Also note that GL's pixel transfer ops don't apply to glGetTexImage() + * so we don't have to worry about those. + * XXX more format combinations could be supported here. + */ + if ((texObj->Target == GL_TEXTURE_1D || + texObj->Target == GL_TEXTURE_2D || + texObj->Target == GL_TEXTURE_RECTANGLE || + (texObj->Target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && + texObj->Target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) { + if (texImage->TexFormat == MESA_FORMAT_ARGB8888 && + format == GL_BGRA && + type == GL_UNSIGNED_BYTE && + !ctx->Pack.SwapBytes && + _mesa_little_endian()) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_AL88 && + format == GL_LUMINANCE_ALPHA && + type == GL_UNSIGNED_BYTE && + !ctx->Pack.SwapBytes && + _mesa_little_endian()) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_L8 && + format == GL_LUMINANCE && + type == GL_UNSIGNED_BYTE) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_A8 && + format == GL_ALPHA && + type == GL_UNSIGNED_BYTE) { + memCopy = GL_TRUE; + } + } + + if (memCopy) { + const GLuint bpp = _mesa_get_format_bytes(texImage->TexFormat); + const GLuint bytesPerRow = texImage->Width * bpp; + GLubyte *dst = + _mesa_image_address2d(&ctx->Pack, pixels, texImage->Width, + texImage->Height, format, type, 0, 0); + const GLint dstRowStride = + _mesa_image_row_stride(&ctx->Pack, texImage->Width, format, type); + const GLubyte *src = texImage->Data; + const GLint srcRowStride = texImage->RowStride * bpp; + GLuint row; + + if (bytesPerRow == dstRowStride && bytesPerRow == srcRowStride) { + memcpy(dst, src, bytesPerRow * texImage->Height); + } + else { + for (row = 0; row < texImage->Height; row++) { + memcpy(dst, src, bytesPerRow); + dst += dstRowStride; + src += srcRowStride; + } + } + } + + return memCopy; +} + + /** * This is the software fallback for Driver.GetTexImage(). * All error checking will have been done before this routine is called. + * The texture image must be mapped. */ void _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, @@ -117,7 +444,21 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; + GLuint dimensions; + + /* If we get here, the texture image should be mapped */ + assert(texImage->Data); + + switch (target) { + case GL_TEXTURE_1D: + dimensions = 1; + break; + case GL_TEXTURE_3D: + dimensions = 3; + break; + default: + dimensions = 2; + } if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* Packing texture image into a PBO. @@ -130,8 +471,8 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION,"glGetTexImage(PBO is mapped)"); + /* out of memory or other unexpected error */ + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); return; } /* was an offset into the PBO. @@ -139,164 +480,27 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, */ pixels = ADD_POINTERS(buf, pixels); } - else if (!pixels) { - /* not an error */ - return; - } - { - const GLint width = texImage->Width; - const GLint height = texImage->Height; - const GLint depth = texImage->Depth; - GLint img, row; - for (img = 0; img < depth; img++) { - for (row = 0; row < height; row++) { - /* compute destination address in client memory */ - GLvoid *dest = _mesa_image_address( dimensions, &ctx->Pack, pixels, - width, height, format, type, - img, row, 0); - assert(dest); - - if (format == GL_COLOR_INDEX) { - GLuint indexRow[MAX_WIDTH]; - GLint col; - /* Can't use FetchTexel here because that returns RGBA */ - if (texImage->TexFormat->IndexBits == 8) { - const GLubyte *src = (const GLubyte *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else if (texImage->TexFormat->IndexBits == 16) { - const GLushort *src = (const GLushort *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else { - _mesa_problem(ctx, - "Color index problem in _mesa_GetTexImage"); - } - _mesa_pack_index_span(ctx, width, type, dest, - indexRow, &ctx->Pack, - 0 /* no image transfer */); - } - else if (format == GL_DEPTH_COMPONENT) { - GLfloat depthRow[MAX_WIDTH]; - GLint col; - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, - depthRow + col); - } - _mesa_pack_depth_span(ctx, width, dest, type, - depthRow, &ctx->Pack); - } - else if (format == GL_DEPTH_STENCIL_EXT) { - /* XXX Note: we're bypassing texImage->FetchTexel()! */ - const GLuint *src = (const GLuint *) texImage->Data; - src += width * row + width * height * img; - _mesa_memcpy(dest, src, width * sizeof(GLuint)); - if (ctx->Pack.SwapBytes) { - _mesa_swap4((GLuint *) dest, width); - } - } - else if (format == GL_YCBCR_MESA) { - /* No pixel transfer */ - const GLint rowstride = texImage->RowStride; - MEMCPY(dest, - (const GLushort *) texImage->Data + row * rowstride, - width * sizeof(GLushort)); - /* check for byte swapping */ - if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR - && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || - (texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV - && type == GL_UNSIGNED_SHORT_8_8_MESA)) { - if (!ctx->Pack.SwapBytes) - _mesa_swap2((GLushort *) dest, width); - } - else if (ctx->Pack.SwapBytes) { - _mesa_swap2((GLushort *) dest, width); - } - } -#if FEATURE_EXT_texture_sRGB - else if (is_srgb_teximage(texImage)) { - /* special case this since need to backconvert values */ - /* convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->_BaseFormat == GL_LUMINANCE) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_RGB || - texImage->_BaseFormat == GL_RGBA) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); - rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps); - } -#endif /* FEATURE_EXT_texture_sRGB */ - else { - /* general case: convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - - /* clamp does not apply to GetTexImage (final conversion)? - * Looks like we need clamp though when going from format - * containing negative values to unsigned format. - */ - if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) - transferOps |= IMAGE_CLAMP_BIT; - else if (!type_with_negative_values(type) && - (texImage->TexFormat->DataType == GL_FLOAT || - texImage->TexFormat->DataType == GL_SIGNED_NORMALIZED)) - transferOps |= IMAGE_CLAMP_BIT; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->_BaseFormat == GL_ALPHA) { - rgba[col][RCOMP] = 0.0; - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_LUMINANCE) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_INTENSITY) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps); - } /* format */ - } /* row */ - } /* img */ + if (get_tex_memcpy(ctx, format, type, pixels, texObj, texImage)) { + /* all done */ + } + else if (format == GL_COLOR_INDEX) { + get_tex_color_index(ctx, dimensions, format, type, pixels, texImage); + } + else if (format == GL_DEPTH_COMPONENT) { + get_tex_depth(ctx, dimensions, format, type, pixels, texImage); + } + else if (format == GL_DEPTH_STENCIL_EXT) { + get_tex_depth_stencil(ctx, dimensions, format, type, pixels, texImage); + } + else if (format == GL_YCBCR_MESA) { + get_tex_ycbcr(ctx, dimensions, format, type, pixels, texImage); + } + else if (_mesa_get_format_color_encoding(texImage->TexFormat) == GL_SRGB) { + get_tex_srgb(ctx, dimensions, format, type, pixels, texImage); + } + else { + get_tex_rgba(ctx, dimensions, format, type, pixels, texImage); } if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { @@ -317,40 +521,43 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLuint size; + const GLuint row_stride = _mesa_format_row_stride(texImage->TexFormat, + texImage->Width); + const GLuint row_stride_stored = _mesa_format_row_stride(texImage->TexFormat, + texImage->RowStride); + GLuint i; if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ - GLubyte *buf; - if ((const GLubyte *) img + texImage->CompressedSize > - (const GLubyte *) ctx->Pack.BufferObj->Size) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); + GLubyte *buf = (GLubyte *) + ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(PBO is mapped)"); + /* out of memory or other unexpected error */ + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glGetCompresssedTexImage(map PBO failed)"); return; } img = ADD_POINTERS(buf, img); } - else if (!img) { - /* not an error */ - return; - } - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat->MesaFormat); + /* no pixelstore or pixel transfer, but respect stride */ - /* just memcpy, no pixelstore or pixel transfer */ - _mesa_memcpy(img, texImage->Data, size); + if (row_stride == row_stride_stored) { + const GLuint size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); + _mesa_memcpy(img, texImage->Data, size); + } + else { + GLuint bw, bh; + _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh); + for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) { + memcpy((GLubyte *)img + i * row_stride, + (GLubyte *)texImage->Data + i * row_stride_stored, row_stride); + } + } if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, @@ -368,10 +575,10 @@ static GLboolean getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint maxLevels = _mesa_max_texture_levels(ctx, target); + GLenum baseFormat; if (maxLevels == 0) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target=0x%x)", target); @@ -421,8 +628,7 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, return GL_TRUE; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); if (!texObj || _mesa_is_proxy_texture(target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target)"); @@ -434,40 +640,42 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, /* out of memory */ return GL_TRUE; } + + baseFormat = _mesa_get_format_base_format(texImage->TexFormat); /* Make sure the requested image format is compatible with the * texture's format. Note that a color index texture can be converted * to RGBA so that combo is allowed. */ if (_mesa_is_color_format(format) - && !_mesa_is_color_format(texImage->TexFormat->BaseFormat) - && !_mesa_is_index_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_color_format(baseFormat) + && !_mesa_is_index_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_index_format(format) - && !_mesa_is_index_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_index_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_depth_format(format) - && !_mesa_is_depth_format(texImage->TexFormat->BaseFormat) - && !_mesa_is_depthstencil_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_depth_format(baseFormat) + && !_mesa_is_depthstencil_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_ycbcr_format(format) - && !_mesa_is_ycbcr_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_ycbcr_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_depthstencil_format(format) - && !_mesa_is_depthstencil_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_depthstencil_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_dudv_format(format) - && !_mesa_is_dudv_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_dudv_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } @@ -479,7 +687,14 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, texImage->Height, texImage->Depth, format, type, pixels)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexImage(invalid PBO access)"); + "glGetTexImage(out of bounds PBO write)"); + return GL_TRUE; + } + + /* PBO should not be mapped */ + if (_mesa_bufferobj_mapped(ctx->Pack.BufferObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexImage(PBO is mapped)"); return GL_TRUE; } } @@ -502,8 +717,8 @@ void GLAPIENTRY _mesa_GetTexImage( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; + struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -511,15 +726,25 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + if (!_mesa_is_bufferobj(ctx->Pack.BufferObj) && !pixels) { + /* not an error, do nothing */ + return; + } + + texObj = _mesa_get_current_tex_object(ctx, target); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { + _mesa_debug(ctx, "glGetTexImage(tex %u) format = %s, w=%d, h=%d," + " dstFmt=0x%x, dstType=0x%x\n", + texObj->Name, + _mesa_get_format_name(texImage->TexFormat), + texImage->Width, texImage->Height, + format, type); + } _mesa_lock_texture(ctx, texObj); { - struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, texObj, target, level); - - /* typically, this will call _mesa_get_teximage() */ ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels, texObj, texImage); } @@ -527,55 +752,119 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, } + +/** + * Do error checking for a glGetCompressedTexImage() call. + * \return GL_TRUE if any error, GL_FALSE if no errors. + */ +static GLboolean +getcompressedteximage_error_check(GLcontext *ctx, GLenum target, GLint level, + GLvoid *img) +{ + struct gl_texture_object *texObj; + struct gl_texture_image *texImage; + const GLuint maxLevels = _mesa_max_texture_levels(ctx, target); + + if (maxLevels == 0) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImage(target=0x%x)", + target); + return GL_TRUE; + } + + if (level < 0 || level >= maxLevels) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetCompressedTexImageARB(bad level = %d)", level); + return GL_TRUE; + } + + if (_mesa_is_proxy_texture(target)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetCompressedTexImageARB(bad target = %s)", + _mesa_lookup_enum_by_nr(target)); + return GL_TRUE; + } + + texObj = _mesa_get_current_tex_object(ctx, target); + if (!texObj) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB(target)"); + return GL_TRUE; + } + + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + if (!texImage) { + /* probably invalid mipmap level */ + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetCompressedTexImageARB(level)"); + return GL_TRUE; + } + + if (!_mesa_is_format_compressed(texImage->TexFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImageARB(texture is not compressed)"); + return GL_TRUE; + } + + if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { + GLuint compressedSize; + + /* make sure PBO is not mapped */ + if (_mesa_bufferobj_mapped(ctx->Pack.BufferObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImage(PBO is mapped)"); + return GL_TRUE; + } + + compressedSize = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); + + /* do bounds checking on PBO write */ + if ((const GLubyte *) img + compressedSize > + (const GLubyte *) ctx->Pack.BufferObj->Size) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImage(out of bounds PBO write)"); + return GL_TRUE; + } + } + + return GL_FALSE; +} + + void GLAPIENTRY _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - GLint maxLevels; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); - if (!texObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB"); + if (getcompressedteximage_error_check(ctx, target, level, img)) { return; } - maxLevels = _mesa_max_texture_levels(ctx, target); - ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */ - - if (level < 0 || level >= maxLevels) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)"); + if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !img) { + /* not an error, do nothing */ return; } - if (_mesa_is_proxy_texture(target)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB(target)"); - return; + texObj = _mesa_get_current_tex_object(ctx, target); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { + _mesa_debug(ctx, + "glGetCompressedTexImage(tex %u) format = %s, w=%d, h=%d\n", + texObj->Name, + _mesa_get_format_name(texImage->TexFormat), + texImage->Width, texImage->Height); } _mesa_lock_texture(ctx, texObj); { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (texImage) { - if (texImage->IsCompressed) { - /* this typically calls _mesa_get_compressed_teximage() */ - ctx->Driver.GetCompressedTexImage(ctx, target, level, img, - texObj, texImage); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImageARB"); - } - } - else { - /* probably invalid mipmap level */ - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetCompressedTexImageARB(level)"); - } + ctx->Driver.GetCompressedTexImage(ctx, target, level, img, + texObj, texImage); } _mesa_unlock_texture(ctx, texObj); } diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index a8160c273..b946f3c69 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -33,9 +33,7 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "enums.h" #include "fbobject.h" #include "framebuffer.h" @@ -45,7 +43,7 @@ #include "macros.h" #include "state.h" #include "texcompress.h" -#include "texformat.h" +#include "texfetch.h" #include "teximage.h" #include "texstate.h" #include "texstore.h" @@ -84,63 +82,6 @@ _mesa_free_texmemory(void *m) } - - -#if 0 -static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img) -{ -#if CHAN_TYPE != GL_UNSIGNED_BYTE - _mesa_problem(NULL, "PrintTexture not supported"); -#else - GLuint i, j, c; - const GLubyte *data = (const GLubyte *) img->Data; - - if (!data) { - _mesa_printf("No texture data\n"); - return; - } - - switch (img->Format) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - case GL_COLOR_INDEX: - c = 1; - break; - case GL_LUMINANCE_ALPHA: - c = 2; - break; - case GL_RGB: - c = 3; - break; - case GL_RGBA: - c = 4; - break; - default: - _mesa_problem(NULL, "error in PrintTexture\n"); - return; - } - - for (i = 0; i < img->Height; i++) { - for (j = 0; j < img->Width; j++) { - if (c==1) - _mesa_printf("%02x ", data[0]); - else if (c==2) - _mesa_printf("%02x%02x ", data[0], data[1]); - else if (c==3) - _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); - else if (c==4) - _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); - data += (img->RowStride - img->Width) * c; - } - /* XXX use img->ImageStride here */ - _mesa_printf("\n"); - } -#endif -} -#endif - - /* * Compute floor(log_base_2(n)). * If n < 0 return -1. @@ -641,6 +582,17 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, } +/** + * Return pointer to texture object for given target on current texture unit. + */ +struct gl_texture_object * +_mesa_get_current_tex_object(GLcontext *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 @@ -902,11 +854,9 @@ clear_teximage_fields(struct gl_texture_image *img) img->HeightLog2 = 0; img->DepthLog2 = 0; img->Data = NULL; - img->TexFormat = &_mesa_null_texformat; + img->TexFormat = MESA_FORMAT_NONE; img->FetchTexelc = NULL; img->FetchTexelf = NULL; - img->IsCompressed = 0; - img->CompressedSize = 0; } @@ -969,9 +919,6 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2); - img->IsCompressed = GL_FALSE; - img->CompressedSize = 0; - 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))) @@ -1004,6 +951,9 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, img->HeightScale = (GLfloat) img->Height; img->DepthScale = (GLfloat) img->Depth; } + + img->FetchTexelc = NULL; + img->FetchTexelf = NULL; } @@ -1317,8 +1267,8 @@ texture_error_check( GLcontext *ctx, GLenum target, if (_mesa_base_tex_format(ctx, internalFormat) < 0) { if (!isProxy) { _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(internalFormat=0x%x)", - dimensions, internalFormat); + "glTexImage%dD(internalFormat=%s)", + dimensions, _mesa_lookup_enum_by_nr(internalFormat)); } return GL_TRUE; } @@ -1530,6 +1480,11 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, 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( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, @@ -1577,41 +1532,35 @@ subtexture_error_check2( GLcontext *ctx, GLuint dimensions, } } -#if FEATURE_EXT_texture_sRGB - if (destTex->InternalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) { - if ((width & 0x3) || (height & 0x3) || - (xoffset & 0x3) || (yoffset & 0x3)) - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%dD(size or offset not multiple of 4)", - dimensions); - return GL_TRUE; - } -#endif + if (_mesa_is_format_compressed(destTex->TexFormat)) { + GLuint bw, bh; - if (destTex->IsCompressed) { if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, - "glTexSubImage%D(target)", dimensions); + "glTexSubImage%D(target=%s)", dimensions, + _mesa_lookup_enum_by_nr(target)); return GL_TRUE; } - /* offset must be multiple of 4 */ - if ((xoffset & 3) || (yoffset & 3)) { + + /* 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%D(xoffset or yoffset)", dimensions); + "glTexSubImage%D(xoffset = %d, yoffset = %d)", + dimensions, xoffset, yoffset); return GL_TRUE; } - /* size must be multiple of 4 or equal to whole texture size */ - if ((width & 3) && (GLuint) width != destTex->Width) { + /* 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%D(width)", dimensions); + "glTexSubImage%D(width = %d)", dimensions, width); return GL_TRUE; } - if ((height & 3) && (GLuint) height != destTex->Height) { + if ((height % bh != 0) && (GLuint) height != destTex->Height) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(width)", dimensions); + "glTexSubImage%D(height = %d)", dimensions, height); return GL_TRUE; } } @@ -1953,7 +1902,7 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, } } - if (teximage->IsCompressed) { + if (_mesa_is_format_compressed(teximage->TexFormat)) { if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%d(target)", dimensions); @@ -2076,6 +2025,25 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, } +/** + * 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(GLcontext *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) @@ -2149,7 +2117,6 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, if (target == GL_TEXTURE_1D) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); @@ -2162,43 +2129,50 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, 1, 1, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + format, type); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + + /* Give the texture to the driver. may be null. */ + ASSERT(ctx->Driver.TexImage1D); + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, format, type, pixels, + &ctx->Unpack, texObj, texImage); + + ASSERT(texImage->TexFormat); + + _mesa_set_fetch_functions(texImage, 1); + + check_gen_mipmap(ctx, target, texObj, level); + + update_fbo_texture(ctx, texObj, face, level); - ASSERT(texImage->Data == NULL); - - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, 1, 1, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage1D); - - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat, - width, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_1D) { @@ -2217,8 +2191,8 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); } } else { @@ -2263,7 +2237,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, (ctx->Extensions.MESA_texture_array && target == GL_TEXTURE_1D_ARRAY_EXT)) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); @@ -2277,42 +2250,49 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage2D); - - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat, - width, height, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + format, type); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + + /* Give the texture to the driver. may be null. */ + ASSERT(ctx->Driver.TexImage2D); + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, format, type, + pixels, &ctx->Unpack, texObj, texImage); + + ASSERT(texImage->TexFormat); + + _mesa_set_fetch_functions(texImage, 2); + + check_gen_mipmap(ctx, target, texObj, level); + + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_2D || @@ -2337,8 +2317,8 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, postConvHeight, 1, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); } } else { @@ -2374,7 +2354,6 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, (ctx->Extensions.MESA_texture_array && target == GL_TEXTURE_2D_ARRAY_EXT)) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); @@ -2387,42 +2366,49 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glTexImage3D"); - goto out; } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - width, height, depth, - border, internalFormat); + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + format, type); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); - ASSERT(ctx->Driver.TexImage3D); + /* Give the texture to the driver. may be null. */ + ASSERT(ctx->Driver.TexImage3D); + ctx->Driver.TexImage3D(ctx, target, level, internalFormat, + width, height, depth, border, format, type, + pixels, &ctx->Unpack, texObj, texImage); - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, - width, height, depth, border, format, type, - pixels, &ctx->Unpack, texObj, texImage); + ASSERT(texImage->TexFormat); - ASSERT(texImage->TexFormat); + _mesa_set_fetch_functions(texImage, 3); - update_fbo_texture(ctx, texObj, face, level); + check_gen_mipmap(ctx, target, texObj, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_3D || @@ -2441,8 +2427,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, /* no error, set the tex image parameters */ _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); } } else { @@ -2471,9 +2457,8 @@ _mesa_TexSubImage1D( GLenum target, GLint level, const GLvoid *pixels ) { GLsizei postConvWidth = width; - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; - struct gl_texture_image *texImage = NULL; + struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -2499,8 +2484,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); assert(texObj); _mesa_lock_texture(ctx, texObj); @@ -2508,23 +2492,24 @@ _mesa_TexSubImage1D( GLenum target, GLint level, texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (subtexture_error_check2(ctx, 1, target, level, xoffset, 0, 0, - postConvWidth, 1, 1, format, type, texImage)) { - goto out; /* error was detected */ + postConvWidth, 1, 1, + format, type, texImage)) { + /* error was recorded */ } + else if (width > 0) { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; - if (width == 0) - goto out; /* no-op, not an error */ + ASSERT(ctx->Driver.TexSubImage1D); + ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, + format, type, pixels, &ctx->Unpack, + texObj, texImage); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + check_gen_mipmap(ctx, target, texObj, level); - ASSERT(ctx->Driver.TexSubImage1D); - (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width, - format, type, pixels, &ctx->Unpack, - texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2537,7 +2522,6 @@ _mesa_TexSubImage2D( GLenum target, GLint level, const GLvoid *pixels ) { GLsizei postConvWidth = width, postConvHeight = height; - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); @@ -2566,32 +2550,32 @@ _mesa_TexSubImage2D( GLenum target, GLint level, return; /* error was detected */ } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, 1, format, type, - texImage)) { - goto out; /* error was detected */ + postConvWidth, postConvHeight, 1, + format, type, texImage)) { + /* error was recorded */ } + else if (width > 0 && height >= 0) { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; - if (width == 0 || height == 0) - goto out; /* no-op, not an error */ + ASSERT(ctx->Driver.TexSubImage2D); + ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset, + width, height, format, type, pixels, + &ctx->Unpack, texObj, texImage); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage2D); - (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset, - width, height, format, type, pixels, - &ctx->Unpack, texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; + check_gen_mipmap(ctx, target, texObj, level); + + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2604,7 +2588,6 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GLenum format, GLenum type, const GLvoid *pixels ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); @@ -2625,35 +2608,36 @@ _mesa_TexSubImage3D( GLenum target, GLint level, return; /* error was detected */ } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, 3, target, level, xoffset, yoffset, zoffset, - width, height, depth, format, type, texImage)) { - goto out; /* error was detected */ + if (subtexture_error_check2(ctx, 3, 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, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + zoffset += texImage->Border; - if (width == 0 || height == 0 || height == 0) - goto out; /* no-op, not an error */ + ASSERT(ctx->Driver.TexSubImage3D); + ctx->Driver.TexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, + &ctx->Unpack, texObj, texImage ); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; + check_gen_mipmap(ctx, target, texObj, level); - ASSERT(ctx->Driver.TexSubImage3D); - (*ctx->Driver.TexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2665,7 +2649,6 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLint border ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; @@ -2692,40 +2675,48 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, postConvWidth, 1, border)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glCopyTexImage1D"); - goto out; } + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); + ASSERT(texImage->Data == NULL); + + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, - border, internalFormat); + ASSERT(ctx->Driver.CopyTexImage1D); + ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat, + x, y, width, border); + ASSERT(texImage->TexFormat); - ASSERT(ctx->Driver.CopyTexImage1D); - (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat, - x, y, width, border); + _mesa_set_fetch_functions(texImage, 1); - ASSERT(texImage->TexFormat); + check_gen_mipmap(ctx, target, texObj, level); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2736,7 +2727,6 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2764,8 +2754,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, postConvWidth, postConvHeight, border)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2773,33 +2762,42 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - - ASSERT(texImage->Data == NULL); + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + + ASSERT(ctx->Driver.CopyTexImage2D); + ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat, + x, y, width, height, border); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CopyTexImage2D); - (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat, - x, y, width, height, border); - - ASSERT(texImage->TexFormat); + ASSERT(texImage->TexFormat); - update_fbo_texture(ctx, texObj, face, level); + _mesa_set_fetch_functions(texImage, 2); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + check_gen_mipmap(ctx, target, texObj, level); + + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2808,7 +2806,6 @@ void GLAPIENTRY _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; @@ -2829,8 +2826,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 1, target, level)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2844,23 +2840,25 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (copytexsubimage_error_check2(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, - texImage)) - goto out; - + texImage)) { + /* error was recorded */ + } + else { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage1D); + ctx->Driver.CopyTexSubImage1D(ctx, target, level, + xoffset, x, y, width); - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage1D); - ctx->Driver.CopyTexSubImage1D(ctx, target, level, - xoffset, x, y, width); - } + check_gen_mipmap(ctx, target, texObj, level); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2871,7 +2869,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2889,8 +2886,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 2, target, level)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2903,24 +2899,29 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, } #endif - if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, texImage)) - goto out; + if (copytexsubimage_error_check2(ctx, 2, target, level, + xoffset, yoffset, 0, + postConvWidth, postConvHeight, + texImage)) { + /* error was recorded */ + } + else { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage2D); + ctx->Driver.CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, + x, y, width, height); - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage2D); - ctx->Driver.CopyTexSubImage2D(ctx, target, level, - xoffset, yoffset, x, y, width, height); - } + check_gen_mipmap(ctx, target, texObj, level); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2931,7 +2932,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2949,8 +2949,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 3, target, level)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2965,25 +2964,28 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight, - texImage)) - goto out; - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage3D); - ctx->Driver.CopyTexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, - x, y, width, height); + texImage)) { + /* error was recored */ } + else { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + zoffset += texImage->Border; + + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage3D); + ctx->Driver.CopyTexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + x, y, width, height); + + check_gen_mipmap(ctx, target, texObj, level); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2995,6 +2997,29 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, /**********************************************************************/ +/** + * 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(). * \return error code or GL_NO_ERROR. @@ -3077,8 +3102,7 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions, if (level < 0 || level >= maxLevels) return GL_INVALID_VALUE; - expectedSize = _mesa_compressed_texture_size_glenum(ctx, width, height, - depth, internalFormat); + expectedSize = compressed_tex_size(width, height, depth, internalFormat); if (expectedSize != imageSize) return GL_INVALID_VALUE; @@ -3111,6 +3135,7 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, GLenum format, GLsizei imageSize) { GLint expectedSize, maxLevels = 0, maxTextureSize; + GLuint bw, bh; (void) zoffset; if (dimensions == 1) { @@ -3160,20 +3185,21 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, if (level < 0 || level >= maxLevels) return GL_INVALID_VALUE; - /* XXX these tests are specific to the compressed format. - * this code should be generalized in some way. + /* + * do checks which depend on compression block size */ - if ((xoffset & 3) != 0 || (yoffset & 3) != 0) + get_compressed_block_size(format, &bw, &bh); + + if ((xoffset % bw != 0) || (yoffset % bh != 0)) return GL_INVALID_VALUE; - if ((width & 3) != 0 && width != 2 && width != 1) + if ((width % bw != 0) && width != 2 && width != 1) return GL_INVALID_VALUE; - if ((height & 3) != 0 && height != 2 && height != 1) + if ((height % bh != 0) && height != 2 && height != 1) return GL_INVALID_VALUE; - expectedSize = _mesa_compressed_texture_size_glenum(ctx, width, height, - depth, format); + expectedSize = compressed_tex_size(width, height, depth, format); if (expectedSize != imageSize) return GL_INVALID_VALUE; @@ -3181,6 +3207,55 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, } +/** + * Do second part of glCompressedTexSubImage error checking. + * \return GL_TRUE if error found, GL_FALSE otherwise. + */ +static GLboolean +compressed_subtexture_error_check2(GLcontext *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) && + (GLuint) width != texImage->Width) || + (width > 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) && + (GLuint) height != texImage->Height) || + (height > 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) && + (GLuint) depth != texImage->Depth) || + (depth > texImage->Depth)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCompressedTexSubImage%uD(depth=%d)", dims, depth); + return GL_TRUE; + } + } + + return GL_FALSE; +} + + void GLAPIENTRY _mesa_CompressedTexImage1DARB(GLenum target, GLint level, @@ -3199,7 +3274,6 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, if (target == GL_TEXTURE_1D) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error = compressed_texture_error_check(ctx, 1, target, level, @@ -3209,36 +3283,44 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glCompressedTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - ASSERT(texImage->Data == NULL); + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); + + _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat); + ASSERT(ctx->Driver.CompressedTexImage1D); + ctx->Driver.CompressedTexImage1D(ctx, target, level, + internalFormat, width, border, + imageSize, data, + texObj, texImage); - ASSERT(ctx->Driver.CompressedTexImage1D); - (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, - internalFormat, width, border, - imageSize, data, - texObj, texImage); + _mesa_set_fetch_functions(texImage, 1); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + check_gen_mipmap(ctx, target, texObj, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_1D) { @@ -3260,11 +3342,10 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, } else { /* store the teximage parameters */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3302,9 +3383,9 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; + GLenum error = compressed_texture_error_check(ctx, 2, target, level, internalFormat, width, height, 1, border, imageSize); if (error) { @@ -3312,36 +3393,44 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glCompressedTexImage2D"); - goto out; } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage2D); - (*ctx->Driver.CompressedTexImage2D)(ctx, target, level, - internalFormat, width, height, - border, imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); + + _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + + ASSERT(ctx->Driver.CompressedTexImage2D); + ctx->Driver.CompressedTexImage2D(ctx, target, level, + internalFormat, width, height, + border, imageSize, data, + texObj, texImage); + + _mesa_set_fetch_functions(texImage, 2); + + check_gen_mipmap(ctx, target, texObj, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_2D || @@ -3365,11 +3454,10 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, } else { /* store the teximage parameters */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3404,7 +3492,6 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, if (target == GL_TEXTURE_3D) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error = compressed_texture_error_check(ctx, 3, target, level, @@ -3414,36 +3501,46 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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, "glCompressedTexImage3D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage3D); - (*ctx->Driver.CompressedTexImage3D)(ctx, target, level, - internalFormat, - width, height, depth, - border, imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); + + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat); + + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + + ASSERT(ctx->Driver.CompressedTexImage3D); + ctx->Driver.CompressedTexImage3D(ctx, target, level, + internalFormat, + width, height, depth, + border, imageSize, data, + texObj, texImage); + + _mesa_set_fetch_functions(texImage, 3); + + check_gen_mipmap(ctx, target, texObj, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_3D) { @@ -3465,11 +3562,11 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, } else { /* store the teximage parameters */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + + texObj = _mesa_get_current_tex_object(ctx, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -3486,116 +3583,100 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, } -void GLAPIENTRY -_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, - GLsizei width, GLenum format, - GLsizei imageSize, const GLvoid *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_unit *texUnit; 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, 1, target, level, + error = compressed_subtexture_error_check(ctx, dims, target, level, xoffset, 0, 0, /* pos */ - width, 1, 1, /* size */ + width, height, depth, /* size */ format, imageSize); if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage1D"); + _mesa_error(ctx, error, "glCompressedTexSubImage%uD", dims); return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + 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 ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage1D(format)"); - goto out; - } + 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: + ; + } - if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)"); - goto out; - } - - if (width == 0) - goto out; /* no-op, not an error */ + check_gen_mipmap(ctx, target, texObj, level); - if (ctx->Driver.CompressedTexSubImage1D) { - (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level, - xoffset, width, - format, imageSize, data, - texObj, texImage); + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; } - out: _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) { - struct gl_texture_unit *texUnit; - 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, 2, target, level, - xoffset, yoffset, 0, /* pos */ - width, height, 1, /* size */ - format, imageSize); - if (error) { - /* XXX proxy target? */ - _mesa_error(ctx, error, "glCompressedTexSubImage2D"); - return; - } - - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage2D(format)"); - goto out; - } - - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); - goto out; - } - - if (width == 0 || height == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage2D) { - (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level, - xoffset, yoffset, width, height, - format, imageSize, data, - texObj, texImage); - } - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); + compressed_tex_sub_image(2, target, level, xoffset, yoffset, 0, + width, height, 1, format, imageSize, data); } @@ -3605,56 +3686,8 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) { - struct gl_texture_unit *texUnit; - 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, 3, target, level, - xoffset, yoffset, zoffset,/*pos*/ - width, height, depth, /*size*/ - format, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage3D"); - return; - } - - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage3D(format)"); - goto out; - } - - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height) || - ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); - goto out; - } - - if (width == 0 || height == 0 || depth == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage3D) { - (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, imageSize, data, - texObj, texImage); - } - ctx->NewState |= _NEW_TEXTURE; - } - out: - _mesa_unlock_texture(ctx, texObj); + compressed_tex_sub_image(3, target, level, xoffset, yoffset, zoffset, + width, height, depth, format, imageSize, data); } diff --git a/mesalib/src/mesa/main/teximage.h b/mesalib/src/mesa/main/teximage.h index 094177da7..97c901831 100644 --- a/mesalib/src/mesa/main/teximage.h +++ b/mesalib/src/mesa/main/teximage.h @@ -86,6 +86,9 @@ extern struct gl_texture_object * _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, GLenum target); +extern struct gl_texture_object * +_mesa_get_current_tex_object(GLcontext *ctx, GLenum target); + extern struct gl_texture_image * _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c index da55ac869..237b6eb00 100644 --- a/mesalib/src/mesa/main/texobj.c +++ b/mesalib/src/mesa/main/texobj.c @@ -29,12 +29,11 @@ #include "mfeatures.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "fbobject.h" +#include "formats.h" #include "hash.h" #include "imports.h" #include "macros.h" @@ -194,9 +193,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) */ texObj->Target = 0x99; -#if FEATURE_colortable _mesa_free_colortable_data(&texObj->Palette); -#endif /* free the texture images */ for (face = 0; face < 6; face++) { @@ -418,7 +415,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Detect cases where the application set the base level to an invalid * value. */ - if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { + if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; _mesa_sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); @@ -495,7 +492,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->Image[face][baseLevel]->Width2 != w || t->Image[face][baseLevel]->Height2 != h) { t->_Complete = GL_FALSE; - incomplete(t, "Non-quare cubemap image"); + incomplete(t, "Cube face missing or mismatched size"); return; } } @@ -744,6 +741,10 @@ _mesa_get_fallback_texture(GLcontext *ctx) _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage, 8, 8, 1, 0, GL_RGBA); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + /* set image data */ ctx->Driver.TexImage2D(ctx, GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, @@ -1102,8 +1103,6 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]); if (t) { t->Priority = CLAMP( priorities[i], 0.0F, 1.0F ); - if (ctx->Driver.PrioritizeTexture) - ctx->Driver.PrioritizeTexture( ctx, t, t->Priority ); } } } diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index 9d1fdd056..db4c7a5ed 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -31,9 +31,10 @@ #include "main/glheader.h" +#include "main/colormac.h" #include "main/context.h" #include "main/enums.h" -#include "main/colormac.h" +#include "main/formats.h" #include "main/macros.h" #include "main/texcompress.h" #include "main/texparam.h" @@ -78,6 +79,8 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) /** * Get current texture object for given target. * Return NULL if any error. + * Note that this is different from _mesa_select_tex_object() in that proxy + * targets are not accepted. */ static struct gl_texture_object * get_texobj(GLcontext *ctx, GLenum target) @@ -544,13 +547,20 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) param; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + 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 */ - need_update = set_tex_parameterf(ctx, texObj, pname, ¶m); + { + /* 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) { @@ -585,8 +595,10 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) params[0]; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + 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; @@ -599,7 +611,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) iparams[1] = (GLint) params[1]; iparams[2] = (GLint) params[2]; iparams[3] = (GLint) params[3]; - need_update = set_tex_parameteri(ctx, target, iparams); + need_update = set_tex_parameteri(ctx, texObj, pname, iparams); } break; #endif @@ -635,14 +647,21 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) case GL_TEXTURE_LOD_BIAS: case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { - GLfloat fparam = (GLfloat) param; + 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); + need_update = set_tex_parameterf(ctx, texObj, pname, fparam); } break; default: /* this will generate an error if pname is illegal */ - need_update = set_tex_parameteri(ctx, texObj, pname, ¶m); + { + 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) { @@ -684,8 +703,10 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { /* convert int param to float */ - GLfloat fparam = (GLfloat) params[0]; - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + 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: @@ -726,6 +747,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, const struct gl_texture_image *img = NULL; GLboolean isProxy; GLint maxLevels; + gl_format texFormat; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -763,6 +785,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, goto out; } + texFormat = img->TexFormat; + isProxy = _mesa_is_proxy_texture(target); switch (pname) { @@ -776,10 +800,9 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Depth; break; case GL_TEXTURE_INTERNAL_FORMAT: - if (img->IsCompressed) { + if (_mesa_is_format_compressed(img->TexFormat)) { /* need to return the actual compressed format */ - *params = _mesa_compressed_format_to_glenum(ctx, - img->TexFormat->MesaFormat); + *params = _mesa_compressed_format_to_glenum(ctx, img->TexFormat); } else { /* return the user's requested internal format */ @@ -790,20 +813,10 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Border; break; case GL_TEXTURE_RED_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->RedBits; - else - *params = 0; - break; case GL_TEXTURE_GREEN_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->GreenBits; - else - *params = 0; - break; case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->BlueBits; + *params = _mesa_get_format_bits(texFormat, pname); else *params = 0; break; @@ -811,36 +824,44 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, if (img->_BaseFormat == GL_ALPHA || img->_BaseFormat == GL_LUMINANCE_ALPHA || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->AlphaBits; + *params = _mesa_get_format_bits(texFormat, pname); else *params = 0; break; case GL_TEXTURE_INTENSITY_SIZE: if (img->_BaseFormat != GL_INTENSITY) *params = 0; - else if (img->TexFormat->IntensityBits > 0) - *params = img->TexFormat->IntensityBits; - else /* intensity probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); + 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 if (img->TexFormat->LuminanceBits > 0) - *params = img->TexFormat->LuminanceBits; - else /* luminance probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); + 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 = img->TexFormat->IndexBits; + *params = _mesa_get_format_bits(texFormat, pname); else *params = 0; break; case GL_TEXTURE_DEPTH_SIZE_ARB: if (ctx->Extensions.ARB_depth_texture) - *params = img->TexFormat->DepthBits; + *params = _mesa_get_format_bits(texFormat, pname); else _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); @@ -848,7 +869,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, case GL_TEXTURE_STENCIL_SIZE_EXT: if (ctx->Extensions.EXT_packed_depth_stencil || ctx->Extensions.ARB_framebuffer_object) { - *params = img->TexFormat->StencilBits; + *params = _mesa_get_format_bits(texFormat, pname); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -858,13 +879,9 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: - if (img->IsCompressed && !isProxy) { - /* Don't use ctx->Driver.CompressedTextureSize() since that - * may returned a padded hardware size. - */ - *params = _mesa_compressed_texture_size(ctx, img->Width, - img->Height, img->Depth, - img->TexFormat->MesaFormat); + if (_mesa_is_format_compressed(img->TexFormat) && !isProxy) { + *params = _mesa_format_image_size(texFormat, img->Width, + img->Height, img->Depth); } else { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -872,13 +889,14 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, } break; case GL_TEXTURE_COMPRESSED: - *params = (GLint) img->IsCompressed; + *params = (GLint) _mesa_is_format_compressed(img->TexFormat); break; /* GL_ARB_texture_float */ case GL_TEXTURE_RED_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->RedBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -887,7 +905,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_GREEN_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -896,7 +915,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_BLUE_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -905,7 +925,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_ALPHA_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -914,7 +935,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_LUMINANCE_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_LUMINANCE_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -923,7 +945,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_INTENSITY_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_INTENSITY_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -932,7 +955,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_DEPTH_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, diff --git a/mesalib/src/mesa/main/texrender.c b/mesalib/src/mesa/main/texrender.c index 53be83b05..e2432be6c 100644 --- a/mesalib/src/mesa/main/texrender.c +++ b/mesalib/src/mesa/main/texrender.c @@ -1,7 +1,8 @@ #include "context.h" +#include "colormac.h" #include "fbobject.h" -#include "texformat.h" +#include "texfetch.h" #include "texrender.h" #include "renderbuffer.h" @@ -46,7 +47,9 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, if (rb->DataType == CHAN_TYPE) { GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x + i, y, z, rgbaOut + 4 * i); + GLfloat rgba[4]; + trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, rgba); + UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba); } } else if (rb->DataType == GL_UNSIGNED_SHORT) { @@ -100,8 +103,10 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, if (rb->DataType == CHAN_TYPE) { GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x[i], y[i] + trb->Yoffset, - z, rgbaOut + 4 * i); + GLfloat rgba[4]; + trb->TexImage->FetchTexelf(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) { @@ -462,6 +467,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) { struct texture_renderbuffer *trb = (struct texture_renderbuffer *) att->Renderbuffer; + gl_format texFormat; (void) ctx; ASSERT(trb); @@ -469,7 +475,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->TexImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; ASSERT(trb->TexImage); - trb->Store = trb->TexImage->TexFormat->StoreTexel; + 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; @@ -484,41 +490,30 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Zoffset = att->Zoffset; } + texFormat = trb->TexImage->TexFormat; + trb->Base.Width = trb->TexImage->Width; trb->Base.Height = trb->TexImage->Height; trb->Base.InternalFormat = trb->TexImage->InternalFormat; /* XXX may need more special cases here */ - if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z24_S8) { - trb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; + if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) { + trb->Base.Format = MESA_FORMAT_Z24_S8; trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; } - else if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z16) { - trb->Base._ActualFormat = GL_DEPTH_COMPONENT; + else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { + trb->Base.Format = MESA_FORMAT_Z16; trb->Base.DataType = GL_UNSIGNED_SHORT; } - else if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z32) { - trb->Base._ActualFormat = GL_DEPTH_COMPONENT; + else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) { + trb->Base.Format = MESA_FORMAT_Z32; trb->Base.DataType = GL_UNSIGNED_INT; } else { - trb->Base._ActualFormat = trb->TexImage->InternalFormat; + trb->Base.Format = trb->TexImage->TexFormat; trb->Base.DataType = CHAN_TYPE; } - trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat; -#if 0 - /* fix/avoid this assertion someday */ - ASSERT(trb->Base._BaseFormat == GL_RGB || - trb->Base._BaseFormat == GL_RGBA || - trb->Base._BaseFormat == GL_DEPTH_COMPONENT); -#endif trb->Base.Data = trb->TexImage->Data; - - trb->Base.RedBits = trb->TexImage->TexFormat->RedBits; - trb->Base.GreenBits = trb->TexImage->TexFormat->GreenBits; - trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits; - trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits; - trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits; - trb->Base.StencilBits = trb->TexImage->TexFormat->StencilBits; + trb->Base._BaseFormat = _mesa_base_fbo_format(ctx, trb->Base.InternalFormat); } diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index 8292d43eb..c735e18af 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -31,9 +31,7 @@ #include "glheader.h" #include "mfeatures.h" #include "colormac.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "macros.h" @@ -309,10 +307,6 @@ _mesa_ActiveTextureARB(GLenum texture) /* update current stack pointer */ ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit]; } - - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit ); - } } @@ -324,11 +318,18 @@ _mesa_ClientActiveTextureARB(GLenum texture) 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; } @@ -362,9 +363,6 @@ update_texture_matrices( GLcontext *ctx ) if (ctx->Texture.Unit[u]._ReallyEnabled && ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY) ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u); - - if (ctx->Driver.TextureMatrix) - ctx->Driver.TextureMatrix( ctx, u, ctx->TextureMatrixStack[u].Top); } } } @@ -759,9 +757,7 @@ _mesa_init_texture(GLcontext *ctx) ctx->Texture.CurrentUnit = 0; /* multitexture */ ctx->Texture._EnabledUnits = 0x0; ctx->Texture.SharedPalette = GL_FALSE; -#if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); -#endif for (u = 0; u < MAX_TEXTURE_UNITS; u++) init_texture_unit(ctx, u); @@ -802,10 +798,8 @@ _mesa_free_texture_data(GLcontext *ctx) for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); -#if FEATURE_colortable for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) _mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable); -#endif } diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index d3237959e..792c83141 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -56,15 +56,14 @@ #include "bufferobj.h" #include "colormac.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "image.h" #include "macros.h" #include "mipmap.h" #include "imports.h" #include "texcompress.h" -#include "texformat.h" +#include "texcompress_fxt1.h" +#include "texcompress_s3tc.h" #include "teximage.h" #include "texstore.h" #include "enums.h" @@ -76,6 +75,12 @@ enum { }; +/** + * Texture image storage function. + */ +typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); + + /** * Return GL_TRUE if the given image format is one that be converted * to another format by swizzling. @@ -272,16 +277,6 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, } -#if !FEATURE_convolve -static void -_mesa_adjust_image_for_convolution(GLcontext *ctx, GLuint dims, - GLsizei *srcWidth, GLsizei *srcHeight) -{ - /* no-op */ -} -#endif - - /** * Make a temporary (color) texture image with GLfloat components. * Apply all needed pixel unpacking and pixel transfer operations. @@ -348,7 +343,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, const GLuint postConvTransferOps = (transferOps & IMAGE_POST_CONVOLUTION_BITS) | IMAGE_CLAMP_BIT; GLint img, row; - GLint convWidth, convHeight; + GLint convWidth = srcWidth, convHeight = srcHeight; GLfloat *convImage; /* pre-convolution image buffer (3D) */ @@ -433,8 +428,8 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, else { /* no convolution */ const GLint components = _mesa_components_in_format(logicalBaseFormat); - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLfloat *dst; GLint img, row; @@ -598,14 +593,13 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, dst = tempImage; for (img = 0; img < srcDepth; img++) { - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, - srcType); - const GLubyte *src - = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); + const GLint srcStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); + const GLubyte *src = + (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, + srcWidth, srcHeight, + srcFormat, srcType, + img, 0, 0); for (row = 0; row < srcHeight; row++) { _mesa_unpack_color_span_chan(ctx, srcWidth, logicalBaseFormat, dst, srcFormat, srcType, src, srcPacking, @@ -930,7 +924,7 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, static void memcpy_texture(GLcontext *ctx, GLuint dimensions, - const struct gl_texture_format *dstFormat, + gl_format dstFormat, GLvoid *dstAddr, GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, GLint dstRowStride, @@ -946,7 +940,8 @@ memcpy_texture(GLcontext *ctx, srcWidth, srcHeight, srcFormat, srcType); const GLubyte *srcImage = (const GLubyte *) _mesa_image_address(dimensions, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); - const GLint bytesPerRow = srcWidth * dstFormat->TexelBytes; + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLint bytesPerRow = srcWidth * texelBytes; #if 0 /* XXX update/re-enable for dstImageOffsets array */ @@ -955,7 +950,7 @@ memcpy_texture(GLcontext *ctx, GLubyte *dstImage = (GLubyte *) dstAddr + dstZoffset * dstImageStride + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; if (dstRowStride == srcRowStride && dstRowStride == bytesPerRow && @@ -986,9 +981,9 @@ memcpy_texture(GLcontext *ctx, for (img = 0; img < srcDepth; img++) { const GLubyte *srcRow = srcImage; GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { ctx->Driver.TextureMemCpy(dstRow, srcRow, bytesPerRow); dstRow += dstRowStride; @@ -1001,38 +996,23 @@ memcpy_texture(GLcontext *ctx, /** - * Store an image in any of the formats: - * _mesa_texformat_rgba - * _mesa_texformat_rgb - * _mesa_texformat_alpha - * _mesa_texformat_luminance - * _mesa_texformat_luminance_alpha - * _mesa_texformat_intensity - * + * Store a 32-bit integer depth component texture image. */ -GLboolean -_mesa_texstore_rgba(TEXSTORE_PARAMS) +static GLboolean +_mesa_texstore_z32(TEXSTORE_PARAMS) { - const GLint components = _mesa_components_in_format(baseInternalFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba || - dstFormat == &_mesa_texformat_rgb || - dstFormat == &_mesa_texformat_alpha || - dstFormat == &_mesa_texformat_luminance || - dstFormat == &_mesa_texformat_luminance_alpha || - dstFormat == &_mesa_texformat_intensity); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLchan)); + const GLuint depthScale = 0xffffffff; + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + (void) dims; + ASSERT(dstFormat == MESA_FORMAT_Z32); + ASSERT(texelBytes == sizeof(GLuint)); - if (!ctx->_ImageTransferState && + if (ctx->Pixel.DepthScale == 1.0f && + ctx->Pixel.DepthBias == 0.0f && !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - srcType == CHAN_TYPE) { + baseInternalFormat == GL_DEPTH_COMPONENT && + srcFormat == GL_DEPTH_COMPONENT && + srcType == GL_UNSIGNED_INT) { /* simple memcpy path */ memcpy_texture(ctx, dims, dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, @@ -1041,160 +1021,92 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgb && - srcFormat == GL_RGBA && - srcType == CHAN_TYPE) { - /* extract RGB from RGBA */ - GLint img, row, col; + else { + /* general path */ + GLint img, row; for (img = 0; img < srcDepth; img++) { - GLchan *dstImage = (GLchan *) - ((GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes); - - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLchan *srcRow = (GLchan *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLchan *dstRow = dstImage; + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + RCOMP] = srcRow[col * 4 + RCOMP]; - dstRow[col * 3 + GCOMP] = srcRow[col * 4 + GCOMP]; - dstRow[col * 3 + BCOMP] = srcRow[col * 4 + BCOMP]; - } - dstRow += dstRowStride / sizeof(GLchan); - srcRow = (GLchan *) ((GLubyte *) srcRow + srcRowStride); + const GLvoid *src = _mesa_image_address(dims, srcPacking, + srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_INT, (GLuint *) dstRow, + depthScale, srcType, src, srcPacking); + dstRow += dstRowStride; } } } - else if (!ctx->_ImageTransferState && - CHAN_TYPE == GL_UNSIGNED_BYTE && - (srcType == GL_UNSIGNED_BYTE || - srcType == GL_UNSIGNED_INT_8_8_8_8 || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { + return GL_TRUE; +} - const GLubyte *dstmap; - GLuint components; - /* dstmap - how to swizzle from RGBA to dst format: - */ - if (dstFormat == &_mesa_texformat_rgba) { - dstmap = mappings[IDX_RGBA].from_rgba; - components = 4; - } - else if (dstFormat == &_mesa_texformat_rgb) { - dstmap = mappings[IDX_RGB].from_rgba; - components = 3; - } - else if (dstFormat == &_mesa_texformat_alpha) { - dstmap = mappings[IDX_ALPHA].from_rgba; - components = 1; - } - else if (dstFormat == &_mesa_texformat_luminance) { - dstmap = mappings[IDX_LUMINANCE].from_rgba; - components = 1; - } - else if (dstFormat == &_mesa_texformat_luminance_alpha) { - dstmap = mappings[IDX_LUMINANCE_ALPHA].from_rgba; - components = 2; - } - else if (dstFormat == &_mesa_texformat_intensity) { - dstmap = mappings[IDX_INTENSITY].from_rgba; - components = 1; - } - else { - _mesa_problem(ctx, "Unexpected dstFormat in _mesa_texstore_rgba"); - return GL_FALSE; - } +/** + * Store a 24-bit integer depth component texture image. + */ +static GLboolean +_mesa_texstore_x8_z24(TEXSTORE_PARAMS) +{ + const GLuint depthScale = 0xffffff; + const GLuint texelBytes = 4; - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, components, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { + (void) dims; + ASSERT(dstFormat == MESA_FORMAT_X8_Z24); + + { /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint bytesPerRow; GLint img, row; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - bytesPerRow = srcWidth * components * sizeof(GLchan); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { - _mesa_memcpy(dstRow, src, bytesPerRow); + const GLvoid *src = _mesa_image_address(dims, srcPacking, + srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_INT, (GLuint *) dstRow, + depthScale, srcType, src, srcPacking); dstRow += dstRowStride; - src += srcWidth * components; } } - - _mesa_free((void *) tempImage); } return GL_TRUE; } /** - * Store a 32-bit integer depth component texture image. + * Store a 24-bit integer depth component texture image. */ -GLboolean -_mesa_texstore_z32(TEXSTORE_PARAMS) +static GLboolean +_mesa_texstore_z24_x8(TEXSTORE_PARAMS) { - const GLuint depthScale = 0xffffffff; + const GLuint depthScale = 0xffffff; + const GLuint texelBytes = 4; + (void) dims; - ASSERT(dstFormat == &_mesa_texformat_z32); - ASSERT(dstFormat->TexelBytes == sizeof(GLuint)); + ASSERT(dstFormat == MESA_FORMAT_Z24_X8); - if (ctx->Pixel.DepthScale == 1.0f && - ctx->Pixel.DepthBias == 0.0f && - !srcPacking->SwapBytes && - baseInternalFormat == GL_DEPTH_COMPONENT && - srcFormat == GL_DEPTH_COMPONENT && - srcType == GL_UNSIGNED_INT) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { + { /* general path */ GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); + GLuint *dst = (GLuint *) dstRow; + GLint i; _mesa_unpack_depth_span(ctx, srcWidth, - GL_UNSIGNED_INT, (GLuint *) dstRow, + GL_UNSIGNED_INT, dst, depthScale, srcType, src, srcPacking); + for (i = 0; i < srcWidth; i++) + dst[i] <<= 8; dstRow += dstRowStride; } } @@ -1202,18 +1114,18 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) return GL_TRUE; } -#define STRIDE_3D 0 /** * Store a 16-bit integer depth component texture image. */ -GLboolean +static GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) dims; - ASSERT(dstFormat == &_mesa_texformat_z16); - ASSERT(dstFormat->TexelBytes == sizeof(GLushort)); + ASSERT(dstFormat == MESA_FORMAT_Z16); + ASSERT(texelBytes == sizeof(GLushort)); if (ctx->Pixel.DepthScale == 1.0f && ctx->Pixel.DepthBias == 0.0f && @@ -1234,9 +1146,9 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); @@ -1255,16 +1167,19 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) /** * Store an rgb565 or rgb565_rev texture image. */ -GLboolean +static GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS) { - ASSERT(dstFormat == &_mesa_texformat_rgb565 || - dstFormat == &_mesa_texformat_rgb565_rev); - ASSERT(dstFormat->TexelBytes == 2); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_RGB565 || + dstFormat == MESA_FORMAT_RGB565_REV); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgb565 && + dstFormat == MESA_FORMAT_RGB565 && baseInternalFormat == GL_RGB && srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5) { @@ -1283,20 +1198,20 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) srcType == GL_UNSIGNED_BYTE && dims == 2) { /* do optimized tex store */ - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, - srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); const GLubyte *src = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); GLubyte *dst = (GLubyte *) dstAddr + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; GLint row, col; for (row = 0; row < srcHeight; row++) { const GLubyte *srcUB = (const GLubyte *) src; GLushort *dstUS = (GLushort *) dst; /* check for byteswapped format */ - if (dstFormat == &_mesa_texformat_rgb565) { + if (dstFormat == MESA_FORMAT_RGB565) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_565( srcUB[0], srcUB[1], srcUB[2] ); srcUB += 3; @@ -1316,7 +1231,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1327,13 +1242,13 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; /* check for byteswapped format */ - if (dstFormat == &_mesa_texformat_rgb565) { + if (dstFormat == MESA_FORMAT_RGB565) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_565( CHAN_TO_UBYTE(src[RCOMP]), CHAN_TO_UBYTE(src[GCOMP]), @@ -1361,18 +1276,20 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) /** * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV. */ -GLboolean +static GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgba8888 || - dstFormat == &_mesa_texformat_rgba8888_rev); - ASSERT(dstFormat->TexelBytes == 4); + ASSERT(dstFormat == MESA_FORMAT_RGBA8888 || + dstFormat == MESA_FORMAT_RGBA8888_REV); + ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba8888 && + dstFormat == MESA_FORMAT_RGBA8888 && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || @@ -1388,7 +1305,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba8888_rev && + dstFormat == MESA_FORMAT_RGBA8888_REV && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || @@ -1413,8 +1330,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_rgba8888) || - (!littleEndian && dstFormat == &_mesa_texformat_rgba8888_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_RGBA8888) || + (!littleEndian && dstFormat == MESA_FORMAT_RGBA8888_REV)) { dstmap[3] = 0; dstmap[2] = 1; dstmap[1] = 2; @@ -1441,7 +1358,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1452,12 +1369,12 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_rgba8888) { + if (dstFormat == MESA_FORMAT_RGBA8888) { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[RCOMP]), CHAN_TO_UBYTE(src[GCOMP]), @@ -1484,18 +1401,23 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = GL_RGBA; - ASSERT(dstFormat == &_mesa_texformat_argb8888 || - dstFormat == &_mesa_texformat_argb8888_rev); - ASSERT(dstFormat->TexelBytes == 4); + ASSERT(dstFormat == MESA_FORMAT_ARGB8888 || + dstFormat == MESA_FORMAT_ARGB8888_REV || + dstFormat == MESA_FORMAT_XRGB8888 || + dstFormat == MESA_FORMAT_XRGB8888_REV ); + ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && + (dstFormat == MESA_FORMAT_ARGB8888 || + dstFormat == MESA_FORMAT_XRGB8888) && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && littleEndian) || @@ -1510,7 +1432,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888_rev && + (dstFormat == MESA_FORMAT_ARGB8888_REV || + dstFormat == MESA_FORMAT_XRGB8888_REV) && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || @@ -1525,21 +1448,22 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && + (dstFormat == MESA_FORMAT_ARGB8888 || + dstFormat == MESA_FORMAT_XRGB8888) && srcFormat == GL_RGB && (baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB) && srcType == GL_UNSIGNED_BYTE) { int img, row, col; for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -1555,7 +1479,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && + dstFormat == MESA_FORMAT_ARGB8888 && srcFormat == GL_RGBA && baseInternalFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE) { @@ -1568,14 +1492,14 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) * Strangely the same isn't required for the RGB path, above. */ for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -1600,16 +1524,20 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_argb8888) || - (!littleEndian && dstFormat == &_mesa_texformat_argb8888_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || + (littleEndian && dstFormat == MESA_FORMAT_XRGB8888) || + (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) || + (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV)) { dstmap[3] = 3; /* alpha */ dstmap[2] = 0; /* red */ dstmap[1] = 1; /* green */ dstmap[0] = 2; /* blue */ } else { - assert((littleEndian && dstFormat == &_mesa_texformat_argb8888_rev) || - (!littleEndian && dstFormat == &_mesa_texformat_argb8888)); + assert((littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) || + (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || + (littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV) || + (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888)); dstmap[3] = 2; dstmap[2] = 1; dstmap[1] = 0; @@ -1632,7 +1560,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1643,12 +1571,12 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_argb8888) { + if (dstFormat == MESA_FORMAT_ARGB8888) { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[ACOMP]), CHAN_TO_UBYTE(src[RCOMP]), @@ -1657,6 +1585,15 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) src += 4; } } + else if (dstFormat == MESA_FORMAT_XRGB8888) { + for (col = 0; col < srcWidth; col++) { + dstUI[col] = PACK_COLOR_8888( 0xff, + CHAN_TO_UBYTE(src[RCOMP]), + CHAN_TO_UBYTE(src[GCOMP]), + CHAN_TO_UBYTE(src[BCOMP]) ); + src += 4; + } + } else { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888_REV( CHAN_TO_UBYTE(src[ACOMP]), @@ -1675,13 +1612,15 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgb888); - ASSERT(dstFormat->TexelBytes == 3); + ASSERT(dstFormat == MESA_FORMAT_RGB888); + ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1704,14 +1643,14 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) /* extract RGB from RGBA */ GLint img, row, col; for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col * 3 + 0] = srcRow[col * 4 + BCOMP]; @@ -1751,7 +1690,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1762,9 +1701,9 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { #if 0 if (littleEndian) { @@ -1800,13 +1739,15 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_bgr888); - ASSERT(dstFormat->TexelBytes == 3); + ASSERT(dstFormat == MESA_FORMAT_BGR888); + ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1829,14 +1770,14 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) /* extract BGR from RGBA */ int img, row, col; for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col * 3 + 0] = srcRow[col * 4 + RCOMP]; @@ -1876,7 +1817,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1887,9 +1828,9 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[RCOMP]); @@ -1905,71 +1846,20 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean -_mesa_texstore_rgba4444(TEXSTORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_rgba4444); - ASSERT(dstFormat->TexelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba4444 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_RGBA && - srcType == GL_UNSIGNED_SHORT_4_4_4_4){ - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[ACOMP]) ); - src += 4; - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} -GLboolean +static GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) { - ASSERT(dstFormat == &_mesa_texformat_argb4444 || - dstFormat == &_mesa_texformat_argb4444_rev); - ASSERT(dstFormat->TexelBytes == 2); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_ARGB4444 || + dstFormat == MESA_FORMAT_ARGB4444_REV); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb4444 && + dstFormat == MESA_FORMAT_ARGB4444 && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV) { @@ -1985,7 +1875,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1996,12 +1886,12 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_argb4444) { + if (dstFormat == MESA_FORMAT_ARGB4444) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[ACOMP]), CHAN_TO_UBYTE(src[RCOMP]), @@ -2027,15 +1917,18 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS) { - ASSERT(dstFormat == &_mesa_texformat_rgba5551); - ASSERT(dstFormat->TexelBytes == 2); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_RGBA5551); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba5551 && + dstFormat == MESA_FORMAT_RGBA5551 && baseInternalFormat == GL_RGBA && srcFormat == GL_RGBA && srcType == GL_UNSIGNED_SHORT_5_5_5_1) { @@ -2051,7 +1944,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2062,9 +1955,9 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -2082,16 +1975,19 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) { - ASSERT(dstFormat == &_mesa_texformat_argb1555 || - dstFormat == &_mesa_texformat_argb1555_rev); - ASSERT(dstFormat->TexelBytes == 2); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_ARGB1555 || + dstFormat == MESA_FORMAT_ARGB1555_REV); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb1555 && + dstFormat == MESA_FORMAT_ARGB1555 && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) { @@ -2107,7 +2003,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2118,12 +2014,12 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_argb1555) { + if (dstFormat == MESA_FORMAT_ARGB1555) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_1555( CHAN_TO_UBYTE(src[ACOMP]), CHAN_TO_UBYTE(src[RCOMP]), @@ -2150,18 +2046,20 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_al88 || - dstFormat == &_mesa_texformat_al88_rev); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(dstFormat == MESA_FORMAT_AL88 || + dstFormat == MESA_FORMAT_AL88_REV); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_al88 && + dstFormat == MESA_FORMAT_AL88 && baseInternalFormat == GL_LUMINANCE_ALPHA && srcFormat == GL_LUMINANCE_ALPHA && srcType == GL_UNSIGNED_BYTE && @@ -2184,8 +2082,8 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_al88) || - (!littleEndian && dstFormat == &_mesa_texformat_al88_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_AL88) || + (!littleEndian && dstFormat == MESA_FORMAT_AL88_REV)) { dstmap[0] = 0; dstmap[1] = 3; } @@ -2210,7 +2108,7 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2221,12 +2119,12 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_al88) { + if (dstFormat == MESA_FORMAT_AL88) { for (col = 0; col < srcWidth; col++) { /* src[0] is luminance, src[1] is alpha */ dstUS[col] = PACK_COLOR_88( CHAN_TO_UBYTE(src[1]), @@ -2251,11 +2149,89 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) } -GLboolean +static GLboolean +_mesa_texstore_al1616(TEXSTORE_PARAMS) +{ + const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_AL1616 || + dstFormat == MESA_FORMAT_AL1616_REV); + ASSERT(texelBytes == 4); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == MESA_FORMAT_AL1616 && + baseInternalFormat == GL_LUMINANCE_ALPHA && + srcFormat == GL_LUMINANCE_ALPHA && + srcType == GL_UNSIGNED_SHORT && + littleEndian) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLfloat *tempImage = make_temp_float_image(ctx, dims, + baseInternalFormat, + baseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLfloat *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; + for (row = 0; row < srcHeight; row++) { + GLuint *dstUI = (GLuint *) dstRow; + if (dstFormat == MESA_FORMAT_AL1616) { + for (col = 0; col < srcWidth; col++) { + GLushort l, a; + + UNCLAMPED_FLOAT_TO_USHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[1]); + dstUI[col] = PACK_COLOR_1616(a, l); + src += 2; + } + } + else { + for (col = 0; col < srcWidth; col++) { + GLushort l, a; + + UNCLAMPED_FLOAT_TO_USHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[1]); + dstUI[col] = PACK_COLOR_1616_REV(a, l); + src += 2; + } + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} + + +static GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS) { - ASSERT(dstFormat == &_mesa_texformat_rgb332); - ASSERT(dstFormat->TexelBytes == 1); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_RGB332); + ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2273,7 +2249,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2284,9 +2260,9 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col] = PACK_COLOR_332( CHAN_TO_UBYTE(src[RCOMP]), @@ -2306,13 +2282,16 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) /** * Texstore for _mesa_texformat_a8, _mesa_texformat_l8, _mesa_texformat_i8. */ -GLboolean +static GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS) { - ASSERT(dstFormat == &_mesa_texformat_a8 || - dstFormat == &_mesa_texformat_l8 || - dstFormat == &_mesa_texformat_i8); - ASSERT(dstFormat->TexelBytes == 1); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_A8 || + dstFormat == MESA_FORMAT_L8 || + dstFormat == MESA_FORMAT_I8); + ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2335,7 +2314,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if (dstFormat == &_mesa_texformat_a8) { + if (dstFormat == MESA_FORMAT_A8) { dstmap[0] = 3; } else { @@ -2359,7 +2338,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2370,9 +2349,9 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col] = CHAN_TO_UBYTE(src[col]); @@ -2388,12 +2367,14 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) -GLboolean +static GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + (void) dims; (void) baseInternalFormat; - ASSERT(dstFormat == &_mesa_texformat_ci8); - ASSERT(dstFormat->TexelBytes == 1); + ASSERT(dstFormat == MESA_FORMAT_CI8); + ASSERT(texelBytes == 1); ASSERT(baseInternalFormat == GL_COLOR_INDEX); if (!ctx->_ImageTransferState && @@ -2413,9 +2394,9 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS) GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); @@ -2431,17 +2412,19 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS) /** - * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_rev. + * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_REV. */ -GLboolean +static GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + (void) ctx; (void) dims; (void) baseInternalFormat; - ASSERT((dstFormat == &_mesa_texformat_ycbcr) || - (dstFormat == &_mesa_texformat_ycbcr_rev)); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT((dstFormat == MESA_FORMAT_YCBCR) || + (dstFormat == MESA_FORMAT_YCBCR_REV)); + ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.MESA_ycbcr_texture); ASSERT(srcFormat == GL_YCBCR_MESA); ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) || @@ -2460,14 +2443,14 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS) /* XXX the logic here _might_ be wrong */ if (srcPacking->SwapBytes ^ (srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA) ^ - (dstFormat == &_mesa_texformat_ycbcr_rev) ^ + (dstFormat == MESA_FORMAT_YCBCR_REV) ^ !littleEndian) { GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { _mesa_swap2((GLushort *) dstRow, srcWidth); dstRow += dstRowStride; @@ -2477,13 +2460,14 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_dudv8); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(dstFormat == MESA_FORMAT_DUDV8); + ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.ATI_envmap_bumpmap); ASSERT((srcFormat == GL_DU8DV8_ATI) || (srcFormat == GL_DUDV_ATI)); @@ -2529,8 +2513,8 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) else { /* general path - note this is defined for 2d textures only */ const GLint components = _mesa_components_in_format(baseInternalFormat); - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcStride = _mesa_image_row_stride(srcPacking, srcWidth, + srcFormat, srcType); GLbyte *tempImage, *dst, *src; GLint row; @@ -2556,11 +2540,11 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) src = tempImage; dst = (GLbyte *) dstAddr + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { - memcpy(dst, src, srcWidth * dstFormat->TexelBytes); + memcpy(dst, src, srcWidth * texelBytes); dst += dstRowStride; - src += srcWidth * dstFormat->TexelBytes; + src += srcWidth * texelBytes; } _mesa_free((void *) tempImage); } @@ -2570,18 +2554,20 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) /** * Store a texture in MESA_FORMAT_SIGNED_RGBA8888 or MESA_FORMAT_SIGNED_RGBA8888_REV */ -GLboolean +static GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_signed_rgba8888 || - dstFormat == &_mesa_texformat_signed_rgba8888_rev); - ASSERT(dstFormat->TexelBytes == 4); + ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBA8888 || + dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV); + ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_signed_rgba8888 && + dstFormat == MESA_FORMAT_SIGNED_RGBA8888 && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_BYTE && !littleEndian) || (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && littleEndian))) { @@ -2595,7 +2581,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_signed_rgba8888_rev && + dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_BYTE && littleEndian) || (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && !littleEndian))) { @@ -2616,8 +2602,8 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_signed_rgba8888) || - (!littleEndian && dstFormat == &_mesa_texformat_signed_rgba8888_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_SIGNED_RGBA8888) || + (!littleEndian && dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV)) { dstmap[3] = 0; dstmap[2] = 1; dstmap[1] = 2; @@ -2644,7 +2630,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) /* general path */ const GLfloat *tempImage = make_temp_float_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2655,12 +2641,12 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_signed_rgba8888) { + if (dstFormat == MESA_FORMAT_SIGNED_RGBA8888) { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888( FLOAT_TO_BYTE_TEX(srcRow[RCOMP]), FLOAT_TO_BYTE_TEX(srcRow[GCOMP]), @@ -2689,7 +2675,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) /** * Store a combined depth/stencil texture image. */ -GLboolean +static GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS) { const GLfloat depthScale = (GLfloat) 0xffffff; @@ -2698,7 +2684,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) / sizeof(GLuint); GLint img, row; - ASSERT(dstFormat == &_mesa_texformat_z24_s8); + ASSERT(dstFormat == MESA_FORMAT_Z24_S8); ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT); ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT); @@ -2790,7 +2776,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) /** * Store a combined depth/stencil texture image. */ -GLboolean +static GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffffff; @@ -2799,7 +2785,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) / sizeof(GLuint); GLint img, row; - ASSERT(dstFormat == &_mesa_texformat_s8_z24); + ASSERT(dstFormat == MESA_FORMAT_S8_Z24); ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT); ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT); @@ -2879,24 +2865,26 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) * _mesa_texformat_luminance_alpha_float32 * _mesa_texformat_intensity_float32 */ -GLboolean +static GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) { - const GLint components = _mesa_components_in_format(dstFormat->BaseFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba_float32 || - dstFormat == &_mesa_texformat_rgb_float32 || - dstFormat == &_mesa_texformat_alpha_float32 || - dstFormat == &_mesa_texformat_luminance_float32 || - dstFormat == &_mesa_texformat_luminance_alpha_float32 || - dstFormat == &_mesa_texformat_intensity_float32); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + const GLint components = _mesa_components_in_format(baseFormat); + + ASSERT(dstFormat == MESA_FORMAT_RGBA_FLOAT32 || + dstFormat == MESA_FORMAT_RGB_FLOAT32 || + dstFormat == MESA_FORMAT_ALPHA_FLOAT32 || + dstFormat == MESA_FORMAT_LUMINANCE_FLOAT32 || + dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32 || + dstFormat == MESA_FORMAT_INTENSITY_FLOAT32); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLfloat)); + ASSERT(texelBytes == components * sizeof(GLfloat)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2914,7 +2902,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) /* general path */ const GLfloat *tempImage = make_temp_float_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2927,9 +2915,9 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) bytesPerRow = srcWidth * components * sizeof(GLfloat); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { _mesa_memcpy(dstRow, srcRow, bytesPerRow); dstRow += dstRowStride; @@ -2946,24 +2934,26 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) /** * As above, but store 16-bit floats. */ -GLboolean +static GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) { - const GLint components = _mesa_components_in_format(dstFormat->BaseFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba_float16 || - dstFormat == &_mesa_texformat_rgb_float16 || - dstFormat == &_mesa_texformat_alpha_float16 || - dstFormat == &_mesa_texformat_luminance_float16 || - dstFormat == &_mesa_texformat_luminance_alpha_float16 || - dstFormat == &_mesa_texformat_intensity_float16); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + const GLint components = _mesa_components_in_format(baseFormat); + + ASSERT(dstFormat == MESA_FORMAT_RGBA_FLOAT16 || + dstFormat == MESA_FORMAT_RGB_FLOAT16 || + dstFormat == MESA_FORMAT_ALPHA_FLOAT16 || + dstFormat == MESA_FORMAT_LUMINANCE_FLOAT16 || + dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16 || + dstFormat == MESA_FORMAT_INTENSITY_FLOAT16); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLhalfARB)); + ASSERT(texelBytes == components * sizeof(GLhalfARB)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2981,7 +2971,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) /* general path */ const GLfloat *tempImage = make_temp_float_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2992,9 +2982,9 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLhalfARB *dstTexel = (GLhalfARB *) dstRow; GLint i; @@ -3013,20 +3003,18 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) #if FEATURE_EXT_texture_sRGB -GLboolean +static GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; - StoreTexImageFunc store; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_srgb8); + ASSERT(dstFormat == MESA_FORMAT_SRGB8); /* reuse normal rgb texstore code */ - newDstFormat = &_mesa_texformat_rgb888; - store = _mesa_texstore_rgb888; + newDstFormat = MESA_FORMAT_RGB888; - k = store(ctx, dims, baseInternalFormat, + k = _mesa_texstore_rgb888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, @@ -3037,17 +3025,16 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_srgba8); + ASSERT(dstFormat == MESA_FORMAT_SRGBA8); /* reuse normal rgba texstore code */ - newDstFormat = &_mesa_texformat_rgba8888; - + newDstFormat = MESA_FORMAT_RGBA8888; k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, @@ -3059,16 +3046,16 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_sargb8); + ASSERT(dstFormat == MESA_FORMAT_SARGB8); /* reuse normal rgba texstore code */ - newDstFormat = &_mesa_texformat_argb8888; + newDstFormat = MESA_FORMAT_ARGB8888; k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -3081,15 +3068,15 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_sl8); + ASSERT(dstFormat == MESA_FORMAT_SL8); - newDstFormat = &_mesa_texformat_l8; + newDstFormat = MESA_FORMAT_L8; /* _mesa_textore_a8 handles luminance8 too */ k = _mesa_texstore_a8(ctx, dims, baseInternalFormat, @@ -3103,16 +3090,16 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_sla8); + ASSERT(dstFormat == MESA_FORMAT_SLA8); /* reuse normal luminance/alpha texstore code */ - newDstFormat = &_mesa_texformat_al88; + newDstFormat = MESA_FORMAT_AL88; k = _mesa_texstore_al88(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -3124,9 +3111,160 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) return k; } +#else + +/* these are used only in texstore_funcs[] below */ +#define _mesa_texstore_srgb8 NULL +#define _mesa_texstore_srgba8 NULL +#define _mesa_texstore_sargb8 NULL +#define _mesa_texstore_sl8 NULL +#define _mesa_texstore_sla8 NULL + #endif /* FEATURE_EXT_texture_sRGB */ + + +/** + * Table mapping MESA_FORMAT_8 to _mesa_texstore_*() + * XXX this is somewhat temporary. + */ +static const struct { + gl_format Name; + StoreTexImageFunc Store; +} +texstore_funcs[MESA_FORMAT_COUNT] = +{ + { MESA_FORMAT_NONE, NULL }, + { MESA_FORMAT_RGBA8888, _mesa_texstore_rgba8888 }, + { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 }, + { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, + { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 }, + { MESA_FORMAT_XRGB8888, _mesa_texstore_argb8888 }, + { MESA_FORMAT_XRGB8888_REV, _mesa_texstore_argb8888 }, + { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 }, + { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, + { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, + { MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 }, + { MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 }, + { MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 }, + { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 }, + { MESA_FORMAT_ARGB1555, _mesa_texstore_argb1555 }, + { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 }, + { MESA_FORMAT_AL88, _mesa_texstore_al88 }, + { MESA_FORMAT_AL88_REV, _mesa_texstore_al88 }, + { MESA_FORMAT_AL1616, _mesa_texstore_al1616 }, + { MESA_FORMAT_AL1616_REV, _mesa_texstore_al1616 }, + { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 }, + { MESA_FORMAT_A8, _mesa_texstore_a8 }, + { MESA_FORMAT_L8, _mesa_texstore_a8 }, + { MESA_FORMAT_I8, _mesa_texstore_a8 }, + { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, + { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, + { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, + { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, + { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, + { MESA_FORMAT_Z16, _mesa_texstore_z16 }, + { MESA_FORMAT_X8_Z24, _mesa_texstore_x8_z24 }, + { MESA_FORMAT_Z24_X8, _mesa_texstore_z24_x8 }, + { MESA_FORMAT_Z32, _mesa_texstore_z32 }, + { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, + { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, + { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 }, + { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 }, + { MESA_FORMAT_SL8, _mesa_texstore_sl8 }, + { MESA_FORMAT_SLA8, _mesa_texstore_sla8 }, + { MESA_FORMAT_SRGB_DXT1, _mesa_texstore_rgb_dxt1 }, + { MESA_FORMAT_SRGBA_DXT1, _mesa_texstore_rgba_dxt1 }, + { MESA_FORMAT_SRGBA_DXT3, _mesa_texstore_rgba_dxt3 }, + { MESA_FORMAT_SRGBA_DXT5, _mesa_texstore_rgba_dxt5 }, + { MESA_FORMAT_RGB_FXT1, _mesa_texstore_rgb_fxt1 }, + { MESA_FORMAT_RGBA_FXT1, _mesa_texstore_rgba_fxt1 }, + { MESA_FORMAT_RGB_DXT1, _mesa_texstore_rgb_dxt1 }, + { MESA_FORMAT_RGBA_DXT1, _mesa_texstore_rgba_dxt1 }, + { MESA_FORMAT_RGBA_DXT3, _mesa_texstore_rgba_dxt3 }, + { MESA_FORMAT_RGBA_DXT5, _mesa_texstore_rgba_dxt5 }, + { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, + { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_SIGNED_RGBA_16, NULL }, +}; + + +static GLboolean +_mesa_texstore_null(TEXSTORE_PARAMS) +{ + (void) ctx; (void) dims; + (void) baseInternalFormat; + (void) dstFormat; + (void) dstAddr; + (void) dstXoffset; (void) dstYoffset; (void) dstZoffset; + (void) dstRowStride; (void) dstImageOffsets; + (void) srcWidth; (void) srcHeight; (void) srcDepth; + (void) srcFormat; (void) srcType; + (void) srcAddr; + (void) srcPacking; + + /* should never happen */ + _mesa_problem(NULL, "_mesa_texstore_null() is called"); + return GL_FALSE; +} + + +/** + * Return the StoreTexImageFunc pointer to store an image in the given format. + */ +static StoreTexImageFunc +_mesa_get_texstore_func(gl_format format) +{ +#ifdef DEBUG + GLuint i; + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + ASSERT(texstore_funcs[i].Name == i); + } +#endif + ASSERT(texstore_funcs[format].Name == format); + + if (texstore_funcs[format].Store) + return texstore_funcs[format].Store; + else + return _mesa_texstore_null; +} + + +/** + * Store user data into texture memory. + * Called via glTex[Sub]Image1/2/3D() + */ +GLboolean +_mesa_texstore(TEXSTORE_PARAMS) +{ + StoreTexImageFunc storeImage; + GLboolean success; + + storeImage = _mesa_get_texstore_func(dstFormat); + + success = storeImage(ctx, dims, baseInternalFormat, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, srcPacking); + return success; +} + + /** * 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. @@ -3215,136 +3353,23 @@ _mesa_unmap_teximage_pbo(GLcontext *ctx, } - -/** - * Adaptor for fetching a GLchan texel from a float-valued texture. - */ -static void -fetch_texel_float_to_chan(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texelOut) +/** Return texture size in bytes */ +static GLuint +texture_size(const struct gl_texture_image *texImage) { - GLfloat temp[4]; - ASSERT(texImage->FetchTexelf); - texImage->FetchTexelf(texImage, i, j, k, temp); - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* just one channel */ - UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); - } - else { - /* four channels */ - UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[1], temp[1]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[2], temp[2]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[3], temp[3]); - } + GLuint sz = _mesa_format_image_size(texImage->TexFormat, texImage->Width, + texImage->Height, texImage->Depth); + return sz; } -/** - * Adaptor for fetching a float texel from a GLchan-valued texture. - */ -static void -fetch_texel_chan_to_float(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texelOut) +/** Return row stride in bytes */ +static GLuint +texture_row_stride(const struct gl_texture_image *texImage) { - GLchan temp[4]; - ASSERT(texImage->FetchTexelc); - texImage->FetchTexelc(texImage, i, j, k, temp); - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* just one channel */ - texelOut[0] = CHAN_TO_FLOAT(temp[0]); - } - else { - /* four channels */ - texelOut[0] = CHAN_TO_FLOAT(temp[0]); - texelOut[1] = CHAN_TO_FLOAT(temp[1]); - texelOut[2] = CHAN_TO_FLOAT(temp[2]); - texelOut[3] = CHAN_TO_FLOAT(temp[3]); - } -} - - -/** - * Initialize the texture image's FetchTexelc and FetchTexelf methods. - */ -void -_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) -{ - ASSERT(dims == 1 || dims == 2 || dims == 3); - ASSERT(texImage->TexFormat); - - switch (dims) { - case 1: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; - break; - case 2: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; - break; - case 3: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df; - break; - default: - ; - } - - /* now check if we need to use a float/chan adaptor */ - if (!texImage->FetchTexelc) { - texImage->FetchTexelc = fetch_texel_float_to_chan; - } - else if (!texImage->FetchTexelf) { - texImage->FetchTexelf = fetch_texel_chan_to_float; - } - - - ASSERT(texImage->FetchTexelc); - ASSERT(texImage->FetchTexelf); -} - - -/** - * Choose the actual storage format for a new texture image. - * Mainly, this is a wrapper for the driver's ChooseTextureFormat() function. - * Also set some other texImage fields related to texture compression, etc. - * \param ctx rendering context - * \param texImage the gl_texture_image - * \param dims texture dimensions (1, 2 or 3) - * \param format the user-specified format parameter - * \param type the user-specified type parameter - * \param internalFormat the user-specified internal format hint - */ -static void -choose_texture_format(GLcontext *ctx, struct gl_texture_image *texImage, - GLuint dims, - GLenum format, GLenum type, GLint internalFormat) -{ - ASSERT(dims == 1 || dims == 2 || dims == 3); - ASSERT(ctx->Driver.ChooseTextureFormat); - - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); - - ASSERT(texImage->TexFormat); - - _mesa_set_fetch_functions(texImage, dims); - - if (texImage->TexFormat->TexelBytes == 0) { - /* must be a compressed format */ - texImage->IsCompressed = GL_TRUE; - texImage->CompressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); - } - else { - /* non-compressed format */ - texImage->IsCompressed = GL_FALSE; - texImage->CompressedSize = 0; - } + GLuint stride = _mesa_format_row_stride(texImage->TexFormat, + texImage->Width); + return stride; } @@ -3366,16 +3391,11 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint sizeInBytes; + GLuint sizeInBytes; (void) border; - choose_texture_format(ctx, texImage, 1, format, type, internalFormat); - /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = texImage->Width * texImage->TexFormat->TexelBytes; + sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); @@ -3392,26 +3412,19 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, } else { const GLint dstRowStride = 0; - GLboolean success; - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + GLboolean success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3435,18 +3448,11 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint texelBytes, sizeInBytes; + GLuint sizeInBytes; (void) border; - choose_texture_format(ctx, texImage, 2, format, type, internalFormat); - - texelBytes = texImage->TexFormat->TexelBytes; - /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = texImage->Width * texImage->Height * texelBytes; + sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); @@ -3462,34 +3468,20 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; } else { - GLint dstRowStride; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3509,18 +3501,11 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint texelBytes, sizeInBytes; + GLuint sizeInBytes; (void) border; - choose_texture_format(ctx, texImage, 3, format, type, internalFormat); - - texelBytes = texImage->TexFormat->TexelBytes; - /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = width * height * depth * texelBytes; + sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); @@ -3536,34 +3521,20 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, return; } else { - GLint dstRowStride; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3590,26 +3561,19 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, { const GLint dstRowStride = 0; - GLboolean success; - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, 0, 0, /* offsets */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + GLboolean success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, 0, 0, /* offsets */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3635,34 +3599,20 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, return; { - GLint dstRowStride = 0; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, - texImage->Width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3688,34 +3638,20 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, return; { - GLint dstRowStride; - GLboolean success; - if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, - texImage->Width); - } - else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; - } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D"); } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3766,8 +3702,6 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->Depth == 1); ASSERT(texImage->Data == NULL); /* was freed in glCompressedTexImage2DARB */ - choose_texture_format(ctx, texImage, 2, 0, 0, internalFormat); - /* allocate storage */ texImage->Data = _mesa_alloc_texmemory(imageSize); if (!texImage->Data) { @@ -3782,14 +3716,8 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; /* copy the data */ - ASSERT(texImage->CompressedSize == (GLuint) imageSize); MEMCPY(texImage->Data, data, imageSize); - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } @@ -3860,15 +3788,20 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLint i, rows; GLubyte *dest; const GLubyte *src; - const GLuint mesaFormat = texImage->TexFormat->MesaFormat; + const gl_format texFormat = texImage->TexFormat; + const GLint destWidth = texImage->Width; + GLuint bw, bh; + _mesa_get_format_block_size(texFormat, &bw, &bh); + + (void) level; (void) format; /* these should have been caught sooner */ - ASSERT((width & 3) == 0 || width == 2 || width == 1); - ASSERT((height & 3) == 0 || height == 2 || height == 1); - ASSERT((xoffset & 3) == 0); - ASSERT((yoffset & 3) == 0); + ASSERT((width % bw) == 0 || width == 2 || width == 1); + ASSERT((height % bh) == 0 || height == 2 || height == 1); + ASSERT((xoffset % bw) == 0); + ASSERT((yoffset % bh) == 0); /* get pointer to src pixels (may be in a pbo which we'll map here) */ data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, @@ -3877,29 +3810,24 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, if (!data) return; - srcRowStride = _mesa_compressed_row_stride(mesaFormat, width); + srcRowStride = _mesa_format_row_stride(texFormat, width); src = (const GLubyte *) data; - destRowStride = _mesa_compressed_row_stride(mesaFormat, texImage->Width); + destRowStride = _mesa_format_row_stride(texFormat, destWidth); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, - texImage->TexFormat->MesaFormat, - texImage->Width, + texFormat, destWidth, (GLubyte *) texImage->Data); - bytesPerRow = srcRowStride; - rows = height / 4; + bytesPerRow = srcRowStride; /* bytes per row of blocks */ + rows = height / bh; /* rows in blocks */ + /* copy rows of blocks */ for (i = 0; i < rows; i++) { MEMCPY(dest, src, bytesPerRow); dest += destRowStride; src += srcRowStride; } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } diff --git a/mesalib/src/mesa/main/texstore.h b/mesalib/src/mesa/main/texstore.h index 313f2d6a5..3211086dd 100644 --- a/mesalib/src/mesa/main/texstore.h +++ b/mesalib/src/mesa/main/texstore.h @@ -37,49 +37,40 @@ #include "mtypes.h" +#include "formats.h" -extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_al88_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS); -#if FEATURE_EXT_texture_sRGB -extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS); -#endif -extern GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS); +/** + * 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 \ + GLcontext *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(GLcontext *ctx, GLuint dims, @@ -91,10 +82,6 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, const struct gl_pixelstore_attrib *srcPacking); -extern void -_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); - - extern void _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 6cd2a2f4f..c2193074c 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -51,9 +51,8 @@ * \param stride stride between elements, in elements * \param normalized are integer types converted to floats in [-1, 1]? * \param ptr the address (or offset inside VBO) of the array data - * \return GL_TRUE if no error, GL_FALSE if error */ -static GLboolean +static void update_array(GLcontext *ctx, struct gl_client_array *array, GLbitfield dirtyBit, GLsizei elementSize, GLint size, GLenum type, GLenum format, @@ -68,7 +67,7 @@ update_array(GLcontext *ctx, struct gl_client_array *array, */ _mesa_error(ctx, GL_INVALID_OPERATION, "glVertex/Normal/EtcPointer(non-VBO array)"); - return GL_FALSE; + return; } array->Size = size; @@ -85,8 +84,6 @@ update_array(GLcontext *ctx, struct gl_client_array *array, ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= dirtyBit; - - return GL_TRUE; } @@ -140,12 +137,8 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, - elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.VertexPointer) - ctx->Driver.VertexPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -192,12 +185,8 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, - elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr)) - return; - - if (ctx->Driver.NormalPointer) - ctx->Driver.NormalPointer( ctx, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, + elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr); } @@ -272,12 +261,8 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, - elementSize, size, type, format, stride, GL_TRUE, ptr)) - return; - - if (ctx->Driver.ColorPointer) - ctx->Driver.ColorPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, + elementSize, size, type, format, stride, GL_TRUE, ptr); } @@ -305,12 +290,8 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, - elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.FogCoordPointer) - ctx->Driver.FogCoordPointer( ctx, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -347,12 +328,8 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, - elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.IndexPointer) - ctx->Driver.IndexPointer( ctx, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -423,13 +400,8 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, - _NEW_ARRAY_COLOR1, elementSize, size, type, - format, stride, GL_TRUE, ptr)) - return; - - if (ctx->Driver.SecondaryColorPointer) - ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1, + elementSize, size, type, format, stride, GL_TRUE, ptr); } @@ -485,13 +457,9 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], - _NEW_ARRAY_TEXCOORD(unit), - elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.TexCoordPointer) - ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], + _NEW_ARRAY_TEXCOORD(unit), + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -506,13 +474,9 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, - sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA, - stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.EdgeFlagPointer) - ctx->Driver.EdgeFlagPointer( ctx, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, + sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA, + stride, GL_FALSE, ptr); } @@ -620,13 +584,9 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], - _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, format, stride, normalized, ptr)) - return; - - if (ctx->Driver.VertexAttribPointer) - ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], + _NEW_ARRAY_ATTRIB(index), + elementSize, size, type, format, stride, normalized, ptr); } #endif @@ -720,13 +680,9 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], - _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, format, stride, normalized, ptr)) - return; - - if (ctx->Driver.VertexAttribPointer) - ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr); + update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], + _NEW_ARRAY_ATTRIB(index), + elementSize, size, type, format, stride, normalized, ptr); } #endif @@ -989,9 +945,6 @@ _mesa_LockArraysEXT(GLint first, GLsizei count) ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= _NEW_ARRAY_ALL; - - if (ctx->Driver.LockArraysEXT) - ctx->Driver.LockArraysEXT( ctx, first, count ); } @@ -1013,9 +966,6 @@ _mesa_UnlockArraysEXT( void ) ctx->Array.LockCount = 0; ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= _NEW_ARRAY_ALL; - - if (ctx->Driver.UnlockArraysEXT) - ctx->Driver.UnlockArraysEXT( ctx ); } diff --git a/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h index becc67c29..ef790c504 100644 --- a/mesalib/src/mesa/main/varray.h +++ b/mesalib/src/mesa/main/varray.h @@ -129,6 +129,11 @@ 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, @@ -159,6 +164,16 @@ 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 _mesa_copy_client_array(GLcontext *ctx, diff --git a/mesalib/src/mesa/main/version.h b/mesalib/src/mesa/main/version.h index 3e9143979..9c758ce3b 100644 --- a/mesalib/src/mesa/main/version.h +++ b/mesalib/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.6.1 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -30,9 +30,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 6 -#define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-rc1" +#define MESA_MINOR 7 +#define MESA_PATCH 0 +#define MESA_VERSION_STRING "7.7" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/mesalib/src/mesa/main/vtxfmt.c b/mesalib/src/mesa/main/vtxfmt.c index 8d6f560a8..c9eea8ab8 100644 --- a/mesalib/src/mesa/main/vtxfmt.c +++ b/mesalib/src/mesa/main/vtxfmt.c @@ -27,12 +27,18 @@ */ #include "glheader.h" +#include "api_arrayelt.h" #include "api_loopback.h" #include "context.h" #include "imports.h" #include "mtypes.h" #include "state.h" #include "vtxfmt.h" +#include "eval.h" +#include "dlist.h" + + +#if FEATURE_beginend /* The neutral vertex format. This wraps all tnl module functions, @@ -82,18 +88,16 @@ static void install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) { - SET_ArrayElement(tab, vfmt->ArrayElement); + _mesa_install_arrayelt_vtxfmt(tab, vfmt); + SET_Color3f(tab, vfmt->Color3f); SET_Color3fv(tab, vfmt->Color3fv); SET_Color4f(tab, vfmt->Color4f); SET_Color4fv(tab, vfmt->Color4fv); SET_EdgeFlag(tab, vfmt->EdgeFlag); - SET_EvalCoord1f(tab, vfmt->EvalCoord1f); - SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv); - SET_EvalCoord2f(tab, vfmt->EvalCoord2f); - SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv); - SET_EvalPoint1(tab, vfmt->EvalPoint1); - SET_EvalPoint2(tab, vfmt->EvalPoint2); + + _mesa_install_eval_vtxfmt(tab, vfmt); + SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); SET_Indexf(tab, vfmt->Indexf); @@ -125,8 +129,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_Vertex3fv(tab, vfmt->Vertex3fv); SET_Vertex4f(tab, vfmt->Vertex4f); SET_Vertex4fv(tab, vfmt->Vertex4fv); - SET_CallList(tab, vfmt->CallList); - SET_CallLists(tab, vfmt->CallLists); + + _mesa_install_dlist_vtxfmt(tab, vfmt); + SET_Begin(tab, vfmt->Begin); SET_End(tab, vfmt->End); SET_Rectf(tab, vfmt->Rectf); @@ -134,9 +139,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawElements(tab, vfmt->DrawElements); SET_DrawRangeElements(tab, vfmt->DrawRangeElements); SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT); - SET_EvalMesh1(tab, vfmt->EvalMesh1); - SET_EvalMesh2(tab, vfmt->EvalMesh2); - ASSERT(tab->EvalMesh2); + SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); + SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); + SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); @@ -193,3 +198,6 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) tnl->SwapCount = 0; } + + +#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/main/vtxfmt.h b/mesalib/src/mesa/main/vtxfmt.h index 76f108e02..fb6c23abe 100644 --- a/mesalib/src/mesa/main/vtxfmt.h +++ b/mesalib/src/mesa/main/vtxfmt.h @@ -33,6 +33,8 @@ #ifndef _VTXFMT_H_ #define _VTXFMT_H_ +#if FEATURE_beginend + extern void _mesa_init_exec_vtxfmt( GLcontext *ctx ); extern void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ); @@ -40,4 +42,28 @@ extern void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfm extern void _mesa_restore_exec_vtxfmt( GLcontext *ctx ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_init_exec_vtxfmt( GLcontext *ctx ) +{ +} + +static INLINE void +_mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_restore_exec_vtxfmt( GLcontext *ctx ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* _VTXFMT_H_ */ diff --git a/mesalib/src/mesa/main/vtxfmt_tmp.h b/mesalib/src/mesa/main/vtxfmt_tmp.h index 1308d0aa4..ae636fb24 100644 --- a/mesalib/src/mesa/main/vtxfmt_tmp.h +++ b/mesalib/src/mesa/main/vtxfmt_tmp.h @@ -30,7 +30,6 @@ #endif #include "glapi/dispatch.h" -#include "glapi/glapioffsets.h" static void GLAPIENTRY TAG(ArrayElement)( GLint i ) { @@ -354,6 +353,44 @@ static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start, CALL_DrawRangeElements(GET_DISPATCH(), ( mode, start, end, count, type, indices )); } +static void GLAPIENTRY TAG(DrawElementsBaseVertex)( GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + PRE_LOOPBACK( DrawElementsBaseVertex ); + CALL_DrawElementsBaseVertex(GET_DISPATCH(), ( mode, count, type, + indices, basevertex )); +} + +static void GLAPIENTRY TAG(DrawRangeElementsBaseVertex)( GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + PRE_LOOPBACK( DrawRangeElementsBaseVertex ); + CALL_DrawRangeElementsBaseVertex(GET_DISPATCH(), ( mode, start, end, + count, type, indices, + basevertex )); +} + +static void GLAPIENTRY TAG(MultiDrawElementsBaseVertex)( GLenum mode, + const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex) +{ + PRE_LOOPBACK( MultiDrawElementsBaseVertex ); + CALL_MultiDrawElementsBaseVertex(GET_DISPATCH(), ( mode, count, type, + indices, + primcount, basevertex )); +} + static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 ) { PRE_LOOPBACK( EvalMesh1 ); @@ -534,6 +571,9 @@ static GLvertexformat TAG(vtxfmt) = { TAG(DrawElements), TAG(DrawRangeElements), TAG(MultiDrawElementsEXT), + TAG(DrawElementsBaseVertex), + TAG(DrawRangeElementsBaseVertex), + TAG(MultiDrawElementsBaseVertex), TAG(EvalMesh1), TAG(EvalMesh2) }; diff --git a/mesalib/src/mesa/math/m_clip_tmp.h b/mesalib/src/mesa/math/m_clip_tmp.h index f3a589be0..2e3096405 100644 --- a/mesalib/src/mesa/math/m_clip_tmp.h +++ b/mesalib/src/mesa/math/m_clip_tmp.h @@ -44,7 +44,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLfloat *from = (GLfloat *)clip_vec->start; @@ -66,16 +67,20 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, mask |= (((cw < -cx) << CLIP_LEFT_SHIFT)); mask |= (((cw < cy) << CLIP_TOP_SHIFT)); mask |= (((cw < -cy) << CLIP_BOTTOM_SHIFT)); - mask |= (((cw < cz) << CLIP_FAR_SHIFT)); - mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + if (viewport_z_clip) { + mask |= (((cw < cz) << CLIP_FAR_SHIFT)); + mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + } #else /* !defined(macintosh)) */ GLubyte mask = 0; if (-cx + cw < 0) mask |= CLIP_RIGHT_BIT; if ( cx + cw < 0) mask |= CLIP_LEFT_BIT; if (-cy + cw < 0) mask |= CLIP_TOP_BIT; if ( cy + cw < 0) mask |= CLIP_BOTTOM_BIT; - if (-cz + cw < 0) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if (-cz + cw < 0) mask |= CLIP_FAR_BIT; + if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + } #endif /* defined(macintosh) */ clipMask[i] = mask; @@ -119,7 +124,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -141,16 +147,20 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, mask |= (((cw < -cx) << CLIP_LEFT_SHIFT)); mask |= (((cw < cy) << CLIP_TOP_SHIFT)); mask |= (((cw < -cy) << CLIP_BOTTOM_SHIFT)); - mask |= (((cw < cz) << CLIP_FAR_SHIFT)); - mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + if (viewport_z_clip) { + mask |= (((cw < cz) << CLIP_FAR_SHIFT)); + mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + } #else /* !defined(macintosh)) */ GLubyte mask = 0; if (-cx + cw < 0) mask |= CLIP_RIGHT_BIT; if ( cx + cw < 0) mask |= CLIP_LEFT_BIT; if (-cy + cw < 0) mask |= CLIP_TOP_BIT; if ( cy + cw < 0) mask |= CLIP_BOTTOM_BIT; - if (-cz + cw < 0) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if (-cz + cw < 0) mask |= CLIP_FAR_BIT; + if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + } #endif /* defined(macintosh) */ clipMask[i] = mask; @@ -171,7 +181,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -187,8 +198,10 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, else if (cx < -1.0) mask |= CLIP_LEFT_BIT; if (cy > 1.0) mask |= CLIP_TOP_BIT; else if (cy < -1.0) mask |= CLIP_BOTTOM_BIT; - if (cz > 1.0) mask |= CLIP_FAR_BIT; - else if (cz < -1.0) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if (cz > 1.0) mask |= CLIP_FAR_BIT; + else if (cz < -1.0) mask |= CLIP_NEAR_BIT; + } clipMask[i] = mask; tmpOrMask |= mask; tmpAndMask &= mask; @@ -204,7 +217,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -231,7 +245,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, } -static void TAG(init_c_cliptest)( void ) +void TAG(init_c_cliptest)( void ) { _mesa_clip_tab[4] = TAG(cliptest_points4); _mesa_clip_tab[3] = TAG(cliptest_points3); diff --git a/mesalib/src/mesa/math/m_debug_clip.c b/mesalib/src/mesa/math/m_debug_clip.c index 460fed4a7..95ae5a347 100644 --- a/mesalib/src/mesa/math/m_debug_clip.c +++ b/mesalib/src/mesa/math/m_debug_clip.c @@ -67,7 +67,8 @@ static GLvector4f *ref_cliptest_points4( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -87,8 +88,10 @@ static GLvector4f *ref_cliptest_points4( GLvector4f *clip_vec, if ( cx + cw < 0 ) mask |= CLIP_LEFT_BIT; if ( -cy + cw < 0 ) mask |= CLIP_TOP_BIT; if ( cy + cw < 0 ) mask |= CLIP_BOTTOM_BIT; - if ( -cz + cw < 0 ) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0 ) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if ( -cz + cw < 0 ) mask |= CLIP_FAR_BIT; + if ( cz + cw < 0 ) mask |= CLIP_NEAR_BIT; + } clipMask[i] = mask; if ( mask ) { c++; @@ -122,7 +125,8 @@ static GLvector4f *ref_cliptest_points3( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -138,8 +142,10 @@ static GLvector4f *ref_cliptest_points3( GLvector4f *clip_vec, else if ( cx < -1.0 ) mask |= CLIP_LEFT_BIT; if ( cy > 1.0 ) mask |= CLIP_TOP_BIT; else if ( cy < -1.0 ) mask |= CLIP_BOTTOM_BIT; - if ( cz > 1.0 ) mask |= CLIP_FAR_BIT; - else if ( cz < -1.0 ) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if ( cz > 1.0 ) mask |= CLIP_FAR_BIT; + else if ( cz < -1.0 ) mask |= CLIP_NEAR_BIT; + } clipMask[i] = mask; tmpOrMask |= mask; tmpAndMask &= mask; @@ -154,7 +160,8 @@ static GLvector4f * ref_cliptest_points2( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -163,6 +170,9 @@ static GLvector4f * ref_cliptest_points2( GLvector4f *clip_vec, GLubyte tmpOrMask = *orMask; GLubyte tmpAndMask = *andMask; GLuint i; + + (void) viewport_z_clip; + for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) { const GLfloat cx = from[0], cy = from[1]; GLubyte mask = 0; @@ -208,6 +218,7 @@ static int test_cliptest_function( clip_func func, int np, #ifdef RUN_DEBUG_BENCHMARK int cycle_i; /* the counter for the benchmarks we run */ #endif + GLboolean viewport_z_clip = GL_TRUE; (void) cycles; @@ -247,15 +258,15 @@ static int test_cliptest_function( clip_func func, int np, dco = rco = 0; dca = rca = CLIP_FRUSTUM_BITS; - ref_cliptest[psize]( source, ref, rm, &rco, &rca ); + ref_cliptest[psize]( source, ref, rm, &rco, &rca, viewport_z_clip ); if ( mesa_profile ) { BEGIN_RACE( *cycles ); - func( source, dest, dm, &dco, &dca ); + func( source, dest, dm, &dco, &dca, viewport_z_clip ); END_RACE( *cycles ); } else { - func( source, dest, dm, &dco, &dca ); + func( source, dest, dm, &dco, &dca, viewport_z_clip ); } if ( dco != rco ) { diff --git a/mesalib/src/mesa/math/m_xform.h b/mesalib/src/mesa/math/m_xform.h index 7ef76e0b9..33421ad1c 100644 --- a/mesalib/src/mesa/math/m_xform.h +++ b/mesalib/src/mesa/math/m_xform.h @@ -43,7 +43,8 @@ extern void _math_init_transformation(void); - +extern void +init_c_cliptest(void); /* KW: Clip functions now do projective divide as well. The projected * coordinates are very useful to us because they let us cull @@ -102,7 +103,8 @@ typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip, GLvector4f *vProj, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ); + GLubyte *andMask, + GLboolean viewport_z_clip ); typedef void (*dotprod_func)( GLfloat *out, GLuint out_stride, diff --git a/mesalib/src/mesa/ppc/common_ppc.c b/mesalib/src/mesa/ppc/common_ppc.c new file mode 100644 index 000000000..c7cec96e5 --- /dev/null +++ b/mesalib/src/mesa/ppc/common_ppc.c @@ -0,0 +1,91 @@ +/* + * (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 + * 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 common_ppc.c + * Check CPU capabilities & initialize optimized funtions for this particular + * processor. + * + * \author Ian Romanick + */ + +#include +#include +#include + +#ifdef USE_PPC_ASM +#include +#endif + +#include "common_ppc_features.h" + + +unsigned long _mesa_ppc_cpu_features = 0; + +/** + * Detect CPU features and install optimized transform and lighting routines. + * Currently, CPU features are only detected. The optimized routines have + * yet to be written. + * + * \bug + * This routine is highly specific to Linux kernel 2.6. I'm still waiting + * to hear back from the glibc folk on how to do this "right". + */ + +void _mesa_init_all_ppc_transform_asm( void ) +{ +#ifdef USE_PPC_ASM + const pid_t my_pid = getpid(); + char file_name[32]; + FILE * f; +#ifdef __powerpc64__ + Elf64_auxv_t v; +#else + Elf32_auxv_t v; +#endif + + sprintf( file_name, "/proc/%u/auxv", (unsigned) my_pid ); + f = fopen( file_name, "rb" ); + if ( f != NULL ) { + while( 1 ) { + ssize_t elem = fread( & v, sizeof( v ), 1, f ); + + if ( elem < 1 ) { + break; + } + + if ( v.a_type == AT_HWCAP ) { + _mesa_ppc_cpu_features = v.a_un.a_val; + break; + } + } + + fclose( f ); + } + +# ifndef USE_VMX_ASM + _mesa_ppc_cpu_features &= ~PPC_FEATURE_HAS_ALTIVEC; +# endif +#endif +} diff --git a/mesalib/src/mesa/ppc/common_ppc_features.h b/mesalib/src/mesa/ppc/common_ppc_features.h new file mode 100644 index 000000000..9cde422d7 --- /dev/null +++ b/mesalib/src/mesa/ppc/common_ppc_features.h @@ -0,0 +1,54 @@ +/* + * (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 + * 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 common_ppc_features.h + * Interface for determining which CPU features were detected. + * + * \author Ian Romanick + */ + +#ifndef COMMON_PPC_FEATURES_H +#define COMMON_PPC_FEATURES_H + +#ifdef USE_PPC_ASM +#include + +extern unsigned long _mesa_ppc_cpu_features; + + +/* The PPC_FEATURE_* values come from asm/cputable.h. Should we define + * versions of them here if that file does not exist? This will only + * matter once these code paths are supported on non-Linux platforms. + */ + +#define cpu_has_64 ((_mesa_ppc_cpu_features & PPC_FEATURE_64) != 0) +#define cpu_has_vmx ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_ALTIVEC) != 0) +#define cpu_has_fpu ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_FPU) != 0) + +#endif /* USE_PPC_ASM */ + +extern void _mesa_init_all_ppc_transform_asm( void ); + +#endif /* COMMON_PPC_FEATURES_H */ diff --git a/mesalib/src/mesa/shader/grammar/grammar.syn b/mesalib/src/mesa/shader/grammar/grammar.syn deleted file mode 100644 index 5d99f65bf..000000000 --- a/mesalib/src/mesa/shader/grammar/grammar.syn +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * 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 grammar.syn - * syntax of .syn script - used to validate other syntax files - * \author Michal Krol - */ - -.syntax grammar; - -/* declaration */ -.emtcode DECLARATION_END 0 -.emtcode DECLARATION_EMITCODE 1 -.emtcode DECLARATION_ERRORTEXT 2 -.emtcode DECLARATION_REGBYTE 3 -.emtcode DECLARATION_LEXER 4 -.emtcode DECLARATION_RULE 5 - -/* specifier */ -.emtcode SPECIFIER_END 0 -.emtcode SPECIFIER_AND_TAG 1 -.emtcode SPECIFIER_OR_TAG 2 -.emtcode SPECIFIER_CHARACTER_RANGE 3 -.emtcode SPECIFIER_CHARACTER 4 -.emtcode SPECIFIER_STRING 5 -.emtcode SPECIFIER_IDENTIFIER 6 -.emtcode SPECIFIER_TRUE 7 -.emtcode SPECIFIER_FALSE 8 -.emtcode SPECIFIER_DEBUG 9 - -/* identifier */ -.emtcode IDENTIFIER_SIMPLE 0 -.emtcode IDENTIFIER_LOOP 1 - -/* error */ -.emtcode ERROR_NOT_PRESENT 0 -.emtcode ERROR_PRESENT 1 - -/* emit */ -.emtcode EMIT_NULL 0 -.emtcode EMIT_INTEGER 1 -.emtcode EMIT_IDENTIFIER 2 -.emtcode EMIT_CHARACTER 3 -.emtcode EMIT_LAST_CHARACTER 4 -.emtcode EMIT_CURRENT_POSITION 5 - -.errtext INVALID_GRAMMAR "internal error 2001: invalid grammar script" -.errtext SYNTAX_EXPECTED "internal error 2002: '.syntax' keyword expected" -.errtext IDENTIFIER_EXPECTED "internal error 2003: identifier expected" -.errtext MISSING_SEMICOLON "internal error 2004: missing ';'" -.errtext INTEGER_EXPECTED "internal error 2005: integer value expected" -.errtext STRING_EXPECTED "internal error 2006: string expected" - -/* - ::= ".syntax" ";" -*/ -grammar - grammar_1 .error INVALID_GRAMMAR; -grammar_1 - optional_space .and ".syntax" .error SYNTAX_EXPECTED .and space .and identifier .and - semicolon .and declaration_list .and optional_space .and '\0' .emit DECLARATION_END; - -/* - ::= - | "" -*/ -optional_space - space .or .true; - -/* - ::= * -*/ -space - single_space .and .loop single_space; - -/* - ::= - | -*/ -single_space - white_char .or comment_block; - -/* - ::= " " - | "\t" - | "\n" - | "\r" -*/ -white_char - ' ' .or '\t' .or '\n' .or '\r'; - -/* - ::= "/" "*" -*/ -comment_block - '/' .and '*' .and comment_rest; - -/* - ::= * - | * "*" -*/ -comment_rest - .loop comment_char_no_star .and comment_rest_1; -comment_rest_1 - comment_end .or comment_rest_2; -comment_rest_2 - '*' .and comment_rest; - -/* - ::= All ASCII characters except "*" and "\0" -*/ -comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -/* - ::= "*" "/" -*/ -comment_end - '*' .and '/'; - -/* - ::= -*/ -identifier - identifier_ne .error IDENTIFIER_EXPECTED; - -/* - ::= * -*/ -identifier_ne - first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit '\0'; - -/* - ::= "a"-"z" - | "A"-"Z" - | "_" -*/ -first_idchar - 'a'-'z' .or 'A'-'Z' .or '_'; - -/* - ::= - | -*/ -follow_idchar - first_idchar .or digit_dec; - -/* - ::= "0"-"9" -*/ -digit_dec - '0'-'9'; - -/* - ::= ";" -*/ -semicolon - optional_space .and ';' .error MISSING_SEMICOLON .and optional_space; - -/* - ::= - | -*/ -declaration_list - declaration .and .loop declaration; - -/* - ::= - | - | - | -*/ -declaration - emitcode_definition .emit DECLARATION_EMITCODE .or - errortext_definition .emit DECLARATION_ERRORTEXT .or - regbyte_definition .emit DECLARATION_REGBYTE .or - lexer_definition .emit DECLARATION_LEXER .or - rule_definition .emit DECLARATION_RULE; - -/* - ::= ".emtcode" -*/ -emitcode_definition - ".emtcode" .and space .and identifier .and space .and integer .and space_or_null; - -/* - ::= -*/ -integer - integer_ne .error INTEGER_EXPECTED; - -/* - ::= - | -*/ -integer_ne - hex_integer .emit 0x10 .or dec_integer .emit 10; - -/* - :: * -*/ -hex_integer - hex_prefix .and digit_hex .emit * .and .loop digit_hex .emit * .and .true .emit '\0'; - -/* - ::= "0x" - | "0X" -*/ -hex_prefix - '0' .and hex_prefix_1; -hex_prefix_1 - 'x' .or 'X'; - -/* - ::= "0"-"9" - | "a"-"f" - | "A"-"F" -*/ -digit_hex - '0'-'9' .or 'a'-'f' .or 'A'-'F'; - -/* - :: * -*/ -dec_integer - digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -/* - ::= - | "\0" -*/ -space_or_null - space .or '\0'; - -/* - ::= ".errtext" -*/ -errortext_definition - ".errtext" .and space .and identifier .and space .and string .and space_or_null; - -/* - ::= -*/ -string - string_ne .error STRING_EXPECTED; - -/* - ::= "\"" "\"" -*/ -string_ne - '"' .and .loop string_char_double_quotes .and '"' .emit '\0'; - -/* - ::= - | - | "\'" -*/ -string_char_double_quotes - escape_sequence .or string_char .emit * .or '\'' .emit *; - -/* - ::= All ASCII characters except "\'", "\"", "\n", "\r", - "\0" and "\\" -*/ -string_char - '\x5D'-'\xFF' .or '\x28'-'\x5B' .or '\x23'-'\x26' .or '\x0E'-'\x21' .or '\x0B'-'\x0C' .or - '\x01'-'\x09'; - -/* - ::= "\\" -*/ -escape_sequence - '\\' .emit * .and escape_code; - -/* - ::= - | - | -*/ -escape_code - simple_escape_code .emit * .or hex_escape_code .or oct_escape_code; - -/* - ::= "\'" - | "\"" - | "?" - | "\\" - | "a" - | "b" - | "f" - | "n" - | "r" - | "t" - | "v" -*/ -simple_escape_code - '\'' .or '"' .or '?' .or '\\' .or 'a' .or 'b' .or 'f' .or 'n' .or 'r' .or 't' .or 'v'; - -/* - ::= "x" * -*/ -hex_escape_code - 'x' .emit * .and digit_hex .emit * .and .loop digit_hex .emit *; - -/* - ::= -*/ -oct_escape_code - digit_oct .emit * .and optional_digit_oct .and optional_digit_oct; - -/* - ::= "0"-"7" -*/ -digit_oct - '0'-'7'; - -/* - ::= - | "" -*/ -optional_digit_oct - digit_oct .emit * .or .true; - -/* - ::= ".regbyte" -*/ -regbyte_definition - ".regbyte" .and space .and identifier .and space .and integer .and space_or_null; - -/* - ::= ".string" ";" -*/ -lexer_definition - ".string" .and space .and identifier .and semicolon; - -/* - ::= -*/ -rule_definition - identifier_ne .and space .and definition; - -/* - ::= ";" -*/ -definition - specifier .and optional_specifiers_and_or .and semicolon .emit SPECIFIER_END; - -/* - ::= - | - | "" -*/ -optional_specifiers_and_or - and_specifiers .emit SPECIFIER_AND_TAG .or or_specifiers .emit SPECIFIER_OR_TAG .or .true; - -/* - ::= -*/ -specifier - specifier_condition .and optional_space .and specifier_rule; - -/* - ::= ".if" "(" ")" -*/ -specifier_condition - specifier_condition_1 .or .true; -specifier_condition_1 - ".if" .and optional_space .and '(' .and optional_space .and left_operand .and operator .and - right_operand .and optional_space .and ')'; - -/* - ::= -*/ -left_operand - identifier; - -/* - ::= "!=" - | "==" -*/ -operator - operator_1 .or operator_2; -operator_1 - optional_space .and '!' .and '=' .and optional_space; -operator_2 - optional_space .and '=' .and '=' .and optional_space; - -/* - ::= -*/ -right_operand - integer; - -/* - ::= * - | * - | * - | ".true" * - | ".false" * - | ".debug" * - | * -*/ -specifier_rule - specifier_rule_1 .and optional_error .and .loop emit .and .true .emit EMIT_NULL; -specifier_rule_1 - character_range .emit SPECIFIER_CHARACTER_RANGE .or - character .emit SPECIFIER_CHARACTER .or - string_ne .emit SPECIFIER_STRING .or - ".true" .emit SPECIFIER_TRUE .or - ".false" .emit SPECIFIER_FALSE .or - ".debug" .emit SPECIFIER_DEBUG .or - advanced_identifier .emit SPECIFIER_IDENTIFIER; - -/* - ::= "\'" ::= - | - | "\"" -*/ -string_char_single_quotes - escape_sequence .or string_char .emit * .or '"' .emit *; - -/* - ::= "-" -*/ -character_range - character .and optional_space .and '-' .and optional_space .and character; - -/* - ::= -*/ -advanced_identifier - optional_loop .and identifier; - -/* - ::= ".loop" - | "" -*/ -optional_loop - optional_loop_1 .emit IDENTIFIER_LOOP .or .true .emit IDENTIFIER_SIMPLE; -optional_loop_1 - ".loop" .and space; - -/* - ::= - | "" -*/ -optional_error - error .emit ERROR_PRESENT .or .true .emit ERROR_NOT_PRESENT; - -/* - :: ".error" -*/ -error - space .and ".error" .and space .and identifier; - -/* - ::= - | -*/ -emit - emit_output .or emit_regbyte; - -/* - ::= ".emit" -*/ -emit_output - space .and ".emit" .and space .and emit_param; - -/* - ::= - | - | - | "*" - | "$" -*/ -emit_param - integer_ne .emit EMIT_INTEGER .or - identifier_ne .emit EMIT_IDENTIFIER .or - character .emit EMIT_CHARACTER .or - '*' .emit EMIT_LAST_CHARACTER .or - '$' .emit EMIT_CURRENT_POSITION; - -/* - ::= ".load" -*/ -emit_regbyte - space .and ".load" .and space .and identifier .and space .and emit_param; - -/* - ::= * -*/ -and_specifiers - and_specifier .and .loop and_specifier; - -/* - ::= * -*/ -or_specifiers - or_specifier .and .loop or_specifier; - -/* - ::= ".and" -*/ -and_specifier - space .and ".and" .and space .and specifier; - -/* - ::= ".or" -*/ -or_specifier - space .and ".or" .and space .and specifier; - - -.string __string_filter; - -/* - <__string_filter> ::= <__first_identifier_char> <__next_identifier_char>* -*/ -__string_filter - __first_identifier_char .and .loop __next_identifier_char; - -/* - <__first_identifier_char> ::= "a"-"z" - | "A"-"Z" - | "_" - | "." -*/ -__first_identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '.'; - -/* - <__next_identifier_char> ::= "a"-"z" - | "A"-"Z" - | "_" - | "0"-"9" -*/ -__next_identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/mesalib/src/mesa/shader/lex.yy.c b/mesalib/src/mesa/shader/lex.yy.c index fefef573e..68543ae2e 100644 --- a/mesalib/src/mesa/shader/lex.yy.c +++ b/mesalib/src/mesa/shader/lex.yy.c @@ -53,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -157,7 +158,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -348,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 183 -#define YY_END_OF_BUFFER 184 +#define YY_NUM_RULES 170 +#define YY_END_OF_BUFFER 171 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -357,82 +366,101 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[675] = +static yyconst flex_int16_t yy_accept[850] = { 0, - 0, 0, 184, 182, 180, 179, 182, 182, 152, 178, - 154, 154, 154, 154, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 180, 0, 0, 181, 152, 0, - 153, 155, 175, 175, 0, 0, 0, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 132, 176, 133, 134, - 166, 166, 166, 166, 0, 154, 0, 140, 141, 142, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 173, 0, 0, 0, + 0, 0, 171, 169, 167, 166, 169, 169, 139, 165, + 141, 141, 141, 141, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 167, 0, 0, 168, 139, + 0, 140, 142, 162, 162, 0, 0, 0, 0, 162, + 0, 0, 0, 0, 0, 0, 0, 119, 163, 120, + 121, 153, 153, 153, 153, 0, 141, 0, 127, 128, + 129, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 163, 163, 163, 164, 164, 165, 156, - 155, 156, 0, 157, 11, 13, 152, 15, 152, 152, - 16, 18, 152, 20, 22, 24, 26, 6, 28, 30, - 31, 33, 35, 38, 36, 40, 41, 43, 45, 47, - - 49, 51, 152, 152, 152, 53, 55, 152, 57, 59, - 61, 152, 63, 65, 67, 69, 152, 71, 73, 75, - 77, 152, 152, 152, 152, 152, 152, 0, 0, 0, - 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 93, 94, 96, 0, 171, 0, 0, 0, - 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 170, 169, 169, 122, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 160, 160, - 161, 162, 0, 158, 152, 152, 152, 152, 152, 152, - 152, 152, 143, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 144, 152, 152, 152, 152, 152, 152, - 152, 152, 10, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 0, 177, 0, 0, 0, 86, 87, - 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, + 159, 159, 159, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 150, 150, 151, 151, 152, 143, + 142, 143, 0, 144, 11, 12, 139, 13, 139, 139, + 14, 15, 139, 16, 17, 18, 19, 20, 21, 6, + + 22, 23, 24, 25, 26, 28, 27, 29, 30, 31, + 32, 33, 34, 35, 139, 139, 139, 139, 139, 40, + 41, 139, 42, 43, 44, 45, 46, 47, 48, 139, + 49, 50, 51, 52, 53, 54, 55, 139, 56, 57, + 58, 59, 139, 139, 64, 65, 139, 139, 139, 139, + 139, 139, 0, 0, 0, 0, 142, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 80, 81, 83, + 0, 158, 0, 0, 0, 0, 0, 0, 97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 156, 156, 109, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 147, 147, 148, 149, 0, 145, 11, + 11, 139, 12, 12, 12, 139, 139, 139, 139, 139, + 15, 15, 139, 130, 16, 16, 139, 17, 17, 139, + 18, 18, 139, 19, 19, 139, 20, 20, 139, 21, + 21, 139, 22, 22, 139, 24, 24, 139, 25, 25, + 139, 28, 28, 139, 27, 27, 139, 30, 30, 139, + 31, 31, 139, 32, 32, 139, 33, 33, 139, 34, + 34, 139, 35, 35, 139, 139, 139, 139, 36, 139, + 38, 139, 40, 40, 139, 41, 41, 139, 131, 42, + 42, 139, 43, 43, 139, 139, 45, 45, 139, 46, + + 46, 139, 47, 47, 139, 48, 48, 139, 139, 49, + 49, 139, 50, 50, 139, 51, 51, 139, 52, 52, + 139, 53, 53, 139, 54, 54, 139, 139, 10, 56, + 139, 57, 139, 58, 139, 59, 139, 60, 139, 62, + 139, 64, 64, 139, 139, 139, 139, 139, 139, 139, + 139, 0, 164, 0, 0, 0, 73, 74, 0, 0, + 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, - 126, 0, 128, 0, 0, 0, 0, 0, 0, 167, - 159, 152, 152, 152, 4, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 9, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 82, 152, 152, 0, 0, 0, - 0, 0, 88, 89, 0, 0, 0, 0, 97, 0, - 0, 101, 104, 0, 0, 0, 0, 0, 0, 0, - 115, 116, 0, 0, 0, 0, 121, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 152, 152, 152, - 152, 152, 152, 5, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 7, 8, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 83, - 152, 79, 0, 0, 0, 0, 137, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 107, 0, 111, 112, - 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 130, 131, 0, 0, 138, 12, 3, 14, - 148, 149, 152, 17, 19, 21, 23, 25, 27, 29, - 32, 34, 39, 37, 42, 44, 46, 48, 50, 52, - 54, 56, 58, 60, 62, 152, 152, 152, 64, 66, - 68, 70, 72, 74, 76, 78, 152, 81, 139, 0, - 0, 84, 0, 90, 0, 0, 0, 99, 0, 0, - - 0, 0, 0, 0, 113, 0, 0, 119, 106, 0, - 0, 0, 0, 0, 0, 135, 0, 152, 145, 146, - 152, 80, 0, 0, 0, 0, 92, 95, 100, 0, - 0, 105, 0, 0, 0, 118, 0, 0, 0, 0, - 127, 129, 0, 152, 152, 2, 1, 0, 91, 0, - 103, 0, 109, 117, 0, 0, 124, 125, 136, 152, - 147, 0, 102, 0, 120, 123, 152, 85, 108, 152, - 152, 150, 151, 0 + 0, 0, 0, 0, 155, 0, 0, 0, 113, 0, + 115, 0, 0, 0, 0, 0, 0, 154, 146, 139, + + 139, 139, 4, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 9, 37, 39, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 60, 139, 61, 62, 139, 63, 139, 139, 139, 139, + 139, 69, 139, 139, 0, 0, 0, 0, 0, 75, + 76, 0, 0, 0, 0, 84, 0, 0, 88, 91, + 0, 0, 0, 0, 0, 0, 0, 102, 103, 0, + 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 139, 139, 139, 139, 139, 139, + 5, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 7, 8, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 61, 139, 139, 63, 139, 139, + 139, 139, 139, 70, 139, 66, 0, 0, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 94, 0, 98, 99, 0, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 117, 118, 0, 0, + + 125, 11, 3, 12, 135, 136, 139, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 24, 25, 28, 27, + 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 139, 139, 139, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 139, + 139, 139, 139, 64, 65, 139, 68, 126, 0, 0, + 71, 0, 77, 0, 0, 0, 86, 0, 0, 0, + 0, 0, 0, 100, 0, 0, 106, 93, 0, 0, + 0, 0, 0, 0, 122, 0, 139, 132, 133, 139, + 60, 139, 62, 139, 67, 0, 0, 0, 0, 79, + + 82, 87, 0, 0, 92, 0, 0, 0, 105, 0, + 0, 0, 0, 114, 116, 0, 139, 139, 61, 63, + 2, 1, 0, 78, 0, 90, 0, 96, 104, 0, + 0, 111, 112, 123, 139, 134, 0, 89, 0, 107, + 110, 139, 72, 95, 139, 139, 137, 138, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -478,280 +506,357 @@ static yyconst flex_int32_t yy_meta[68] = 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[678] = +static yyconst flex_int16_t yy_base[853] = { 0, - 0, 0, 954, 955, 66, 955, 948, 949, 0, 69, - 85, 128, 140, 152, 151, 58, 39, 48, 75, 927, - 158, 160, 73, 59, 71, 170, 54, 920, 890, 889, - 901, 885, 899, 898, 142, 927, 939, 955, 0, 206, - 955, 189, 168, 171, 53, 27, 66, 119, 175, 899, - 885, 123, 170, 883, 895, 183, 955, 198, 225, 99, - 212, 219, 223, 227, 285, 297, 308, 955, 955, 955, - 904, 917, 911, 165, 900, 903, 899, 914, 224, 896, - 910, 194, 896, 909, 900, 913, 890, 901, 892, 294, - 893, 884, 893, 884, 883, 884, 878, 884, 895, 881, - - 878, 890, 893, 880, 873, 889, 865, 193, 139, 885, - 861, 846, 841, 858, 834, 839, 865, 167, 854, 259, - 849, 325, 282, 851, 832, 302, 842, 838, 833, 43, - 839, 825, 841, 838, 829, 305, 309, 831, 820, 834, - 837, 819, 834, 821, 818, 825, 275, 833, 254, 299, - 317, 327, 331, 810, 827, 828, 821, 803, 310, 804, - 826, 817, 316, 327, 331, 335, 339, 343, 347, 955, - 405, 416, 422, 428, 825, 240, 849, 0, 848, 831, - 821, 820, 840, 818, 817, 816, 815, 0, 814, 0, - 813, 812, 0, 811, 810, 0, 809, 808, 807, 806, - - 805, 804, 820, 813, 826, 800, 799, 805, 797, 796, - 795, 816, 793, 792, 791, 790, 800, 788, 787, 786, - 785, 777, 776, 761, 761, 760, 759, 802, 774, 762, - 434, 442, 416, 766, 186, 763, 757, 757, 751, 764, - 764, 749, 955, 955, 764, 752, 418, 759, 281, 756, - 762, 308, 757, 955, 748, 755, 754, 757, 743, 742, - 746, 741, 278, 746, 420, 428, 430, 955, 738, 736, - 736, 744, 745, 727, 421, 732, 738, 419, 426, 430, - 434, 438, 496, 502, 752, 764, 750, 749, 742, 756, - 746, 745, 0, 744, 743, 742, 741, 740, 739, 738, - - 737, 736, 735, 734, 733, 732, 731, 730, 733, 726, - 733, 726, 725, 0, 724, 723, 722, 725, 720, 719, - 718, 717, 0, 716, 715, 714, 713, 691, 685, 690, - 696, 679, 694, 315, 955, 693, 683, 687, 955, 955, - 677, 686, 672, 689, 672, 675, 669, 955, 670, 669, - 666, 673, 666, 674, 670, 680, 677, 659, 665, 672, - 656, 655, 673, 655, 667, 666, 955, 665, 655, 659, - 955, 646, 955, 651, 651, 659, 642, 643, 653, 955, - 955, 685, 667, 683, 0, 507, 681, 681, 680, 679, - 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, - - 668, 667, 666, 665, 652, 645, 0, 662, 661, 660, - 659, 658, 636, 656, 655, 654, 653, 652, 651, 650, - 649, 618, 621, 601, 0, 602, 595, 602, 601, 602, - 594, 612, 955, 955, 594, 592, 602, 595, 955, 590, - 607, 330, 955, 598, 582, 583, 592, 583, 582, 582, - 955, 581, 590, 580, 596, 593, 955, 592, 590, 579, - 580, 576, 568, 575, 570, 571, 566, 592, 592, 590, - 604, 603, 598, 0, 586, 585, 584, 583, 582, 581, - 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, - 570, 0, 0, 569, 568, 567, 566, 565, 509, 564, - - 563, 562, 561, 560, 559, 558, 557, 535, 535, 0, - 542, 0, 576, 575, 524, 542, 955, 537, 532, 525, - 521, 533, 523, 521, 517, 533, 524, 523, 955, 955, - 526, 955, 521, 514, 503, 514, 506, 510, 523, 518, - 521, 503, 955, 955, 515, 504, 955, 0, 0, 0, - 0, 0, 543, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1299, 1300, 66, 1300, 1293, 1294, 0, 69, + 85, 128, 140, 152, 151, 58, 56, 63, 76, 1272, + 158, 160, 39, 163, 173, 189, 52, 1265, 76, 1235, + 1234, 1246, 1230, 1244, 1243, 105, 1272, 1284, 1300, 0, + 225, 1300, 218, 160, 157, 20, 123, 66, 119, 192, + 1244, 1230, 54, 162, 1228, 1240, 194, 1300, 200, 195, + 98, 227, 196, 231, 235, 293, 305, 316, 1300, 1300, + 1300, 1249, 1262, 1256, 223, 1245, 1248, 1244, 1259, 107, + 298, 1241, 1255, 246, 1241, 1254, 1245, 1258, 1235, 1246, + 1237, 182, 1238, 1229, 1238, 1229, 1228, 1229, 144, 1223, + + 1229, 1240, 1231, 1225, 1222, 1223, 1227, 289, 1236, 1223, + 302, 1230, 1217, 1231, 1207, 65, 315, 276, 1227, 1226, + 1202, 1187, 1182, 1199, 1175, 1180, 1206, 279, 1195, 293, + 1190, 342, 299, 1192, 1173, 317, 1183, 1179, 1174, 207, + 1180, 1166, 1182, 1179, 1170, 320, 324, 1172, 1161, 1175, + 1178, 1160, 1175, 1162, 1159, 1166, 284, 1174, 227, 288, + 327, 342, 345, 1151, 1168, 1169, 1162, 1144, 318, 1145, + 1167, 1158, 330, 341, 345, 349, 353, 357, 361, 1300, + 419, 430, 436, 442, 440, 441, 1191, 0, 1190, 1173, + 1163, 443, 1183, 444, 451, 468, 470, 472, 471, 0, + + 496, 0, 497, 498, 0, 499, 500, 0, 524, 525, + 526, 536, 537, 553, 1178, 1171, 1184, 354, 356, 561, + 563, 1165, 564, 565, 1157, 580, 590, 591, 592, 1178, + 593, 617, 618, 619, 629, 630, 1155, 1165, 330, 362, + 419, 483, 445, 364, 646, 1153, 1145, 1144, 1129, 1129, + 1128, 1127, 1170, 1142, 1130, 662, 669, 643, 1134, 487, + 1131, 1125, 1125, 1119, 1132, 1132, 1117, 1300, 1300, 1132, + 1120, 646, 1127, 135, 1124, 1130, 561, 1125, 1300, 1116, + 1123, 1122, 1125, 1111, 1110, 1114, 1109, 448, 1114, 650, + 653, 665, 1300, 1106, 1104, 1104, 1112, 1113, 1095, 670, + + 1100, 1106, 486, 579, 655, 661, 668, 726, 732, 1112, + 682, 1119, 1110, 688, 730, 1117, 1116, 1109, 1123, 1113, + 1104, 712, 1111, 0, 1102, 731, 1109, 1100, 733, 1107, + 1098, 734, 1105, 1096, 736, 1103, 1094, 737, 1101, 1092, + 738, 1099, 1090, 739, 1097, 1088, 740, 1095, 1086, 741, + 1093, 1084, 742, 1091, 1082, 743, 1089, 1080, 744, 1087, + 1078, 745, 1085, 1076, 746, 1083, 1074, 747, 1081, 1072, + 748, 1079, 1070, 749, 1077, 1080, 1073, 1080, 0, 1073, + 0, 1088, 1063, 750, 1070, 1061, 751, 1068, 0, 1059, + 752, 1066, 1057, 755, 1064, 1063, 1054, 758, 1061, 1052, + + 776, 1059, 1050, 777, 1057, 1048, 779, 1055, 1058, 1045, + 780, 1052, 1043, 782, 1050, 1041, 783, 1048, 1039, 784, + 1046, 1037, 785, 1044, 1035, 786, 1042, 1041, 0, 1032, + 1039, 1030, 1037, 1028, 1035, 1026, 1033, 787, 1032, 788, + 1047, 1022, 789, 1029, 1028, 1006, 1000, 1005, 1011, 994, + 1009, 424, 1300, 1008, 998, 1002, 1300, 1300, 992, 1001, + 987, 1004, 987, 990, 984, 1300, 985, 984, 981, 988, + 981, 989, 985, 995, 992, 974, 980, 987, 971, 970, + 988, 970, 982, 981, 1300, 980, 970, 974, 1300, 961, + 1300, 966, 966, 974, 957, 958, 968, 1300, 1300, 1000, + + 982, 998, 0, 798, 996, 996, 995, 994, 993, 992, + 991, 990, 989, 988, 987, 986, 985, 984, 983, 982, + 981, 980, 979, 978, 965, 958, 0, 0, 0, 975, + 974, 973, 972, 971, 970, 969, 968, 967, 945, 965, + 964, 963, 962, 961, 960, 959, 958, 957, 956, 955, + 929, 936, 793, 927, 934, 794, 950, 949, 918, 921, + 901, 0, 902, 895, 902, 901, 902, 894, 912, 1300, + 1300, 894, 892, 902, 895, 1300, 890, 907, 516, 1300, + 898, 882, 883, 892, 883, 882, 882, 1300, 881, 890, + 880, 896, 893, 1300, 892, 890, 879, 880, 876, 868, + + 875, 870, 871, 866, 892, 892, 890, 904, 903, 898, + 0, 886, 885, 884, 883, 882, 881, 880, 879, 878, + 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, + 0, 0, 867, 866, 865, 864, 863, 862, 861, 860, + 859, 804, 858, 857, 856, 855, 854, 853, 852, 851, + 850, 849, 848, 865, 839, 846, 862, 836, 843, 841, + 840, 818, 818, 0, 825, 0, 859, 858, 807, 825, + 1300, 820, 815, 808, 804, 816, 806, 804, 800, 816, + 807, 806, 1300, 1300, 809, 1300, 804, 797, 786, 797, + 789, 793, 806, 801, 804, 786, 1300, 1300, 798, 787, + + 1300, 0, 0, 0, 0, 0, 826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 539, 538, 536, 0, 0, - 0, 0, 0, 0, 0, 0, 494, 0, 0, 545, - 544, 955, 491, 955, 495, 495, 504, 955, 488, 502, - - 483, 485, 482, 490, 955, 468, 479, 955, 955, 483, - 479, 472, 470, 470, 483, 955, 467, 507, 0, 0, - 507, 0, 514, 513, 472, 433, 955, 955, 955, 435, - 435, 955, 429, 386, 377, 955, 366, 365, 323, 328, - 955, 955, 339, 348, 337, 955, 955, 307, 955, 305, - 955, 257, 955, 955, 247, 221, 955, 955, 955, 236, - 0, 213, 955, 150, 955, 955, 232, 955, 955, 162, - 138, 0, 0, 955, 541, 108, 544 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 814, 813, 802, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, + 798, 779, 792, 0, 0, 656, 0, 0, 706, 702, + 1300, 649, 1300, 648, 648, 654, 1300, 637, 645, 610, + 612, 608, 608, 1300, 572, 583, 1300, 1300, 577, 573, + 560, 557, 542, 555, 1300, 539, 573, 0, 0, 572, + 0, 555, 0, 546, 0, 562, 551, 495, 479, 1300, + + 1300, 1300, 481, 481, 1300, 480, 443, 31, 1300, 141, + 166, 171, 186, 1300, 1300, 211, 236, 276, 0, 0, + 1300, 1300, 290, 1300, 325, 1300, 346, 1300, 1300, 343, + 341, 1300, 1300, 1300, 365, 0, 380, 1300, 371, 1300, + 1300, 486, 1300, 1300, 451, 458, 0, 0, 1300, 836, + 503, 839 } ; -static yyconst flex_int16_t yy_def[678] = +static yyconst flex_int16_t yy_def[853] = { 0, - 674, 1, 674, 674, 674, 674, 674, 675, 676, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 674, 674, 675, 674, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 677, 674, 674, 674, 674, 674, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 676, 676, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 676, - 676, 674, 674, 674, 674, 674, 676, 674, 674, 676, - 676, 676, 676, 0, 674, 674, 674 + 849, 1, 849, 849, 849, 849, 849, 850, 851, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 850, 849, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 852, 849, 849, 849, 849, + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 849, 849, 849, 849, + 849, 851, 849, 849, 851, 851, 851, 851, 0, 849, + 849, 849 } ; -static yyconst flex_int16_t yy_nxt[1023] = +static yyconst flex_int16_t yy_nxt[1368] = { 0, 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, 9, 9, 9, 20, 21, 22, 9, 23, 24, - 9, 25, 26, 27, 9, 9, 9, 28, 9, 9, - 9, 9, 9, 9, 9, 9, 29, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 30, 9, 31, 32, - 33, 9, 34, 9, 9, 9, 9, 35, 79, 35, - 40, 80, 129, 108, 96, 81, 130, 41, 42, 42, - 42, 42, 42, 42, 76, 82, 77, 97, 98, 240, - 99, 109, 78, 65, 66, 66, 66, 66, 66, 66, - - 83, 241, 94, 100, 67, 127, 84, 95, 128, 39, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 131, - 132, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 67, 133, 61, 62, 63, 64, 65, 66, 66, 66, - 66, 66, 66, 35, 160, 35, 68, 67, 65, 66, - 66, 66, 66, 66, 66, 219, 673, 161, 69, 67, - 65, 66, 66, 66, 66, 66, 66, 71, 220, 72, - 70, 67, 140, 67, 134, 90, 73, 135, 141, 86, - 672, 87, 74, 91, 75, 67, 88, 101, 92, 89, - 178, 102, 103, 104, 93, 105, 179, 67, 42, 42, - - 42, 42, 42, 42, 106, 189, 107, 40, 122, 123, - 123, 142, 126, 123, 669, 123, 136, 137, 123, 217, - 124, 124, 123, 190, 147, 143, 123, 125, 125, 123, - 218, 337, 144, 123, 122, 148, 184, 185, 149, 151, - 152, 150, 670, 671, 338, 153, 186, 118, 119, 45, - 46, 47, 48, 154, 50, 51, 123, 162, 52, 53, - 54, 55, 56, 57, 120, 59, 60, 668, 155, 121, - 156, 286, 667, 157, 158, 163, 163, 163, 163, 666, - 287, 159, 164, 163, 165, 166, 167, 163, 163, 168, - 169, 163, 163, 163, 171, 171, 171, 171, 171, 171, - - 230, 665, 664, 260, 172, 65, 66, 66, 66, 66, - 66, 66, 198, 261, 154, 173, 67, 174, 174, 174, - 174, 174, 174, 233, 233, 364, 349, 257, 365, 233, - 172, 199, 231, 258, 232, 232, 232, 232, 232, 232, - 233, 350, 67, 233, 233, 236, 233, 233, 262, 233, - 247, 233, 233, 353, 263, 273, 233, 663, 233, 233, - 233, 428, 662, 233, 233, 274, 354, 233, 265, 233, - 661, 264, 266, 267, 233, 233, 660, 429, 233, 278, - 278, 278, 278, 524, 659, 233, 525, 658, 657, 233, - 278, 278, 278, 278, 279, 278, 278, 280, 281, 278, - - 278, 278, 278, 278, 278, 278, 282, 278, 278, 278, - 278, 278, 278, 278, 42, 42, 42, 42, 42, 42, - 656, 655, 654, 283, 122, 284, 284, 284, 284, 284, - 284, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 232, 232, 232, 232, 232, 232, 653, - 122, 232, 232, 232, 232, 232, 232, 335, 335, 335, - 335, 335, 335, 335, 374, 335, 375, 335, 376, 335, - 335, 367, 335, 652, 335, 335, 335, 335, 335, 651, - 650, 377, 380, 380, 380, 380, 335, 649, 335, 380, - 380, 380, 380, 381, 380, 380, 380, 380, 380, 380, - - 380, 380, 380, 380, 380, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 471, 472, 576, - 577, 648, 647, 646, 645, 644, 643, 642, 641, 640, - 639, 638, 637, 636, 635, 634, 633, 632, 631, 473, - 578, 37, 37, 37, 170, 170, 630, 629, 628, 627, - 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, - 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, - 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, - 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 575, 574, - - 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, - 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, - 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, - 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 532, 531, 530, 529, 528, 527, 526, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, - 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, - 481, 480, 479, 478, 477, 476, 475, 474, 470, 469, - - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - 386, 385, 384, 383, 382, 379, 378, 373, 372, 371, - 370, 369, 368, 366, 363, 362, 361, 360, 359, 358, - - 357, 356, 355, 352, 351, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 336, 264, 236, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 285, 277, 276, 275, 272, - 271, 270, 269, 268, 259, 256, 255, 254, 253, 252, - 251, 250, 249, 248, 246, 245, 244, 243, 242, 239, - 238, 237, 235, 234, 162, 229, 228, 227, 226, 225, - - 224, 223, 222, 221, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, - 200, 197, 196, 195, 194, 193, 192, 191, 188, 187, - 183, 182, 181, 180, 177, 176, 175, 146, 145, 139, - 138, 38, 117, 116, 115, 114, 113, 112, 111, 110, - 85, 38, 36, 674, 3, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 9, 25, 26, 27, 28, 9, 9, 29, 9, 9, + 9, 9, 9, 9, 9, 9, 30, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 31, 9, 32, 33, + 34, 9, 35, 9, 9, 9, 9, 36, 96, 36, + 41, 116, 137, 97, 80, 138, 829, 42, 43, 43, + 43, 43, 43, 43, 77, 81, 78, 119, 82, 117, + 83, 238, 79, 66, 67, 67, 67, 67, 67, 67, + + 84, 85, 239, 150, 68, 120, 36, 86, 36, 151, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 141, + 142, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 68, 143, 62, 63, 64, 65, 66, 67, 67, 67, + 67, 67, 67, 170, 194, 195, 69, 68, 66, 67, + 67, 67, 67, 67, 67, 218, 171, 219, 70, 68, + 66, 67, 67, 67, 67, 67, 67, 72, 139, 73, + 71, 68, 140, 68, 144, 92, 74, 145, 98, 88, + 467, 89, 75, 93, 76, 68, 90, 99, 94, 91, + 101, 100, 102, 103, 95, 468, 830, 68, 136, 133, + + 210, 133, 133, 152, 133, 104, 105, 133, 106, 107, + 108, 109, 110, 134, 111, 133, 112, 153, 133, 211, + 135, 831, 113, 114, 154, 115, 41, 43, 43, 43, + 43, 43, 43, 146, 147, 157, 832, 132, 165, 133, + 166, 161, 162, 167, 168, 833, 158, 163, 188, 159, + 133, 169, 160, 265, 189, 164, 834, 201, 133, 174, + 173, 175, 176, 132, 835, 266, 128, 129, 46, 47, + 48, 49, 172, 51, 52, 202, 285, 53, 54, 55, + 56, 57, 58, 130, 60, 61, 286, 243, 131, 244, + 173, 173, 173, 173, 177, 173, 173, 178, 179, 173, + + 173, 173, 181, 181, 181, 181, 181, 181, 228, 836, + 196, 197, 182, 66, 67, 67, 67, 67, 67, 67, + 198, 232, 229, 183, 68, 184, 184, 184, 184, 184, + 184, 240, 134, 241, 255, 233, 282, 287, 182, 135, + 258, 258, 283, 288, 242, 837, 258, 430, 164, 256, + 68, 257, 257, 257, 257, 257, 257, 258, 258, 258, + 261, 258, 258, 298, 258, 272, 258, 258, 258, 258, + 431, 258, 381, 299, 258, 258, 379, 838, 258, 432, + 440, 289, 258, 290, 258, 258, 291, 292, 380, 258, + 382, 839, 258, 303, 303, 303, 303, 840, 441, 841, + + 258, 842, 433, 258, 303, 303, 303, 303, 304, 303, + 303, 305, 306, 303, 303, 303, 303, 303, 303, 303, + 307, 303, 303, 303, 303, 303, 303, 303, 43, 43, + 43, 43, 43, 43, 843, 844, 434, 308, 132, 309, + 309, 309, 309, 309, 309, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 310, 313, 435, + 321, 325, 311, 314, 132, 322, 326, 438, 328, 847, + 565, 311, 315, 329, 322, 326, 848, 311, 314, 439, + 312, 316, 329, 323, 327, 331, 566, 334, 340, 337, + 332, 330, 335, 341, 338, 482, 845, 846, 483, 332, + + 436, 335, 341, 338, 40, 332, 828, 335, 333, 338, + 336, 342, 339, 343, 346, 349, 352, 355, 344, 347, + 350, 353, 356, 437, 827, 826, 825, 344, 347, 350, + 353, 356, 455, 824, 347, 350, 345, 348, 351, 354, + 357, 358, 361, 364, 823, 456, 359, 362, 365, 498, + 498, 498, 498, 367, 370, 359, 362, 365, 368, 371, + 822, 359, 362, 365, 360, 363, 366, 368, 371, 678, + 373, 821, 679, 368, 371, 374, 369, 372, 383, 820, + 386, 390, 393, 384, 374, 387, 391, 394, 819, 818, + 374, 817, 384, 375, 387, 391, 394, 397, 816, 815, + + 814, 385, 398, 388, 392, 395, 471, 400, 403, 406, + 410, 398, 401, 404, 407, 411, 813, 398, 812, 472, + 399, 401, 404, 407, 411, 811, 810, 401, 404, 407, + 402, 405, 408, 412, 413, 416, 419, 809, 808, 414, + 417, 420, 498, 498, 498, 498, 422, 425, 414, 417, + 420, 423, 426, 807, 414, 417, 420, 415, 418, 421, + 423, 426, 806, 442, 805, 804, 423, 426, 443, 424, + 427, 257, 257, 257, 257, 257, 257, 443, 257, 257, + 257, 257, 257, 257, 453, 453, 444, 453, 453, 803, + 453, 453, 453, 453, 453, 453, 802, 453, 801, 310, + + 453, 453, 800, 799, 453, 313, 485, 453, 453, 798, + 797, 453, 453, 492, 796, 493, 795, 494, 499, 498, + 498, 498, 312, 453, 498, 498, 498, 498, 316, 321, + 495, 498, 498, 498, 498, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 313, 325, 501, + 328, 331, 323, 334, 337, 340, 343, 346, 349, 352, + 355, 358, 361, 364, 367, 370, 373, 383, 386, 390, + 316, 327, 393, 330, 333, 397, 336, 339, 342, 345, + 348, 351, 354, 357, 360, 363, 366, 369, 372, 375, + 385, 388, 392, 400, 403, 395, 406, 410, 399, 413, + + 416, 419, 422, 425, 551, 554, 442, 794, 608, 609, + 655, 658, 793, 792, 736, 737, 402, 405, 791, 408, + 412, 790, 415, 418, 421, 424, 427, 552, 555, 444, + 610, 789, 788, 656, 659, 738, 38, 38, 38, 180, + 180, 787, 786, 785, 784, 783, 782, 781, 780, 779, + 778, 777, 776, 775, 774, 773, 772, 771, 770, 769, + 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, + 758, 757, 756, 755, 754, 753, 659, 752, 751, 656, + 750, 749, 748, 747, 746, 745, 744, 743, 742, 741, + 740, 739, 735, 734, 733, 732, 731, 730, 729, 728, + + 727, 726, 725, 724, 723, 722, 721, 720, 719, 718, + 717, 716, 715, 714, 713, 712, 711, 710, 709, 708, + 707, 706, 705, 704, 703, 702, 701, 700, 699, 698, + 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, + 687, 686, 685, 684, 683, 682, 681, 680, 677, 676, + 675, 674, 673, 672, 671, 670, 669, 668, 667, 666, + 665, 664, 663, 662, 661, 660, 657, 555, 654, 552, + 653, 652, 651, 650, 649, 648, 647, 646, 645, 644, + 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, + 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, + 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, + 570, 569, 568, 567, 564, 563, 562, 561, 560, 559, + 558, 557, 444, 556, 553, 550, 437, 549, 435, 548, + 433, 547, 431, 546, 545, 427, 544, 424, 543, 421, + 542, 418, 541, 415, 540, 412, 539, 538, 408, 537, + 405, 536, 402, 535, 399, 534, 533, 395, 532, 392, + + 531, 388, 530, 385, 529, 528, 527, 526, 525, 524, + 375, 523, 372, 522, 369, 521, 366, 520, 363, 519, + 360, 518, 357, 517, 354, 516, 351, 515, 348, 514, + 345, 513, 342, 512, 339, 511, 336, 510, 333, 509, + 330, 508, 327, 507, 323, 506, 505, 504, 503, 502, + 316, 500, 312, 497, 496, 491, 490, 489, 488, 487, + 486, 484, 481, 480, 479, 478, 477, 476, 475, 474, + 473, 470, 469, 466, 465, 464, 463, 462, 461, 460, + 459, 458, 457, 454, 289, 261, 452, 451, 450, 449, + 448, 447, 446, 445, 429, 428, 409, 396, 389, 378, + + 377, 376, 324, 320, 319, 318, 317, 302, 301, 300, + 297, 296, 295, 294, 293, 284, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 271, 270, 269, 268, 267, + 264, 263, 262, 260, 259, 172, 254, 253, 252, 251, + 250, 249, 248, 247, 246, 245, 237, 236, 235, 234, + 231, 230, 227, 226, 225, 224, 223, 222, 221, 220, + 217, 216, 215, 214, 213, 212, 209, 208, 207, 206, + 205, 204, 203, 200, 199, 193, 192, 191, 190, 187, + 186, 185, 156, 155, 149, 148, 39, 127, 126, 125, + 124, 123, 122, 121, 118, 87, 39, 37, 849, 3, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; -static yyconst flex_int16_t yy_chk[1023] = +static yyconst flex_int16_t yy_chk[1368] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -759,113 +864,150 @@ static yyconst flex_int16_t yy_chk[1023] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 17, 5, - 10, 17, 46, 27, 24, 18, 46, 10, 10, 10, - 10, 10, 10, 10, 16, 18, 16, 24, 25, 130, - 25, 27, 16, 11, 11, 11, 11, 11, 11, 11, - - 19, 130, 23, 25, 11, 45, 19, 23, 45, 676, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 47, - 47, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 47, 10, 10, 10, 10, 12, 12, 12, 12, - 12, 12, 12, 35, 60, 35, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 109, 671, 60, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 15, 109, 15, - 14, 14, 52, 12, 48, 22, 15, 48, 52, 21, - 670, 21, 15, 22, 15, 13, 21, 26, 22, 21, - 74, 26, 26, 26, 22, 26, 74, 14, 42, 42, - - 42, 42, 42, 42, 26, 82, 26, 40, 42, 43, - 43, 53, 44, 44, 664, 43, 49, 49, 44, 108, - 118, 43, 49, 82, 56, 53, 43, 118, 43, 44, - 108, 235, 53, 49, 42, 56, 79, 79, 56, 58, - 58, 56, 667, 667, 235, 58, 79, 40, 40, 40, - 40, 40, 40, 58, 40, 40, 58, 61, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 662, 59, 40, - 59, 176, 660, 59, 59, 61, 61, 61, 61, 656, - 176, 59, 62, 62, 62, 62, 63, 63, 63, 63, - 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, - - 120, 655, 652, 149, 65, 66, 66, 66, 66, 66, - 66, 66, 90, 149, 120, 67, 66, 67, 67, 67, - 67, 67, 67, 123, 123, 263, 249, 147, 263, 123, - 65, 90, 122, 147, 122, 122, 122, 122, 122, 122, - 123, 249, 66, 126, 126, 126, 136, 136, 150, 126, - 137, 137, 136, 252, 150, 159, 137, 650, 151, 151, - 126, 334, 648, 136, 151, 159, 252, 137, 152, 152, - 645, 151, 153, 153, 152, 151, 644, 334, 153, 163, - 163, 163, 163, 442, 643, 152, 442, 640, 639, 153, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 166, - - 166, 166, 167, 167, 167, 167, 168, 168, 168, 168, - 169, 169, 169, 169, 171, 171, 171, 171, 171, 171, - 638, 637, 635, 172, 171, 172, 172, 172, 172, 172, - 172, 173, 173, 173, 173, 173, 173, 174, 174, 174, - 174, 174, 174, 231, 231, 231, 231, 231, 231, 634, - 171, 232, 232, 232, 232, 232, 232, 233, 233, 247, - 247, 265, 265, 233, 275, 247, 275, 265, 275, 266, - 266, 267, 267, 633, 233, 266, 247, 267, 265, 631, - 630, 275, 278, 278, 278, 278, 266, 626, 267, 279, - 279, 279, 279, 280, 280, 280, 280, 281, 281, 281, - - 281, 282, 282, 282, 282, 283, 283, 283, 283, 283, - 283, 284, 284, 284, 284, 284, 284, 386, 386, 499, - 499, 625, 624, 623, 621, 618, 617, 615, 614, 613, - 612, 611, 610, 607, 606, 604, 603, 602, 601, 386, - 499, 675, 675, 675, 677, 677, 600, 599, 597, 596, - 595, 593, 591, 590, 587, 578, 577, 576, 553, 546, - 545, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 531, 528, 527, 526, 525, 524, 523, 522, 521, - 520, 519, 518, 516, 515, 514, 513, 511, 509, 508, - 507, 506, 505, 504, 503, 502, 501, 500, 498, 497, - - 496, 495, 494, 491, 490, 489, 488, 487, 486, 485, - 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, - 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 456, 455, 454, 453, - 452, 450, 449, 448, 447, 446, 445, 444, 441, 440, - 438, 437, 436, 435, 432, 431, 430, 429, 428, 427, - 426, 424, 423, 422, 421, 420, 419, 418, 417, 416, - 415, 414, 413, 412, 411, 410, 409, 408, 406, 405, - 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, - 394, 393, 392, 391, 390, 389, 388, 387, 384, 383, - - 382, 379, 378, 377, 376, 375, 374, 372, 370, 369, - 368, 366, 365, 364, 363, 362, 361, 360, 359, 358, - 357, 356, 355, 354, 353, 352, 351, 350, 349, 347, - 346, 345, 344, 343, 342, 341, 338, 337, 336, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 322, - 321, 320, 319, 318, 317, 316, 315, 313, 312, 311, - 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, - 300, 299, 298, 297, 296, 295, 294, 292, 291, 290, - 289, 288, 287, 286, 285, 277, 276, 274, 273, 272, - 271, 270, 269, 264, 262, 261, 260, 259, 258, 257, - - 256, 255, 253, 251, 250, 248, 246, 245, 242, 241, - 240, 239, 238, 237, 236, 234, 230, 229, 228, 227, - 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, - 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, - 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 195, 194, 192, 191, 189, 187, 186, 185, 184, 183, - 182, 181, 180, 179, 177, 175, 162, 161, 160, 158, - 157, 156, 155, 154, 148, 146, 145, 144, 143, 142, - 141, 140, 139, 138, 135, 134, 133, 132, 131, 129, - 128, 127, 125, 124, 121, 119, 117, 116, 115, 114, - - 113, 112, 111, 110, 107, 106, 105, 104, 103, 102, - 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, - 91, 89, 88, 87, 86, 85, 84, 83, 81, 80, - 78, 77, 76, 75, 73, 72, 71, 55, 54, 51, - 50, 37, 36, 34, 33, 32, 31, 30, 29, 28, - 20, 8, 7, 3, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 1, 1, 1, 1, 1, 1, 1, 5, 23, 5, + 10, 27, 46, 23, 17, 46, 808, 10, 10, 10, + 10, 10, 10, 10, 16, 17, 16, 29, 17, 27, + 18, 116, 16, 11, 11, 11, 11, 11, 11, 11, + + 18, 19, 116, 53, 11, 29, 36, 19, 36, 53, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 48, + 48, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 48, 10, 10, 10, 10, 12, 12, 12, 12, + 12, 12, 12, 61, 80, 80, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 99, 61, 99, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 15, 47, 15, + 14, 14, 47, 12, 49, 22, 15, 49, 24, 21, + 274, 21, 15, 22, 15, 13, 21, 24, 22, 21, + 25, 24, 25, 25, 22, 274, 810, 14, 45, 45, + + 92, 44, 44, 54, 45, 25, 26, 44, 26, 26, + 26, 26, 26, 44, 26, 45, 26, 54, 44, 92, + 44, 811, 26, 26, 54, 26, 41, 43, 43, 43, + 43, 43, 43, 50, 50, 57, 812, 43, 60, 50, + 60, 59, 59, 60, 60, 813, 57, 59, 75, 57, + 50, 60, 57, 140, 75, 59, 816, 84, 59, 63, + 63, 63, 63, 43, 817, 140, 41, 41, 41, 41, + 41, 41, 62, 41, 41, 84, 159, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 159, 118, 41, 118, + 62, 62, 62, 62, 64, 64, 64, 64, 65, 65, + + 65, 65, 66, 66, 66, 66, 66, 66, 108, 818, + 81, 81, 66, 67, 67, 67, 67, 67, 67, 67, + 81, 111, 108, 68, 67, 68, 68, 68, 68, 68, + 68, 117, 128, 117, 130, 111, 157, 160, 66, 128, + 133, 133, 157, 160, 117, 823, 133, 239, 130, 132, + 67, 132, 132, 132, 132, 132, 132, 133, 136, 136, + 136, 146, 146, 169, 136, 147, 147, 146, 161, 161, + 239, 147, 219, 169, 161, 136, 218, 825, 146, 240, + 244, 161, 147, 162, 162, 161, 163, 163, 218, 162, + 219, 827, 163, 173, 173, 173, 173, 830, 244, 831, + + 162, 835, 240, 163, 174, 174, 174, 174, 175, 175, + 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, + 178, 178, 178, 178, 179, 179, 179, 179, 181, 181, + 181, 181, 181, 181, 837, 839, 241, 182, 181, 182, + 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, + 183, 184, 184, 184, 184, 184, 184, 185, 186, 241, + 192, 194, 185, 186, 181, 192, 194, 243, 195, 845, + 452, 185, 186, 195, 192, 194, 846, 185, 186, 243, + 185, 186, 195, 192, 194, 196, 452, 197, 199, 198, + 196, 195, 197, 199, 198, 288, 842, 842, 288, 196, + + 242, 197, 199, 198, 851, 196, 807, 197, 196, 198, + 197, 199, 198, 201, 203, 204, 206, 207, 201, 203, + 204, 206, 207, 242, 806, 804, 803, 201, 203, 204, + 206, 207, 260, 799, 203, 204, 201, 203, 204, 206, + 207, 209, 210, 211, 798, 260, 209, 210, 211, 303, + 303, 303, 303, 212, 213, 209, 210, 211, 212, 213, + 797, 209, 210, 211, 209, 210, 211, 212, 213, 579, + 214, 796, 579, 212, 213, 214, 212, 213, 220, 794, + 221, 223, 224, 220, 214, 221, 223, 224, 792, 790, + 214, 787, 220, 214, 221, 223, 224, 226, 786, 784, + + 783, 220, 226, 221, 223, 224, 277, 227, 228, 229, + 231, 226, 227, 228, 229, 231, 782, 226, 781, 277, + 226, 227, 228, 229, 231, 780, 779, 227, 228, 229, + 227, 228, 229, 231, 232, 233, 234, 776, 775, 232, + 233, 234, 304, 304, 304, 304, 235, 236, 232, 233, + 234, 235, 236, 773, 232, 233, 234, 232, 233, 234, + 235, 236, 772, 245, 771, 770, 235, 236, 245, 235, + 236, 256, 256, 256, 256, 256, 256, 245, 257, 257, + 257, 257, 257, 257, 258, 258, 245, 272, 272, 769, + 258, 290, 290, 272, 291, 291, 768, 290, 766, 311, + + 291, 258, 765, 764, 272, 314, 292, 292, 290, 762, + 760, 291, 292, 300, 759, 300, 756, 300, 305, 305, + 305, 305, 311, 292, 306, 306, 306, 306, 314, 322, + 300, 307, 307, 307, 307, 308, 308, 308, 308, 308, + 308, 309, 309, 309, 309, 309, 309, 315, 326, 315, + 329, 332, 322, 335, 338, 341, 344, 347, 350, 353, + 356, 359, 362, 365, 368, 371, 374, 384, 387, 391, + 315, 326, 394, 329, 332, 398, 335, 338, 341, 344, + 347, 350, 353, 356, 359, 362, 365, 368, 371, 374, + 384, 387, 391, 401, 404, 394, 407, 411, 398, 414, + + 417, 420, 423, 426, 438, 440, 443, 753, 504, 504, + 553, 556, 752, 751, 642, 642, 401, 404, 750, 407, + 411, 738, 414, 417, 420, 423, 426, 438, 440, 443, + 504, 737, 736, 553, 556, 642, 850, 850, 850, 852, + 852, 707, 700, 699, 696, 695, 694, 693, 692, 691, + 690, 689, 688, 687, 685, 682, 681, 680, 679, 678, + 677, 676, 675, 674, 673, 672, 670, 669, 668, 667, + 665, 663, 662, 661, 660, 659, 658, 657, 656, 655, + 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, + 644, 643, 641, 640, 639, 638, 637, 636, 635, 634, + + 633, 630, 629, 628, 627, 626, 625, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 593, 592, 591, 590, + 589, 587, 586, 585, 584, 583, 582, 581, 578, 577, + 575, 574, 573, 572, 569, 568, 567, 566, 565, 564, + 563, 561, 560, 559, 558, 557, 555, 554, 552, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, + 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, + 530, 526, 525, 524, 523, 522, 521, 520, 519, 518, + + 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, + 507, 506, 505, 502, 501, 500, 497, 496, 495, 494, + 493, 492, 490, 488, 487, 486, 484, 483, 482, 481, + 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, + 470, 469, 468, 467, 465, 464, 463, 462, 461, 460, + 459, 456, 455, 454, 451, 450, 449, 448, 447, 446, + 445, 444, 442, 441, 439, 437, 436, 435, 434, 433, + 432, 431, 430, 428, 427, 425, 424, 422, 421, 419, + 418, 416, 415, 413, 412, 410, 409, 408, 406, 405, + 403, 402, 400, 399, 397, 396, 395, 393, 392, 390, + + 388, 386, 385, 383, 382, 380, 378, 377, 376, 375, + 373, 372, 370, 369, 367, 366, 364, 363, 361, 360, + 358, 357, 355, 354, 352, 351, 349, 348, 346, 345, + 343, 342, 340, 339, 337, 336, 334, 333, 331, 330, + 328, 327, 325, 323, 321, 320, 319, 318, 317, 316, + 313, 312, 310, 302, 301, 299, 298, 297, 296, 295, + 294, 289, 287, 286, 285, 284, 283, 282, 281, 280, + 278, 276, 275, 273, 271, 270, 267, 266, 265, 264, + 263, 262, 261, 259, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 238, 237, 230, 225, 222, 217, + + 216, 215, 193, 191, 190, 189, 187, 172, 171, 170, + 168, 167, 166, 165, 164, 158, 156, 155, 154, 153, + 152, 151, 150, 149, 148, 145, 144, 143, 142, 141, + 139, 138, 137, 135, 134, 131, 129, 127, 126, 125, + 124, 123, 122, 121, 120, 119, 115, 114, 113, 112, + 110, 109, 107, 106, 105, 104, 103, 102, 101, 100, + 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, + 87, 86, 85, 83, 82, 79, 78, 77, 76, 74, + 73, 72, 56, 55, 52, 51, 38, 37, 35, 34, + 33, 32, 31, 30, 28, 20, 8, 7, 3, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; /* The intent behind this definition is that it'll catch @@ -904,22 +1046,27 @@ static yyconst flex_int16_t yy_chk[1023] = #include "prog_instruction.h" #include "prog_statevars.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) +#ifndef HAVE_UNISTD_H +#define YY_NO_UNISTD_H +#endif + #define return_token_or_IDENTIFIER(condition, token) \ do { \ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -934,15 +1081,16 @@ static yyconst flex_int16_t yy_chk[1023] = } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -991,6 +1139,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -1004,7 +1161,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1008 "lex.yy.c" +#line 1165 "lex.yy.c" #define INITIAL 0 @@ -1141,7 +1298,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1149,7 +1311,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1160,7 +1322,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1245,10 +1407,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 137 "program_lexer.l" +#line 157 "program_lexer.l" -#line 1252 "lex.yy.c" +#line 1414 "lex.yy.c" yylval = yylval_param; @@ -1305,13 +1467,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 955 ); + while ( yy_base[yy_current_state] != 1300 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1337,17 +1499,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 159 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 160 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 141 "program_lexer.l" +#line 161 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1355,813 +1517,745 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 165 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 166 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 167 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 168 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 169 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 170 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 171 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 153 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, ABS, OFF); } +#line 173 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 154 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } +#line 174 "program_lexer.l" +{ return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 155 "program_lexer.l" -{ return_opcode( 1, BIN_OP, ADD, OFF); } +#line 175 "program_lexer.l" +{ return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 156 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } +#line 177 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 157 "program_lexer.l" -{ return_opcode(require_ARB_vp, ARL, ARL, OFF); } +#line 178 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 159 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } +#line 180 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 160 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } +#line 181 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 161 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } +#line 182 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 162 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } +#line 183 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 164 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP3, OFF); } +#line 184 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 165 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } +#line 185 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 166 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP4, OFF); } +#line 187 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 167 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } +#line 188 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 168 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DPH, OFF); } +#line 190 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 169 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } +#line 191 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 170 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DST, OFF); } +#line 193 "program_lexer.l" +{ return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 171 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } +#line 195 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 173 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, EX2, OFF); } +#line 196 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 174 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } +#line 197 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 175 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } +#line 198 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 177 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FLR, OFF); } +#line 200 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 178 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } +#line 201 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 179 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FRC, OFF); } +#line 202 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 180 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } +#line 203 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 182 "program_lexer.l" -{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } +#line 204 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 184 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, LIT, OFF); } +#line 206 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 185 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } +#line 207 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 186 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, LG2, OFF); } +#line 208 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 187 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } +#line 209 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 188 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } +#line 210 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 189 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } +#line 212 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 190 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } +#line 213 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 192 "program_lexer.l" -{ return_opcode( 1, TRI_OP, MAD, OFF); } +#line 214 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 193 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } +#line 216 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 194 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MAX, OFF); } +#line 217 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 195 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } +#line 218 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 196 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MIN, OFF); } +#line 219 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 197 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } +#line 220 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 198 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, MOV, OFF); } +#line 221 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 199 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } +#line 222 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 200 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MUL, OFF); } +#line 223 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 201 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } +#line 224 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 203 "program_lexer.l" -{ return_opcode( 1, BINSC_OP, POW, OFF); } +#line 225 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 204 "program_lexer.l" -{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } +#line 226 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 206 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RCP, OFF); } +#line 227 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 207 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +#line 229 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 208 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } +#line 230 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 209 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } +#line 231 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 211 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } +#line 232 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 212 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +#line 234 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 213 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SGE, OFF); } +#line 235 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 214 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +#line 236 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } YY_BREAK case 63: YY_RULE_SETUP -#line 215 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } +#line 237 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } YY_BREAK case 64: YY_RULE_SETUP -#line 216 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +#line 239 "program_lexer.l" +{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 65: YY_RULE_SETUP -#line 217 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SLT, OFF); } +#line 240 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 66: YY_RULE_SETUP -#line 218 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +#line 242 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 67: YY_RULE_SETUP -#line 219 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SUB, OFF); } +#line 243 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 68: YY_RULE_SETUP -#line 220 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } +#line 244 "program_lexer.l" +{ return PROGRAM; } YY_BREAK case 69: YY_RULE_SETUP -#line 221 "program_lexer.l" -{ return_opcode( 1, SWZ, SWZ, OFF); } +#line 245 "program_lexer.l" +{ return STATE; } YY_BREAK case 70: YY_RULE_SETUP -#line 222 "program_lexer.l" -{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } +#line 246 "program_lexer.l" +{ return RESULT; } YY_BREAK case 71: YY_RULE_SETUP -#line 224 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } +#line 248 "program_lexer.l" +{ return AMBIENT; } YY_BREAK case 72: YY_RULE_SETUP -#line 225 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } +#line 249 "program_lexer.l" +{ return ATTENUATION; } YY_BREAK case 73: YY_RULE_SETUP -#line 226 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } +#line 250 "program_lexer.l" +{ return BACK; } YY_BREAK case 74: YY_RULE_SETUP -#line 227 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +#line 251 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 75: YY_RULE_SETUP -#line 228 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } +#line 252 "program_lexer.l" +{ return COLOR; } YY_BREAK case 76: YY_RULE_SETUP -#line 229 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } +#line 253 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 77: YY_RULE_SETUP -#line 231 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, OFF); } +#line 254 "program_lexer.l" +{ return DIFFUSE; } YY_BREAK case 78: YY_RULE_SETUP -#line 232 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +#line 255 "program_lexer.l" +{ return DIRECTION; } YY_BREAK case 79: YY_RULE_SETUP -#line 234 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +#line 256 "program_lexer.l" +{ return EMISSION; } YY_BREAK case 80: YY_RULE_SETUP -#line 235 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +#line 257 "program_lexer.l" +{ return ENV; } YY_BREAK case 81: YY_RULE_SETUP -#line 236 "program_lexer.l" -{ return PROGRAM; } +#line 258 "program_lexer.l" +{ return EYE; } YY_BREAK case 82: YY_RULE_SETUP -#line 237 "program_lexer.l" -{ return STATE; } +#line 259 "program_lexer.l" +{ return FOGCOORD; } YY_BREAK case 83: YY_RULE_SETUP -#line 238 "program_lexer.l" -{ return RESULT; } +#line 260 "program_lexer.l" +{ return FOG; } YY_BREAK case 84: YY_RULE_SETUP -#line 240 "program_lexer.l" -{ return AMBIENT; } +#line 261 "program_lexer.l" +{ return FRONT; } YY_BREAK case 85: YY_RULE_SETUP -#line 241 "program_lexer.l" -{ return ATTENUATION; } +#line 262 "program_lexer.l" +{ return HALF; } YY_BREAK case 86: YY_RULE_SETUP -#line 242 "program_lexer.l" -{ return BACK; } +#line 263 "program_lexer.l" +{ return INVERSE; } YY_BREAK case 87: YY_RULE_SETUP -#line 243 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } +#line 264 "program_lexer.l" +{ return INVTRANS; } YY_BREAK case 88: YY_RULE_SETUP -#line 244 "program_lexer.l" -{ return COLOR; } +#line 265 "program_lexer.l" +{ return LIGHT; } YY_BREAK case 89: YY_RULE_SETUP -#line 245 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } +#line 266 "program_lexer.l" +{ return LIGHTMODEL; } YY_BREAK case 90: YY_RULE_SETUP -#line 246 "program_lexer.l" -{ return DIFFUSE; } +#line 267 "program_lexer.l" +{ return LIGHTPROD; } YY_BREAK case 91: YY_RULE_SETUP -#line 247 "program_lexer.l" -{ return DIRECTION; } +#line 268 "program_lexer.l" +{ return LOCAL; } YY_BREAK case 92: YY_RULE_SETUP -#line 248 "program_lexer.l" -{ return EMISSION; } +#line 269 "program_lexer.l" +{ return MATERIAL; } YY_BREAK case 93: YY_RULE_SETUP -#line 249 "program_lexer.l" -{ return ENV; } +#line 270 "program_lexer.l" +{ return MAT_PROGRAM; } YY_BREAK case 94: YY_RULE_SETUP -#line 250 "program_lexer.l" -{ return EYE; } +#line 271 "program_lexer.l" +{ return MATRIX; } YY_BREAK case 95: YY_RULE_SETUP -#line 251 "program_lexer.l" -{ return FOGCOORD; } +#line 272 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 96: YY_RULE_SETUP -#line 252 "program_lexer.l" -{ return FOG; } +#line 273 "program_lexer.l" +{ return MODELVIEW; } YY_BREAK case 97: YY_RULE_SETUP -#line 253 "program_lexer.l" -{ return FRONT; } +#line 274 "program_lexer.l" +{ return MVP; } YY_BREAK case 98: YY_RULE_SETUP -#line 254 "program_lexer.l" -{ return HALF; } +#line 275 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 99: YY_RULE_SETUP -#line 255 "program_lexer.l" -{ return INVERSE; } +#line 276 "program_lexer.l" +{ return OBJECT; } YY_BREAK case 100: YY_RULE_SETUP -#line 256 "program_lexer.l" -{ return INVTRANS; } +#line 277 "program_lexer.l" +{ return PALETTE; } YY_BREAK case 101: YY_RULE_SETUP -#line 257 "program_lexer.l" -{ return LIGHT; } +#line 278 "program_lexer.l" +{ return PARAMS; } YY_BREAK case 102: YY_RULE_SETUP -#line 258 "program_lexer.l" -{ return LIGHTMODEL; } +#line 279 "program_lexer.l" +{ return PLANE; } YY_BREAK case 103: YY_RULE_SETUP -#line 259 "program_lexer.l" -{ return LIGHTPROD; } +#line 280 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 104: YY_RULE_SETUP -#line 260 "program_lexer.l" -{ return LOCAL; } +#line 281 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 105: YY_RULE_SETUP -#line 261 "program_lexer.l" -{ return MATERIAL; } +#line 282 "program_lexer.l" +{ return POSITION; } YY_BREAK case 106: YY_RULE_SETUP -#line 262 "program_lexer.l" -{ return MAT_PROGRAM; } +#line 283 "program_lexer.l" +{ return PRIMARY; } YY_BREAK case 107: YY_RULE_SETUP -#line 263 "program_lexer.l" -{ return MATRIX; } +#line 284 "program_lexer.l" +{ return PROJECTION; } YY_BREAK case 108: YY_RULE_SETUP -#line 264 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } +#line 285 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 109: YY_RULE_SETUP -#line 265 "program_lexer.l" -{ return MODELVIEW; } +#line 286 "program_lexer.l" +{ return ROW; } YY_BREAK case 110: YY_RULE_SETUP -#line 266 "program_lexer.l" -{ return MVP; } +#line 287 "program_lexer.l" +{ return SCENECOLOR; } YY_BREAK case 111: YY_RULE_SETUP -#line 267 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } +#line 288 "program_lexer.l" +{ return SECONDARY; } YY_BREAK case 112: YY_RULE_SETUP -#line 268 "program_lexer.l" -{ return OBJECT; } +#line 289 "program_lexer.l" +{ return SHININESS; } YY_BREAK case 113: YY_RULE_SETUP -#line 269 "program_lexer.l" -{ return PALETTE; } +#line 290 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 114: YY_RULE_SETUP -#line 270 "program_lexer.l" -{ return PARAMS; } +#line 291 "program_lexer.l" +{ return SPECULAR; } YY_BREAK case 115: YY_RULE_SETUP -#line 271 "program_lexer.l" -{ return PLANE; } +#line 292 "program_lexer.l" +{ return SPOT; } YY_BREAK case 116: YY_RULE_SETUP -#line 272 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } +#line 293 "program_lexer.l" +{ return TEXCOORD; } YY_BREAK case 117: YY_RULE_SETUP -#line 273 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } +#line 294 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 118: YY_RULE_SETUP -#line 274 "program_lexer.l" -{ return POSITION; } +#line 295 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 119: YY_RULE_SETUP -#line 275 "program_lexer.l" -{ return PRIMARY; } +#line 296 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 120: YY_RULE_SETUP -#line 276 "program_lexer.l" -{ return PROJECTION; } +#line 297 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 121: YY_RULE_SETUP -#line 277 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } +#line 298 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 122: YY_RULE_SETUP -#line 278 "program_lexer.l" -{ return ROW; } +#line 299 "program_lexer.l" +{ return TEXTURE; } YY_BREAK case 123: YY_RULE_SETUP -#line 279 "program_lexer.l" -{ return SCENECOLOR; } +#line 300 "program_lexer.l" +{ return TRANSPOSE; } YY_BREAK case 124: YY_RULE_SETUP -#line 280 "program_lexer.l" -{ return SECONDARY; } +#line 301 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 125: YY_RULE_SETUP -#line 281 "program_lexer.l" -{ return SHININESS; } +#line 302 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 126: YY_RULE_SETUP -#line 282 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } +#line 304 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 127: YY_RULE_SETUP -#line 283 "program_lexer.l" -{ return SPECULAR; } +#line 305 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 128: YY_RULE_SETUP -#line 284 "program_lexer.l" -{ return SPOT; } +#line 306 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 129: YY_RULE_SETUP -#line 285 "program_lexer.l" -{ return TEXCOORD; } +#line 307 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 130: YY_RULE_SETUP -#line 286 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, TEXENV); } +#line 308 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 131: YY_RULE_SETUP -#line 287 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN); } +#line 309 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 132: YY_RULE_SETUP -#line 288 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } +#line 310 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 133: YY_RULE_SETUP -#line 289 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } +#line 311 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 134: YY_RULE_SETUP -#line 290 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } +#line 312 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 135: YY_RULE_SETUP -#line 291 "program_lexer.l" -{ return TEXTURE; } +#line 313 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 136: YY_RULE_SETUP -#line 292 "program_lexer.l" -{ return TRANSPOSE; } +#line 314 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 293 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } +#line 315 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 138: YY_RULE_SETUP -#line 294 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, WEIGHT); } +#line 316 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 139: YY_RULE_SETUP -#line 296 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } +#line 318 "program_lexer.l" +{ return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 140: YY_RULE_SETUP -#line 297 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 298 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 299 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 300 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 301 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 302 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 303 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 304 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 305 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 306 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 307 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 308 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 310 "program_lexer.l" -{ - yylval->string = strdup(yytext); - return IDENTIFIER; -} - YY_BREAK -case 153: -YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 320 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 154: +case 141: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 322 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 155: +case 142: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 326 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 156: -/* rule 156 can match eol */ +case 143: +/* rule 143 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 330 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 157: +case 144: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 334 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 158: +case 145: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 338 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 159: +case 146: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 343 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 160: +case 147: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 349 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2169,27 +2263,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 161: +case 148: YY_RULE_SETUP -#line 350 "program_lexer.l" +#line 355 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 162: +case 149: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 360 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 163: +case 150: YY_RULE_SETUP -#line 361 "program_lexer.l" +#line 366 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2197,9 +2291,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 164: +case 151: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 372 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2207,18 +2301,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 165: +case 152: YY_RULE_SETUP -#line 373 "program_lexer.l" +#line 378 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 166: +case 153: YY_RULE_SETUP -#line 379 "program_lexer.l" +#line 384 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2226,9 +2320,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 167: +case 154: YY_RULE_SETUP -#line 386 "program_lexer.l" +#line 391 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2238,18 +2332,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 168: +case 155: YY_RULE_SETUP -#line 395 "program_lexer.l" +#line 400 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 169: +case 156: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 406 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2257,27 +2351,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 170: +case 157: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 412 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 171: +case 158: YY_RULE_SETUP -#line 412 "program_lexer.l" +#line 417 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 172: +case 159: YY_RULE_SETUP -#line 418 "program_lexer.l" +#line 423 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2285,9 +2379,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 173: +case 160: YY_RULE_SETUP -#line 424 "program_lexer.l" +#line 429 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2295,18 +2389,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 174: +case 161: YY_RULE_SETUP -#line 430 "program_lexer.l" +#line 435 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 175: +case 162: YY_RULE_SETUP -#line 436 "program_lexer.l" +#line 441 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2314,9 +2408,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 176: +case 163: YY_RULE_SETUP -#line 444 "program_lexer.l" +#line 449 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2328,9 +2422,9 @@ YY_RULE_SETUP } } YY_BREAK -case 177: +case 164: YY_RULE_SETUP -#line 455 "program_lexer.l" +#line 460 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2340,15 +2434,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 178: +case 165: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 469 "program_lexer.l" { return DOT; } YY_BREAK -case 179: -/* rule 179 can match eol */ +case 166: +/* rule 166 can match eol */ YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 471 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2357,30 +2451,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 180: +case 167: YY_RULE_SETUP -#line 473 "program_lexer.l" +#line 478 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 181: +case 168: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 474 "program_lexer.l" +#line 479 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 182: +case 169: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 480 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 183: +case 170: YY_RULE_SETUP -#line 476 "program_lexer.l" +#line 481 "program_lexer.l" ECHO; YY_BREAK -#line 2384 "lex.yy.c" +#line 2478 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2674,7 +2768,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2703,11 +2797,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 674); + yy_is_jam = (yy_current_state == 849); return yy_is_jam ? 0 : yy_current_state; } @@ -3148,8 +3242,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -3555,7 +3649,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 476 "program_lexer.l" +#line 481 "program_lexer.l" diff --git a/mesalib/src/mesa/shader/nvfragparse.c b/mesalib/src/mesa/shader/nvfragparse.c index 0fd55524a..b739a6aa0 100644 --- a/mesalib/src/mesa/shader/nvfragparse.c +++ b/mesalib/src/mesa/shader/nvfragparse.c @@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token) const struct instruction_pattern *inst; struct instruction_pattern result; + result.name = NULL; + result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + result.inputs = 0; + result.outputs = 0; + result.suffixes = 0; + for (inst = Instructions; inst->name; inst++) { if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ @@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token) return result; } } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + return result; } diff --git a/mesalib/src/mesa/shader/prog_instruction.h b/mesalib/src/mesa/shader/prog_instruction.h index 39a221eea..1c687bc16 100644 --- a/mesalib/src/mesa/shader/prog_instruction.h +++ b/mesalib/src/mesa/shader/prog_instruction.h @@ -121,7 +121,6 @@ /*@{*/ #define SATURATE_OFF 0 #define SATURATE_ZERO_ONE 1 -#define SATURATE_PLUS_MINUS_ONE 2 /*@}*/ diff --git a/mesalib/src/mesa/shader/prog_optimize.c b/mesalib/src/mesa/shader/prog_optimize.c index 9d937488e..4fe351251 100644 --- a/mesalib/src/mesa/shader/prog_optimize.c +++ b/mesalib/src/mesa/shader/prog_optimize.c @@ -38,6 +38,39 @@ static GLboolean dbg = GL_FALSE; +/* Returns the mask of channels read from the given srcreg in this instruction. + */ +static GLuint +get_src_arg_mask(const struct prog_instruction *inst, int arg) +{ + int writemask = inst->DstReg.WriteMask; + + if (inst->CondUpdate) + writemask = WRITEMASK_XYZW; + + switch (inst->Opcode) { + case OPCODE_MOV: + case OPCODE_ABS: + case OPCODE_ADD: + case OPCODE_MUL: + case OPCODE_SUB: + return writemask; + case OPCODE_RCP: + case OPCODE_SIN: + case OPCODE_COS: + case OPCODE_RSQ: + case OPCODE_POW: + case OPCODE_EX2: + return WRITEMASK_X; + case OPCODE_DP2: + return WRITEMASK_XY; + case OPCODE_DP3: + case OPCODE_XPD: + return WRITEMASK_XYZ; + default: + return WRITEMASK_XYZW; + } +} /** * In 'prog' remove instruction[i] if removeFlags[i] == TRUE. @@ -74,6 +107,12 @@ remove_instructions(struct gl_program *prog, const GLboolean *removeFlags) } } } + /* Finish removing if the first instruction was to be removed. */ + if (removeCount > 0) { + GLint removeStart = removeEnd - removeCount + 1; + _mesa_delete_instructions(prog, removeStart, removeCount); + removeStart = removeCount = 0; /* reset removal info */ + } return totalRemoved; } @@ -187,11 +226,10 @@ _mesa_consolidate_registers(struct gl_program *prog) static void _mesa_remove_dead_code(struct gl_program *prog) { - GLboolean tempWritten[MAX_PROGRAM_TEMPS], tempRead[MAX_PROGRAM_TEMPS]; + GLboolean tempRead[MAX_PROGRAM_TEMPS][4]; GLboolean *removeInst; /* per-instruction removal flag */ - GLuint i, rem; + GLuint i, rem = 0, comp; - memset(tempWritten, 0, sizeof(tempWritten)); memset(tempRead, 0, sizeof(tempRead)); if (dbg) { @@ -212,16 +250,37 @@ _mesa_remove_dead_code(struct gl_program *prog) 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 < MAX_PROGRAM_TEMPS); + read_mask = get_src_arg_mask(inst, j); if (inst->SrcReg[j].RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); - _mesa_free(removeInst); - return; + goto done; } - tempRead[index] = GL_TRUE; + for (comp = 0; comp < 4; comp++) { + GLuint swz = (inst->SrcReg[j].Swizzle >> (3 * comp)) & 0x7; + + if ((read_mask & (1 << comp)) == 0) + continue; + + switch (swz) { + case SWIZZLE_X: + tempRead[index][0] = GL_TRUE; + break; + case SWIZZLE_Y: + tempRead[index][1] = GL_TRUE; + break; + case SWIZZLE_Z: + tempRead[index][2] = GL_TRUE; + break; + case SWIZZLE_W: + tempRead[index][3] = GL_TRUE; + break; + } + } } } @@ -233,50 +292,63 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); - _mesa_free(removeInst); - return; + goto done; } - tempWritten[index] = GL_TRUE; 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] = GL_TRUE; + tempRead[index][0] = GL_TRUE; + tempRead[index][1] = GL_TRUE; + tempRead[index][2] = GL_TRUE; + tempRead[index][3] = GL_TRUE; } } } - if (dbg) { - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { - if (tempWritten[i] && !tempRead[i]) - _mesa_printf("Remove writes to tmp %u\n", i); - } - } - /* find instructions that write to dead registers, flag for removal */ for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - if (inst->DstReg.File == PROGRAM_TEMPORARY) { - GLint index = inst->DstReg.Index; - removeInst[i] = (tempWritten[index] && !tempRead[index]); - if (dbg && removeInst[i]) { - _mesa_printf("Remove inst %u: ", i); - _mesa_print_instruction(inst); - } + 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) { + _mesa_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) + _mesa_printf("Remove instruction %u: \n", i); + removeInst[i] = GL_TRUE; + } } } /* now remove the instructions which aren't needed */ rem = remove_instructions(prog, removeInst); - _mesa_free(removeInst); - if (dbg) { - _mesa_printf("Optimize: End dead code removal. %u instructions removed\n", rem); + _mesa_printf("Optimize: End dead code removal.\n"); + _mesa_printf(" %u channel writes removed\n", rem); + _mesa_printf(" %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } + +done: + _mesa_free(removeInst); } @@ -325,6 +397,132 @@ find_next_temp_use(const struct gl_program *prog, GLuint start, GLuint index) return END; } +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; + } +} + +/** + * 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) { + _mesa_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; + + if (mov->Opcode != OPCODE_MOV || + mov->DstReg.File != PROGRAM_TEMPORARY || + mov->DstReg.RelAddr || + mov->DstReg.CondMask != COND_TR || + mov->SaturateMode != SATURATE_OFF || + mov->SrcReg[0].RelAddr) + continue; + + /* 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; + int 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++) { + int comp; + int read_mask = get_src_arg_mask(inst2, arg); + + if (inst2->SrcReg[arg].File != mov->DstReg.File || + inst2->SrcReg[arg].Index != mov->DstReg.Index || + inst2->SrcReg[arg].RelAddr || + inst2->SrcReg[arg].Abs) + continue; + + /* Check that all the sources for this arg of inst2 come from inst1 + * or constants. + */ + for (comp = 0; comp < 4; comp++) { + int src_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + /* If the MOV didn't write that channel, can't use it. */ + if ((read_mask & (1 << comp)) && + src_swz <= SWIZZLE_W && + (mov->DstReg.WriteMask & (1 << src_swz)) == 0) + break; + } + if (comp != 4) + continue; + + /* Adjust the swizzles of inst2 to point at MOV's source */ + for (comp = 0; comp < 4; comp++) { + int inst2_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + if (inst2_swz <= SWIZZLE_W) { + 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; + } + + /* If this instruction overwrote part of the move, our time is up. */ + if ((inst2->DstReg.File == mov->DstReg.File && + (inst2->DstReg.RelAddr || + inst2->DstReg.Index == mov->DstReg.Index)) || + (inst2->DstReg.File == mov->SrcReg[0].File && + (inst2->DstReg.RelAddr || + inst2->DstReg.Index == mov->SrcReg[0].Index))) + break; + } + } + + if (dbg) { + _mesa_printf("Optimize: End remove extra move use.\n"); + /*_mesa_print_program(prog);*/ + } +} /** * Try to remove extraneous MOV instructions from the given program. @@ -823,6 +1021,8 @@ _mesa_reallocate_registers(struct gl_program *prog) void _mesa_optimize_program(GLcontext *ctx, struct gl_program *program) { + _mesa_remove_extra_move_use(program); + if (1) _mesa_remove_dead_code(program); diff --git a/mesalib/src/mesa/shader/prog_parameter.c b/mesalib/src/mesa/shader/prog_parameter.c index 2f029b02e..f22492e02 100644 --- a/mesalib/src/mesa/shader/prog_parameter.c +++ b/mesalib/src/mesa/shader/prog_parameter.c @@ -500,7 +500,7 @@ GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); + GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name); if (i < 0) return NULL; else diff --git a/mesalib/src/mesa/shader/prog_print.c b/mesalib/src/mesa/shader/prog_print.c index b71735aa8..52c102cba 100644 --- a/mesalib/src/mesa/shader/prog_print.c +++ b/mesalib/src/mesa/shader/prog_print.c @@ -788,7 +788,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!VP1.0\n"); else - _mesa_fprintf(f, "# Vertex Program/Shader\n"); + _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: @@ -797,7 +797,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!FP1.0\n"); else - _mesa_fprintf(f, "# Fragment Program/Shader\n"); + _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); break; } @@ -826,11 +826,11 @@ _mesa_print_program(const struct gl_program *prog) * XXX move to imports.[ch] if useful elsewhere. */ static const char * -binary(GLbitfield val) +binary(GLbitfield64 val) { - static char buf[50]; + static char buf[80]; GLint i, len = 0; - for (i = 31; i >= 0; --i) { + for (i = 63; i >= 0; --i) { if (val & (1 << i)) buf[len++] = '1'; else if (len > 0 || i == 0) @@ -906,7 +906,8 @@ _mesa_fprint_parameter_list(FILE *f, if (!list) return; - _mesa_fprintf(f, "param list %p\n", (void *) list); + if (0) + _mesa_fprintf(f, "param list %p\n", (void *) list); _mesa_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; diff --git a/mesalib/src/mesa/shader/program.c b/mesalib/src/mesa/shader/program.c index 2cd6eb8a3..6b8d94e66 100644 --- a/mesalib/src/mesa/shader/program.c +++ b/mesalib/src/mesa/shader/program.c @@ -351,13 +351,6 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Attributes); } - /* XXX this is a little ugly */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; - if (vprog->TnlData) - _mesa_free(vprog->TnlData); - } - _mesa_free(prog); } @@ -813,9 +806,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile) const struct prog_instruction *inst = prog->Instructions + i; const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; + /* check dst reg first */ + if (inst->DstReg.File == regFile) { + used[inst->DstReg.Index] = GL_TRUE; + } + else { + /* check src regs otherwise */ + for (k = 0; k < n; k++) { + if (inst->SrcReg[k].File == regFile) { + used[inst->SrcReg[k].Index] = GL_TRUE; + break; + } } } } diff --git a/mesalib/src/mesa/shader/program_lexer.l b/mesalib/src/mesa/shader/program_lexer.l index c2803ff70..e2acb3c0c 100644 --- a/mesalib/src/mesa/shader/program_lexer.l +++ b/mesalib/src/mesa/shader/program_lexer.l @@ -26,22 +26,27 @@ #include "prog_instruction.h" #include "prog_statevars.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) +#ifndef HAVE_UNISTD_H +#define YY_NO_UNISTD_H +#endif + #define return_token_or_IDENTIFIER(condition, token) \ do { \ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -56,15 +61,16 @@ } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -113,6 +119,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -133,6 +148,11 @@ exp [Ee][-+]?[0-9]+ frac "."[0-9]+ dot "."[ \t]* +sz [HRX]? +szf [HR]? +cc C? +sat (_SAT)? + %option bison-bridge bison-locations reentrant noyywrap %% @@ -150,86 +170,74 @@ OUTPUT { return OUTPUT; } PARAM { return PARAM; } TEMP { yylval->integer = at_temp; return TEMP; } -ABS { return_opcode( 1, VECTOR_OP, ABS, OFF); } -ABS_SAT { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } -ADD { return_opcode( 1, BIN_OP, ADD, OFF); } -ADD_SAT { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } -ARL { return_opcode(require_ARB_vp, ARL, ARL, OFF); } - -CMP { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } -CMP_SAT { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } -COS { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } -COS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } - -DP3 { return_opcode( 1, BIN_OP, DP3, OFF); } -DP3_SAT { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } -DP4 { return_opcode( 1, BIN_OP, DP4, OFF); } -DP4_SAT { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } -DPH { return_opcode( 1, BIN_OP, DPH, OFF); } -DPH_SAT { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } -DST { return_opcode( 1, BIN_OP, DST, OFF); } -DST_SAT { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } - -EX2 { return_opcode( 1, SCALAR_OP, EX2, OFF); } -EX2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } -EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } - -FLR { return_opcode( 1, VECTOR_OP, FLR, OFF); } -FLR_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } -FRC { return_opcode( 1, VECTOR_OP, FRC, OFF); } -FRC_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } - -KIL { return_opcode(require_ARB_fp, KIL, KIL, OFF); } - -LIT { return_opcode( 1, VECTOR_OP, LIT, OFF); } -LIT_SAT { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } -LG2 { return_opcode( 1, SCALAR_OP, LG2, OFF); } -LG2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } -LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } -LRP { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } -LRP_SAT { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } - -MAD { return_opcode( 1, TRI_OP, MAD, OFF); } -MAD_SAT { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } -MAX { return_opcode( 1, BIN_OP, MAX, OFF); } -MAX_SAT { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } -MIN { return_opcode( 1, BIN_OP, MIN, OFF); } -MIN_SAT { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } -MOV { return_opcode( 1, VECTOR_OP, MOV, OFF); } -MOV_SAT { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } -MUL { return_opcode( 1, BIN_OP, MUL, OFF); } -MUL_SAT { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } - -POW { return_opcode( 1, BINSC_OP, POW, OFF); } -POW_SAT { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } - -RCP { return_opcode( 1, SCALAR_OP, RCP, OFF); } -RCP_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } -RSQ { return_opcode( 1, SCALAR_OP, RSQ, OFF); } -RSQ_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } - -SCS { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } -SCS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } -SGE { return_opcode( 1, BIN_OP, SGE, OFF); } -SGE_SAT { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } -SIN { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } -SIN_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } -SLT { return_opcode( 1, BIN_OP, SLT, OFF); } -SLT_SAT { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } -SUB { return_opcode( 1, BIN_OP, SUB, OFF); } -SUB_SAT { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } -SWZ { return_opcode( 1, SWZ, SWZ, OFF); } -SWZ_SAT { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } - -TEX { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } -TEX_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } -TXB { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } -TXB_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } -TXP { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } -TXP_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } - -XPD { return_opcode( 1, BIN_OP, XPD, OFF); } -XPD_SAT { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +ABS{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, ABS, 3); } +ADD{sz}{cc}{sat} { return_opcode( 1, BIN_OP, ADD, 3); } +ARL { return_opcode(require_ARB_vp, ARL, ARL, 3); } + +CMP{sat} { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } +COS{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } + +DDX{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } +DDY{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } +DP3{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP3, 3); } +DP4{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP4, 3); } +DPH{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DPH, 3); } +DST{szf}{cc}{sat} { return_opcode( 1, BIN_OP, DST, 3); } + +EX2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, EX2, 3); } +EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } + +FLR{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FLR, 3); } +FRC{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FRC, 3); } + +KIL { return_opcode(require_ARB_fp, KIL, KIL, 3); } + +LIT{szf}{cc}{sat} { return_opcode( 1, VECTOR_OP, LIT, 3); } +LG2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, LG2, 3); } +LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } +LRP{sz}{cc}{sat} { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } + +MAD{sz}{cc}{sat} { return_opcode( 1, TRI_OP, MAD, 3); } +MAX{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MAX, 3); } +MIN{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MIN, 3); } +MOV{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, MOV, 3); } +MUL{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MUL, 3); } + +PK2H { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } +PK2US { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } +PK4B { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } +PK4UB { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } +POW{szf}{cc}{sat} { return_opcode( 1, BINSC_OP, POW, 3); } + +RCP{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RCP, 3); } +RFL{szf}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } +RSQ{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RSQ, 3); } + +SCS{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } +SEQ{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } +SFL{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } +SGE{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SGE, 3); } +SGT{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } +SIN{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } +SLE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } +SLT{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SLT, 3); } +SNE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } +STR{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, STR, 3); } +SUB{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SUB, 3); } +SWZ{sat} { return_opcode( 1, SWZ, SWZ, 3); } + +TEX{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } +TXB{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } +TXD{cc}{sat} { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } +TXP{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } + +UP2H{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } +UP2US{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } +UP4B{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } +UP4UB{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } + +X2D{szf}{cc}{sat} { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } +XPD{sat} { return_opcode( 1, BIN_OP, XPD, 3); } vertex { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } fragment { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } @@ -307,10 +315,7 @@ ARRAY2D { return_token_or_IDENTIFIER(require_ARB_fp && require ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } -[_a-zA-Z$][_a-zA-Z0-9$]* { - yylval->string = strdup(yytext); - return IDENTIFIER; -} +[_a-zA-Z$][_a-zA-Z0-9$]* { return handle_ident(yyextra, yytext, yylval); } ".." { return DOT_DOT; } diff --git a/mesalib/src/mesa/shader/program_parse.tab.c b/mesalib/src/mesa/shader/program_parse.tab.c index b7bac7e5a..d4f842948 100644 --- a/mesalib/src/mesa/shader/program_parse.tab.c +++ b/mesalib/src/mesa/shader/program_parse.tab.c @@ -137,12 +137,27 @@ static int validate_inputs(struct YYLTYPE *locp, 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 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) @@ -170,7 +185,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Line 189 of yacc.c */ -#line 174 "program_parse.tab.c" +#line 189 "program_parse.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -216,90 +231,92 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -310,7 +327,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 107 "program_parse.y" +#line 122 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -339,7 +356,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 343 "program_parse.tab.c" +#line 360 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -363,14 +380,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 249 "program_parse.y" +#line 267 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 374 "program_parse.tab.c" +#line 391 "program_parse.tab.c" #ifdef short # undef short @@ -587,20 +604,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 342 +#define YYLAST 396 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 115 +#define YYNTOKENS 120 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 134 +#define YYNNTS 143 /* YYNRULES -- Number of rules. */ -#define YYNRULES 264 +#define YYNRULES 282 /* YYNRULES -- Number of states. */ -#define YYNSTATES 436 +#define YYNSTATES 475 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 360 +#define YYMAXUTOK 362 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -612,15 +629,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 110, 107, 111, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, - 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, + 115, 116, 2, 113, 109, 114, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 108, + 2, 117, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 108, 2, 109, 2, 2, 2, 2, 2, 2, + 2, 111, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 113, 2, 114, 2, 2, 2, 2, + 2, 2, 2, 118, 110, 119, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -644,7 +661,7 @@ static const yytype_uint8 yytranslate[] = 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105 + 105, 106, 107 }; #if YYDEBUG @@ -654,142 +671,152 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, - 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, - 99, 102, 105, 107, 109, 111, 113, 115, 117, 119, - 121, 123, 125, 127, 129, 136, 140, 144, 147, 150, - 158, 161, 163, 165, 167, 169, 174, 176, 178, 180, - 182, 184, 186, 188, 192, 193, 196, 199, 201, 203, - 205, 207, 209, 211, 213, 215, 217, 218, 220, 222, - 224, 226, 227, 229, 231, 233, 235, 237, 239, 244, - 247, 250, 252, 255, 257, 260, 262, 265, 270, 275, - 277, 278, 282, 284, 286, 289, 291, 294, 296, 298, - 302, 309, 310, 312, 315, 320, 322, 326, 328, 330, - 332, 334, 336, 338, 340, 342, 344, 346, 349, 352, - 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, - 386, 388, 390, 392, 398, 400, 402, 404, 407, 409, - 411, 414, 416, 419, 426, 428, 432, 434, 436, 438, - 440, 442, 447, 449, 451, 453, 455, 457, 459, 462, - 464, 466, 472, 474, 477, 479, 481, 487, 490, 491, - 498, 502, 503, 505, 507, 509, 511, 513, 516, 518, - 520, 523, 528, 533, 534, 538, 540, 542, 544, 547, - 549, 551, 553, 555, 561, 563, 567, 573, 579, 581, - 585, 591, 593, 595, 597, 599, 601, 603, 605, 607, - 609, 613, 619, 627, 637, 640, 643, 645, 647, 648, - 649, 653, 654, 658, 662, 664, 669, 672, 675, 678, - 681, 685, 688, 692, 693, 695, 697, 698, 700, 702, - 703, 705, 707, 708, 710, 712, 713, 717, 718, 722, - 723, 727, 729, 731, 733 + 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, + 92, 101, 104, 107, 120, 123, 125, 127, 129, 131, + 133, 135, 137, 139, 141, 143, 145, 147, 154, 157, + 162, 165, 167, 171, 177, 181, 184, 192, 195, 197, + 199, 201, 203, 208, 210, 212, 214, 216, 218, 220, + 222, 226, 227, 230, 233, 235, 237, 239, 241, 243, + 245, 247, 249, 251, 252, 254, 256, 258, 260, 261, + 265, 269, 270, 273, 276, 278, 280, 282, 284, 286, + 288, 290, 292, 297, 300, 303, 305, 308, 310, 313, + 315, 318, 323, 328, 330, 331, 335, 337, 339, 342, + 344, 347, 349, 351, 355, 362, 363, 365, 368, 373, + 375, 379, 381, 383, 385, 387, 389, 391, 393, 395, + 397, 399, 402, 405, 408, 411, 414, 417, 420, 423, + 426, 429, 432, 435, 439, 441, 443, 445, 451, 453, + 455, 457, 460, 462, 464, 467, 469, 472, 479, 481, + 485, 487, 489, 491, 493, 495, 500, 502, 504, 506, + 508, 510, 512, 515, 517, 519, 525, 527, 530, 532, + 534, 540, 543, 544, 551, 555, 556, 558, 560, 562, + 564, 566, 569, 571, 573, 576, 581, 586, 587, 591, + 593, 595, 597, 600, 602, 604, 606, 608, 614, 616, + 620, 626, 632, 634, 638, 644, 646, 648, 650, 652, + 654, 656, 658, 660, 662, 666, 672, 680, 690, 693, + 696, 698, 700, 701, 702, 707, 709, 710, 711, 715, + 719, 721, 727, 730, 733, 736, 739, 743, 746, 750, + 751, 753, 755, 756, 758, 760, 761, 763, 765, 766, + 768, 770, 771, 775, 776, 780, 781, 785, 787, 789, + 791, 796, 798 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 116, 0, -1, 117, 118, 120, 12, -1, 3, -1, - 4, -1, 118, 119, -1, -1, 8, 98, 106, -1, - 120, 121, -1, -1, 122, 106, -1, 158, 106, -1, - 123, -1, 124, -1, 125, -1, 126, -1, 127, -1, - 128, -1, 129, -1, 130, -1, 135, -1, 131, -1, - 132, -1, 19, 139, 107, 136, -1, 18, 138, 107, - 137, -1, 16, 138, 107, 136, -1, 14, 138, 107, - 136, 107, 136, -1, 13, 138, 107, 137, 107, 137, - -1, 17, 138, 107, 137, 107, 137, 107, 137, -1, - 15, 138, 107, 137, 107, 133, 107, 134, -1, 20, - 137, -1, 82, 243, -1, 83, -1, 84, -1, 85, - -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, - -1, 91, -1, 92, -1, 93, -1, 94, -1, 21, - 138, 107, 143, 107, 140, -1, 229, 143, 155, -1, - 229, 143, 156, -1, 144, 157, -1, 152, 154, -1, - 141, 107, 141, 107, 141, 107, 141, -1, 229, 142, - -1, 22, -1, 98, -1, 98, -1, 160, -1, 145, - 108, 146, 109, -1, 174, -1, 236, -1, 98, -1, - 98, -1, 147, -1, 148, -1, 22, -1, 152, 153, - 149, -1, -1, 110, 150, -1, 111, 151, -1, 22, - -1, 22, -1, 98, -1, 102, -1, 102, -1, 102, - -1, 102, -1, 99, -1, 103, -1, -1, 99, -1, - 100, -1, 101, -1, 102, -1, -1, 159, -1, 166, - -1, 230, -1, 232, -1, 235, -1, 248, -1, 7, - 98, 112, 160, -1, 95, 161, -1, 37, 165, -1, - 59, -1, 97, 163, -1, 52, -1, 28, 241, -1, - 36, -1, 73, 242, -1, 49, 108, 164, 109, -1, - 96, 108, 162, 109, -1, 22, -1, -1, 108, 164, - 109, -1, 22, -1, 59, -1, 28, 241, -1, 36, - -1, 73, 242, -1, 167, -1, 168, -1, 10, 98, - 170, -1, 10, 98, 108, 169, 109, 171, -1, -1, - 22, -1, 112, 173, -1, 112, 113, 172, 114, -1, - 175, -1, 172, 107, 175, -1, 177, -1, 213, -1, - 223, -1, 177, -1, 213, -1, 224, -1, 176, -1, - 214, -1, 223, -1, 177, -1, 72, 201, -1, 72, - 178, -1, 72, 180, -1, 72, 183, -1, 72, 185, - -1, 72, 191, -1, 72, 187, -1, 72, 194, -1, - 72, 196, -1, 72, 198, -1, 72, 200, -1, 72, - 212, -1, 46, 240, 179, -1, 189, -1, 32, -1, - 68, -1, 42, 108, 190, 109, 181, -1, 189, -1, - 59, -1, 25, -1, 71, 182, -1, 39, -1, 31, - -1, 43, 184, -1, 24, -1, 240, 66, -1, 44, - 108, 190, 109, 240, 186, -1, 189, -1, 74, 244, - 188, -1, 28, -1, 24, -1, 30, -1, 70, -1, - 22, -1, 75, 242, 192, 193, -1, 34, -1, 53, - -1, 78, -1, 79, -1, 77, -1, 76, -1, 35, - 195, -1, 28, -1, 55, -1, 27, 108, 197, 109, - 56, -1, 22, -1, 57, 199, -1, 69, -1, 25, - -1, 203, 65, 108, 206, 109, -1, 203, 202, -1, - -1, 65, 108, 206, 104, 206, 109, -1, 48, 207, - 204, -1, -1, 205, -1, 40, -1, 81, -1, 41, - -1, 22, -1, 50, 208, -1, 62, -1, 51, -1, - 80, 242, -1, 54, 108, 210, 109, -1, 47, 108, - 211, 109, -1, -1, 108, 209, 109, -1, 22, -1, - 22, -1, 22, -1, 29, 63, -1, 217, -1, 220, - -1, 215, -1, 218, -1, 61, 33, 108, 216, 109, - -1, 221, -1, 221, 104, 221, -1, 61, 33, 108, - 221, 109, -1, 61, 45, 108, 219, 109, -1, 222, - -1, 222, 104, 222, -1, 61, 45, 108, 222, 109, - -1, 22, -1, 22, -1, 225, -1, 227, -1, 226, - -1, 227, -1, 228, -1, 23, -1, 22, -1, 113, - 228, 114, -1, 113, 228, 107, 228, 114, -1, 113, - 228, 107, 228, 107, 228, 114, -1, 113, 228, 107, - 228, 107, 228, 107, 228, 114, -1, 229, 23, -1, - 229, 22, -1, 110, -1, 111, -1, -1, -1, 11, - 231, 234, -1, -1, 5, 233, 234, -1, 234, 107, - 98, -1, 98, -1, 9, 98, 112, 236, -1, 64, - 59, -1, 64, 36, -1, 64, 237, -1, 64, 58, - -1, 64, 73, 242, -1, 64, 29, -1, 28, 238, - 239, -1, -1, 38, -1, 26, -1, -1, 60, -1, - 67, -1, -1, 38, -1, 26, -1, -1, 60, -1, - 67, -1, -1, 108, 245, 109, -1, -1, 108, 246, - 109, -1, -1, 108, 247, 109, -1, 22, -1, 22, - -1, 22, -1, 6, 98, 112, 98, -1 + 121, 0, -1, 122, 123, 125, 12, -1, 3, -1, + 4, -1, 123, 124, -1, -1, 8, 262, 108, -1, + 125, 126, -1, -1, 127, 108, -1, 170, 108, -1, + 128, -1, 129, -1, 130, -1, 131, -1, 132, -1, + 133, -1, 134, -1, 135, -1, 141, -1, 136, -1, + 137, -1, 138, -1, 19, 146, 109, 142, -1, 18, + 145, 109, 144, -1, 16, 145, 109, 142, -1, 14, + 145, 109, 142, 109, 142, -1, 13, 145, 109, 144, + 109, 144, -1, 17, 145, 109, 144, 109, 144, 109, + 144, -1, 15, 145, 109, 144, 109, 139, 109, 140, + -1, 20, 144, -1, 20, 166, -1, 22, 145, 109, + 144, 109, 144, 109, 144, 109, 139, 109, 140, -1, + 83, 256, -1, 84, -1, 85, -1, 86, -1, 87, + -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, + -1, 93, -1, 94, -1, 95, -1, 21, 145, 109, + 150, 109, 147, -1, 241, 143, -1, 241, 110, 143, + 110, -1, 150, 162, -1, 238, -1, 241, 150, 163, + -1, 241, 110, 150, 163, 110, -1, 151, 164, 165, + -1, 159, 161, -1, 148, 109, 148, 109, 148, 109, + 148, -1, 241, 149, -1, 23, -1, 262, -1, 100, + -1, 172, -1, 152, 111, 153, 112, -1, 186, -1, + 249, -1, 100, -1, 100, -1, 154, -1, 155, -1, + 23, -1, 159, 160, 156, -1, -1, 113, 157, -1, + 114, 158, -1, 23, -1, 23, -1, 100, -1, 104, + -1, 104, -1, 104, -1, 104, -1, 101, -1, 105, + -1, -1, 101, -1, 102, -1, 103, -1, 104, -1, + -1, 115, 166, 116, -1, 115, 167, 116, -1, -1, + 168, 163, -1, 169, 163, -1, 99, -1, 100, -1, + 171, -1, 178, -1, 242, -1, 245, -1, 248, -1, + 261, -1, 7, 99, 117, 172, -1, 96, 173, -1, + 38, 177, -1, 60, -1, 98, 175, -1, 53, -1, + 29, 254, -1, 37, -1, 74, 255, -1, 50, 111, + 176, 112, -1, 97, 111, 174, 112, -1, 23, -1, + -1, 111, 176, 112, -1, 23, -1, 60, -1, 29, + 254, -1, 37, -1, 74, 255, -1, 179, -1, 180, + -1, 10, 99, 182, -1, 10, 99, 111, 181, 112, + 183, -1, -1, 23, -1, 117, 185, -1, 117, 118, + 184, 119, -1, 187, -1, 184, 109, 187, -1, 189, + -1, 225, -1, 235, -1, 189, -1, 225, -1, 236, + -1, 188, -1, 226, -1, 235, -1, 189, -1, 73, + 213, -1, 73, 190, -1, 73, 192, -1, 73, 195, + -1, 73, 197, -1, 73, 203, -1, 73, 199, -1, + 73, 206, -1, 73, 208, -1, 73, 210, -1, 73, + 212, -1, 73, 224, -1, 47, 253, 191, -1, 201, + -1, 33, -1, 69, -1, 43, 111, 202, 112, 193, + -1, 201, -1, 60, -1, 26, -1, 72, 194, -1, + 40, -1, 32, -1, 44, 196, -1, 25, -1, 253, + 67, -1, 45, 111, 202, 112, 253, 198, -1, 201, + -1, 75, 257, 200, -1, 29, -1, 25, -1, 31, + -1, 71, -1, 23, -1, 76, 255, 204, 205, -1, + 35, -1, 54, -1, 79, -1, 80, -1, 78, -1, + 77, -1, 36, 207, -1, 29, -1, 56, -1, 28, + 111, 209, 112, 57, -1, 23, -1, 58, 211, -1, + 70, -1, 26, -1, 215, 66, 111, 218, 112, -1, + 215, 214, -1, -1, 66, 111, 218, 106, 218, 112, + -1, 49, 219, 216, -1, -1, 217, -1, 41, -1, + 82, -1, 42, -1, 23, -1, 51, 220, -1, 63, + -1, 52, -1, 81, 255, -1, 55, 111, 222, 112, + -1, 48, 111, 223, 112, -1, -1, 111, 221, 112, + -1, 23, -1, 23, -1, 23, -1, 30, 64, -1, + 229, -1, 232, -1, 227, -1, 230, -1, 62, 34, + 111, 228, 112, -1, 233, -1, 233, 106, 233, -1, + 62, 34, 111, 233, 112, -1, 62, 46, 111, 231, + 112, -1, 234, -1, 234, 106, 234, -1, 62, 46, + 111, 234, 112, -1, 23, -1, 23, -1, 237, -1, + 239, -1, 238, -1, 239, -1, 240, -1, 24, -1, + 23, -1, 118, 240, 119, -1, 118, 240, 109, 240, + 119, -1, 118, 240, 109, 240, 109, 240, 119, -1, + 118, 240, 109, 240, 109, 240, 109, 240, 119, -1, + 241, 24, -1, 241, 23, -1, 113, -1, 114, -1, + -1, -1, 244, 11, 243, 247, -1, 262, -1, -1, + -1, 5, 246, 247, -1, 247, 109, 99, -1, 99, + -1, 244, 9, 99, 117, 249, -1, 65, 60, -1, + 65, 37, -1, 65, 250, -1, 65, 59, -1, 65, + 74, 255, -1, 65, 30, -1, 29, 251, 252, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 111, 258, 112, -1, -1, 111, 259, 112, -1, + -1, 111, 260, 112, -1, 23, -1, 23, -1, 23, + -1, 6, 99, 117, 100, -1, 99, -1, 100, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 256, 256, 259, 267, 279, 280, 283, 307, 308, - 311, 326, 329, 334, 341, 342, 343, 344, 345, 346, - 347, 350, 351, 354, 360, 367, 374, 382, 389, 397, - 442, 449, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 469, 482, 495, 508, 530, 539, - 572, 579, 594, 649, 693, 704, 725, 735, 741, 774, - 793, 793, 795, 802, 814, 815, 816, 819, 831, 843, - 863, 874, 886, 888, 889, 890, 891, 894, 894, 894, - 894, 895, 898, 899, 900, 901, 902, 903, 906, 925, - 929, 935, 939, 943, 947, 956, 965, 969, 974, 980, - 991, 991, 992, 994, 998, 1002, 1006, 1012, 1012, 1014, - 1031, 1056, 1059, 1070, 1076, 1082, 1083, 1090, 1096, 1102, - 1110, 1116, 1122, 1130, 1136, 1142, 1150, 1151, 1154, 1155, - 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1167, - 1176, 1180, 1184, 1190, 1199, 1203, 1207, 1216, 1220, 1226, - 1232, 1239, 1244, 1252, 1262, 1264, 1272, 1278, 1282, 1286, - 1292, 1303, 1312, 1316, 1321, 1325, 1329, 1333, 1339, 1346, - 1350, 1356, 1364, 1375, 1382, 1386, 1392, 1402, 1413, 1417, - 1435, 1444, 1447, 1453, 1457, 1461, 1467, 1478, 1483, 1488, - 1493, 1498, 1503, 1511, 1514, 1519, 1532, 1540, 1551, 1559, - 1559, 1561, 1561, 1563, 1573, 1578, 1585, 1595, 1604, 1609, - 1616, 1626, 1636, 1648, 1648, 1649, 1649, 1651, 1661, 1669, - 1679, 1687, 1695, 1704, 1715, 1719, 1725, 1726, 1727, 1730, - 1730, 1733, 1733, 1736, 1743, 1752, 1766, 1775, 1784, 1788, - 1797, 1806, 1817, 1824, 1829, 1838, 1850, 1853, 1862, 1873, - 1874, 1875, 1878, 1879, 1880, 1883, 1884, 1887, 1888, 1891, - 1892, 1895, 1906, 1917, 1928 + 0, 274, 274, 277, 285, 297, 298, 301, 325, 326, + 329, 344, 347, 352, 359, 360, 361, 362, 363, 364, + 365, 368, 369, 370, 373, 379, 385, 391, 398, 404, + 411, 455, 460, 470, 514, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 534, 546, 554, + 571, 578, 595, 606, 626, 651, 658, 691, 698, 713, + 768, 809, 818, 839, 848, 852, 881, 900, 900, 902, + 909, 921, 922, 923, 926, 940, 954, 974, 985, 997, + 999, 1000, 1001, 1002, 1005, 1005, 1005, 1005, 1006, 1009, + 1013, 1018, 1025, 1032, 1039, 1062, 1085, 1086, 1087, 1088, + 1089, 1090, 1093, 1112, 1116, 1122, 1126, 1130, 1134, 1143, + 1152, 1156, 1161, 1167, 1178, 1178, 1179, 1181, 1185, 1189, + 1193, 1199, 1199, 1201, 1218, 1243, 1246, 1257, 1263, 1269, + 1270, 1277, 1283, 1289, 1297, 1303, 1309, 1317, 1323, 1329, + 1337, 1338, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, + 1349, 1350, 1351, 1354, 1363, 1367, 1371, 1377, 1386, 1390, + 1394, 1403, 1407, 1413, 1419, 1426, 1431, 1439, 1449, 1451, + 1459, 1465, 1469, 1473, 1479, 1490, 1499, 1503, 1508, 1512, + 1516, 1520, 1526, 1533, 1537, 1543, 1551, 1562, 1569, 1573, + 1579, 1589, 1600, 1604, 1622, 1631, 1634, 1640, 1644, 1648, + 1654, 1665, 1670, 1675, 1680, 1685, 1690, 1698, 1701, 1706, + 1719, 1727, 1738, 1746, 1746, 1748, 1748, 1750, 1760, 1765, + 1772, 1782, 1791, 1796, 1803, 1813, 1823, 1835, 1835, 1836, + 1836, 1838, 1848, 1856, 1866, 1874, 1882, 1891, 1902, 1906, + 1912, 1913, 1914, 1917, 1917, 1920, 1955, 1959, 1959, 1962, + 1969, 1978, 1992, 2001, 2010, 2014, 2023, 2032, 2043, 2050, + 2055, 2064, 2076, 2079, 2088, 2099, 2100, 2101, 2104, 2105, + 2106, 2109, 2110, 2113, 2114, 2117, 2118, 2121, 2132, 2143, + 2154, 2180, 2181 }; #endif @@ -801,9 +828,9 @@ static const char *const yytname[] = "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS", "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP", "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL", - "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK", - "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV", - "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", + "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", + "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", + "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL", "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL", "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE", @@ -814,49 +841,51 @@ static const char *const yytname[] = "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", - "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", - "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", - "'}'", "$accept", "program", "language", "optionSequence", "option", - "statementSequence", "statement", "instruction", "ALU_instruction", - "TexInstruction", "ARL_instruction", "VECTORop_instruction", - "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", - "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", - "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg", - "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle", - "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray", - "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel", - "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg", - "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix", - "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding", - "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", - "fragAttribItem", "PARAM_statement", "PARAM_singleStmt", - "PARAM_multipleStmt", "optArraySize", "paramSingleInit", - "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl", - "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem", - "stateSingleItem", "stateMaterialItem", "stateMatProperty", - "stateLightItem", "stateLightProperty", "stateSpotProperty", - "stateLightModelItem", "stateLModProperty", "stateLightProdItem", - "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty", - "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem", - "stateTexGenType", "stateTexGenCoord", "stateFogItem", - "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", - "statePointItem", "statePointProperty", "stateMatrixRow", - "stateMatrixRows", "optMatrixRows", "stateMatrixItem", - "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", - "stateMatrixName", "stateOptModMatNum", "stateModMatNum", - "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem", - "programSingleItem", "programMultipleItem", "progEnvParams", - "progEnvParamNums", "progEnvParam", "progLocalParams", - "progLocalParamNums", "progLocalParam", "progEnvParamNum", - "progLocalParamNum", "paramConstDecl", "paramConstUse", - "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", - "signedFloatConstant", "optionalSign", "TEMP_statement", "@1", + "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2", + "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", + "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program", + "language", "optionSequence", "option", "statementSequence", "statement", + "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", + "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", + "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", + "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget", + "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg", + "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp", + "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem", + "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset", + "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent", + "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask", + "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2", + "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem", + "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", + "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt", + "optArraySize", "paramSingleInit", "paramMultipleInit", + "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse", + "paramMultipleItem", "stateMultipleItem", "stateSingleItem", + "stateMaterialItem", "stateMatProperty", "stateLightItem", + "stateLightProperty", "stateSpotProperty", "stateLightModelItem", + "stateLModProperty", "stateLightProdItem", "stateLProdProperty", + "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty", + "stateLightNumber", "stateTexGenItem", "stateTexGenType", + "stateTexGenCoord", "stateFogItem", "stateFogProperty", + "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem", + "statePointProperty", "stateMatrixRow", "stateMatrixRows", + "optMatrixRows", "stateMatrixItem", "stateOptMatModifier", + "stateMatModifier", "stateMatrixRowNum", "stateMatrixName", + "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum", + "stateProgramMatNum", "stateDepthItem", "programSingleItem", + "programMultipleItem", "progEnvParams", "progEnvParamNums", + "progEnvParam", "progLocalParams", "progLocalParamNums", + "progLocalParam", "progEnvParamNum", "progLocalParamNum", + "paramConstDecl", "paramConstUse", "paramConstScalarDecl", + "paramConstScalarUse", "paramConstVector", "signedFloatConstant", + "optionalSign", "TEMP_statement", "@1", "optVarSize", "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", - "ALIAS_statement", 0 + "ALIAS_statement", "string", 0 }; #endif @@ -875,41 +904,43 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 59, 44, 91, 93, - 43, 45, 61, 123, 125 + 355, 356, 357, 358, 359, 360, 361, 362, 59, 44, + 124, 91, 93, 43, 45, 40, 41, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_uint16 yyr1[] = { - 0, 115, 116, 117, 117, 118, 118, 119, 120, 120, - 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, - 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 134, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 142, 143, 143, 143, 143, 144, 144, 145, - 146, 146, 147, 148, 149, 149, 149, 150, 151, 152, - 153, 154, 155, 156, 156, 156, 156, 157, 157, 157, - 157, 157, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 161, 161, 161, 161, 161, 161, 161, 161, 162, - 163, 163, 164, 165, 165, 165, 165, 166, 166, 167, - 168, 169, 169, 170, 171, 172, 172, 173, 173, 173, - 174, 174, 174, 175, 175, 175, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, - 179, 179, 179, 180, 181, 181, 181, 181, 181, 182, - 183, 184, 184, 185, 186, 187, 188, 189, 189, 189, - 190, 191, 192, 192, 193, 193, 193, 193, 194, 195, - 195, 196, 197, 198, 199, 199, 200, 201, 202, 202, - 203, 204, 204, 205, 205, 205, 206, 207, 207, 207, - 207, 207, 207, 208, 208, 209, 210, 211, 212, 213, - 213, 214, 214, 215, 216, 216, 217, 218, 219, 219, - 220, 221, 222, 223, 223, 224, 224, 225, 226, 226, - 227, 227, 227, 227, 228, 228, 229, 229, 229, 231, - 230, 233, 232, 234, 234, 235, 236, 236, 236, 236, - 236, 236, 237, 238, 238, 238, 239, 239, 239, 240, - 240, 240, 241, 241, 241, 242, 242, 243, 243, 244, - 244, 245, 246, 247, 248 + 0, 120, 121, 122, 122, 123, 123, 124, 125, 125, + 126, 126, 127, 127, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 137, 138, 139, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 141, 142, 142, + 143, 143, 144, 144, 145, 146, 147, 148, 149, 149, + 150, 150, 150, 150, 151, 151, 152, 153, 153, 154, + 155, 156, 156, 156, 157, 158, 159, 160, 161, 162, + 163, 163, 163, 163, 164, 164, 164, 164, 164, 165, + 165, 165, 166, 167, 168, 169, 170, 170, 170, 170, + 170, 170, 171, 172, 172, 173, 173, 173, 173, 173, + 173, 173, 173, 174, 175, 175, 176, 177, 177, 177, + 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, + 184, 185, 185, 185, 186, 186, 186, 187, 187, 187, + 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, + 189, 189, 189, 190, 191, 191, 191, 192, 193, 193, + 193, 193, 193, 194, 195, 196, 196, 197, 198, 199, + 200, 201, 201, 201, 202, 203, 204, 204, 205, 205, + 205, 205, 206, 207, 207, 208, 209, 210, 211, 211, + 212, 213, 214, 214, 215, 216, 216, 217, 217, 217, + 218, 219, 219, 219, 219, 219, 219, 220, 220, 221, + 222, 223, 224, 225, 225, 226, 226, 227, 228, 228, + 229, 230, 231, 231, 232, 233, 234, 235, 235, 236, + 236, 237, 238, 238, 239, 239, 239, 239, 240, 240, + 241, 241, 241, 243, 242, 244, 244, 246, 245, 247, + 247, 248, 249, 249, 249, 249, 249, 249, 250, 251, + 251, 251, 252, 252, 252, 253, 253, 253, 254, 254, + 254, 255, 255, 256, 256, 257, 257, 258, 259, 260, + 261, 262, 262 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -917,31 +948,33 @@ static const yytype_uint8 yyr2[] = { 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 6, 3, 3, 2, 2, 7, - 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, - 1, 1, 1, 3, 0, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 4, 2, - 2, 1, 2, 1, 2, 1, 2, 4, 4, 1, - 0, 3, 1, 1, 2, 1, 2, 1, 1, 3, - 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, - 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, - 2, 1, 2, 6, 1, 3, 1, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 5, 1, 2, 1, 1, 5, 2, 0, 6, - 3, 0, 1, 1, 1, 1, 1, 2, 1, 1, - 2, 4, 4, 0, 3, 1, 1, 1, 2, 1, - 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 5, 7, 9, 2, 2, 1, 1, 0, 0, - 3, 0, 3, 3, 1, 4, 2, 2, 2, 2, - 3, 2, 3, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 3, 0, 3, 0, - 3, 1, 1, 1, 4 + 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, + 8, 2, 2, 12, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 2, 4, + 2, 1, 3, 5, 3, 2, 7, 2, 1, 1, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 3, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 2, 2, 1, 2, 1, 2, 1, + 2, 4, 4, 1, 0, 3, 1, 1, 2, 1, + 2, 1, 1, 3, 6, 0, 1, 2, 4, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 1, 1, 1, 5, 1, 1, + 1, 2, 1, 1, 2, 1, 2, 6, 1, 3, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 5, 1, 2, 1, 1, + 5, 2, 0, 6, 3, 0, 1, 1, 1, 1, + 1, 2, 1, 1, 2, 4, 4, 0, 3, 1, + 1, 1, 2, 1, 1, 1, 1, 5, 1, 3, + 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 7, 9, 2, 2, + 1, 1, 0, 0, 4, 1, 0, 0, 3, 3, + 1, 5, 2, 2, 2, 2, 3, 2, 3, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 3, 0, 3, 0, 3, 1, 1, 1, + 4, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -949,272 +982,296 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 231, 0, 0, 0, 0, 229, 2, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 8, 0, 12, - 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, - 0, 82, 83, 107, 108, 84, 85, 86, 87, 7, - 0, 0, 0, 0, 0, 0, 0, 58, 0, 81, - 57, 0, 0, 0, 0, 0, 69, 0, 0, 226, - 227, 30, 0, 0, 10, 11, 234, 232, 0, 0, - 0, 111, 228, 109, 230, 243, 241, 237, 239, 236, - 255, 238, 228, 77, 78, 79, 80, 47, 228, 228, - 228, 228, 228, 228, 71, 48, 219, 218, 0, 0, - 0, 0, 53, 228, 76, 0, 54, 56, 120, 121, - 199, 200, 122, 215, 216, 0, 0, 264, 88, 235, - 112, 0, 113, 117, 118, 119, 213, 214, 217, 0, - 245, 244, 246, 0, 240, 0, 0, 0, 0, 25, - 0, 24, 23, 252, 105, 103, 255, 90, 0, 0, - 0, 0, 0, 0, 249, 0, 249, 0, 0, 259, - 255, 128, 129, 130, 131, 133, 132, 134, 135, 136, - 137, 0, 138, 252, 95, 0, 93, 91, 255, 0, - 100, 89, 0, 74, 73, 75, 46, 0, 0, 233, - 0, 225, 224, 247, 248, 242, 261, 0, 228, 228, - 0, 0, 228, 253, 254, 104, 106, 0, 0, 0, - 198, 169, 170, 168, 0, 151, 251, 250, 150, 0, - 0, 0, 0, 193, 189, 0, 188, 255, 181, 175, - 174, 173, 0, 0, 0, 0, 94, 0, 96, 0, - 0, 92, 228, 220, 62, 0, 60, 61, 0, 228, - 0, 110, 256, 27, 26, 72, 45, 257, 0, 0, - 211, 0, 212, 0, 172, 0, 160, 0, 152, 0, - 157, 158, 141, 142, 159, 139, 140, 0, 0, 187, - 0, 190, 183, 185, 184, 180, 182, 263, 0, 156, - 155, 162, 163, 0, 0, 102, 0, 99, 0, 0, - 0, 55, 70, 64, 44, 0, 0, 228, 0, 31, - 0, 228, 206, 210, 0, 0, 249, 197, 0, 195, - 0, 196, 0, 260, 167, 166, 164, 165, 161, 186, - 0, 97, 98, 101, 228, 221, 0, 0, 63, 228, - 51, 52, 50, 0, 0, 0, 115, 123, 126, 124, - 201, 202, 125, 262, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 29, 28, 171, - 146, 148, 145, 0, 143, 144, 0, 192, 194, 191, - 176, 0, 67, 65, 68, 66, 0, 0, 0, 127, - 178, 228, 114, 258, 149, 147, 153, 154, 228, 222, - 228, 0, 0, 0, 177, 116, 0, 0, 0, 204, - 0, 208, 0, 223, 228, 203, 0, 207, 0, 0, - 49, 205, 209, 0, 0, 179 + 0, 3, 4, 0, 6, 1, 9, 0, 5, 246, + 281, 282, 0, 247, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 242, 0, 0, 8, 0, + 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, + 23, 20, 0, 96, 97, 121, 122, 98, 0, 99, + 100, 101, 245, 7, 0, 0, 0, 0, 0, 65, + 0, 88, 64, 0, 0, 0, 0, 0, 76, 0, + 0, 94, 240, 241, 31, 32, 83, 0, 0, 0, + 10, 11, 0, 243, 250, 248, 0, 0, 125, 242, + 123, 259, 257, 253, 255, 252, 271, 254, 242, 84, + 85, 86, 87, 91, 242, 242, 242, 242, 242, 242, + 78, 55, 81, 80, 82, 92, 233, 232, 0, 0, + 0, 0, 60, 0, 242, 83, 0, 61, 63, 134, + 135, 213, 214, 136, 229, 230, 0, 242, 0, 0, + 0, 280, 102, 126, 0, 127, 131, 132, 133, 227, + 228, 231, 0, 261, 260, 262, 0, 256, 0, 0, + 54, 0, 0, 0, 26, 0, 25, 24, 268, 119, + 117, 271, 104, 0, 0, 0, 0, 0, 0, 265, + 0, 265, 0, 0, 275, 271, 142, 143, 144, 145, + 147, 146, 148, 149, 150, 151, 0, 152, 268, 109, + 0, 107, 105, 271, 0, 114, 103, 83, 0, 52, + 0, 0, 0, 0, 244, 249, 0, 239, 238, 263, + 264, 258, 277, 0, 242, 95, 0, 0, 83, 242, + 0, 48, 0, 51, 0, 242, 269, 270, 118, 120, + 0, 0, 0, 212, 183, 184, 182, 0, 165, 267, + 266, 164, 0, 0, 0, 0, 207, 203, 0, 202, + 271, 195, 189, 188, 187, 0, 0, 0, 0, 108, + 0, 110, 0, 0, 106, 0, 242, 234, 69, 0, + 67, 68, 0, 242, 242, 251, 0, 124, 272, 28, + 89, 90, 93, 27, 0, 79, 50, 273, 0, 0, + 225, 0, 226, 0, 186, 0, 174, 0, 166, 0, + 171, 172, 155, 156, 173, 153, 154, 0, 0, 201, + 0, 204, 197, 199, 198, 194, 196, 279, 0, 170, + 169, 176, 177, 0, 0, 116, 0, 113, 0, 0, + 53, 0, 62, 77, 71, 47, 0, 0, 0, 242, + 49, 0, 34, 0, 242, 220, 224, 0, 0, 265, + 211, 0, 209, 0, 210, 0, 276, 181, 180, 178, + 179, 175, 200, 0, 111, 112, 115, 242, 235, 0, + 0, 70, 242, 58, 57, 59, 242, 0, 0, 0, + 129, 137, 140, 138, 215, 216, 139, 278, 0, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 30, 29, 185, 160, 162, 159, 0, 157, 158, + 0, 206, 208, 205, 190, 0, 74, 72, 75, 73, + 0, 0, 0, 0, 141, 192, 242, 128, 274, 163, + 161, 167, 168, 242, 236, 242, 0, 0, 0, 0, + 191, 130, 0, 0, 0, 0, 218, 0, 222, 0, + 237, 242, 0, 217, 0, 221, 0, 0, 56, 33, + 219, 223, 0, 0, 193 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 268, 377, - 39, 146, 71, 58, 67, 314, 315, 352, 114, 59, - 115, 255, 256, 257, 348, 393, 395, 68, 313, 105, - 266, 196, 97, 40, 41, 116, 191, 308, 251, 306, - 157, 42, 43, 44, 131, 83, 261, 355, 132, 117, - 356, 357, 118, 171, 285, 172, 384, 405, 173, 228, - 174, 406, 175, 300, 286, 277, 176, 303, 338, 177, - 223, 178, 275, 179, 241, 180, 399, 414, 181, 295, - 296, 340, 238, 289, 330, 332, 328, 182, 119, 359, - 360, 418, 120, 361, 420, 121, 271, 273, 362, 122, - 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, - 47, 60, 91, 142, 205, 229, 215, 144, 319, 243, - 207, 364, 298, 48 + -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 298, + 411, 41, 161, 231, 74, 60, 69, 345, 346, 384, + 232, 61, 126, 279, 280, 281, 381, 427, 429, 70, + 344, 111, 296, 115, 103, 160, 75, 227, 76, 228, + 42, 43, 127, 206, 338, 274, 336, 172, 44, 45, + 46, 144, 90, 287, 389, 145, 128, 390, 391, 129, + 186, 315, 187, 418, 440, 188, 251, 189, 441, 190, + 330, 316, 307, 191, 333, 371, 192, 246, 193, 305, + 194, 264, 195, 434, 450, 196, 325, 326, 373, 261, + 319, 363, 365, 361, 197, 130, 393, 394, 455, 131, + 395, 457, 132, 301, 303, 396, 133, 149, 134, 135, + 151, 77, 47, 139, 48, 49, 54, 85, 50, 62, + 97, 155, 221, 252, 238, 157, 352, 266, 223, 398, + 328, 51, 12 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -369 +#define YYPACT_NINF -401 static const yytype_int16 yypact[] = { - 143, -369, -369, 36, -369, -369, 45, -39, -369, 169, - -33, -369, -19, -6, -4, 12, -369, -369, -34, -34, - -34, -34, -34, -34, 15, 62, -34, -369, 26, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - 60, -369, -369, -369, -369, -369, -369, -369, -369, -369, - 20, 56, 107, 110, 37, 20, -3, -369, 111, 109, - -369, 113, 114, 116, 117, 118, -369, 119, 125, -369, - -369, -369, -15, 121, -369, -369, -369, 122, 132, -18, - 167, 210, -11, -369, 122, 63, -369, -369, -369, -369, - 130, -369, 62, -369, -369, -369, -369, -369, 62, 62, - 62, 62, 62, 62, -369, -369, -369, -369, 9, 72, - 87, -1, 131, 62, 104, 134, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -15, 142, -369, -369, -369, - -369, 135, -369, -369, -369, -369, -369, -369, -369, 182, - -369, -369, 52, 219, -369, 138, 139, -15, 140, -369, - 141, -369, -369, 61, -369, -369, 130, -369, 144, 145, - 146, 180, 11, 147, 85, 148, 99, 89, -2, 149, - 130, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, 184, -369, 61, -369, 150, -369, -369, 130, 151, - 152, -369, 27, -369, -369, -369, -369, -10, 154, -369, - 153, -369, -369, -369, -369, -369, -369, 155, 62, 62, - 161, 168, 62, -369, -369, -369, -369, 229, 244, 246, - -369, -369, -369, -369, 247, -369, -369, -369, -369, 204, - 247, 17, 163, 164, -369, 165, -369, 130, 67, -369, - -369, -369, 252, 248, 18, 170, -369, 253, -369, 255, - 253, -369, 62, -369, -369, 171, -369, -369, 177, 62, - 172, -369, -369, -369, -369, -369, -369, 173, 175, 176, - -369, 178, -369, 179, -369, 181, -369, 183, -369, 185, - -369, -369, -369, -369, -369, -369, -369, 262, 264, -369, - 267, -369, -369, -369, -369, -369, -369, -369, 186, -369, - -369, -369, -369, 136, 269, -369, 187, -369, 188, 190, - 43, -369, -369, 106, -369, 193, -5, -7, 271, -369, - 108, 62, -369, -369, 245, 4, 99, -369, 194, -369, - 195, -369, 196, -369, -369, -369, -369, -369, -369, -369, - 197, -369, -369, -369, 62, -369, 280, 285, -369, 62, - -369, -369, -369, 93, 87, 53, -369, -369, -369, -369, - -369, -369, -369, -369, 199, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, 278, -369, -369, 8, -369, -369, -369, - -369, 57, -369, -369, -369, -369, 203, 205, 206, -369, - 250, -7, -369, -369, -369, -369, -369, -369, 62, -369, - 62, 229, 244, 208, -369, -369, 198, 211, 202, 213, - 214, 218, 269, -369, 62, -369, 229, -369, 244, 54, - -369, -369, -369, 269, 215, -369 + 193, -401, -401, 27, -401, -401, 62, 143, -401, 24, + -401, -401, -30, -401, -18, 12, 83, -401, 15, 15, + 15, 15, 15, 15, 67, 61, 15, 15, -401, 127, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, 144, -401, -401, -401, -401, -401, 204, -401, + -401, -401, -401, -401, 155, 136, 138, 34, 140, -401, + 147, 108, -401, 150, 156, 157, 158, 160, -401, 162, + 159, -401, -401, -401, -401, -401, 102, -13, 163, 164, + -401, -401, 165, -401, -401, 166, 170, 10, 235, 0, + -401, 141, -401, -401, -401, -401, 167, -401, 131, -401, + -401, -401, -401, 168, 131, 131, 131, 131, 131, 131, + -401, -401, -401, -401, -401, -401, -401, -401, 104, 97, + 114, 38, 169, 30, 131, 102, 171, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 30, 131, 172, 155, + 175, -401, -401, -401, 173, -401, -401, -401, -401, -401, + -401, -401, 223, -401, -401, 123, 253, -401, 177, 149, + -401, 178, -10, 181, -401, 182, -401, -401, 134, -401, + -401, 167, -401, 183, 184, 185, 213, 99, 186, 154, + 187, 146, 153, 7, 188, 167, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 215, -401, 134, -401, + 190, -401, -401, 167, 191, 192, -401, 102, -48, -401, + 1, 195, 196, 214, 166, -401, 189, -401, -401, -401, + -401, -401, -401, 180, 131, -401, 194, 197, 102, 131, + 30, -401, 203, 205, 201, 131, -401, -401, -401, -401, + 285, 288, 289, -401, -401, -401, -401, 291, -401, -401, + -401, -401, 248, 291, 33, 206, 207, -401, 208, -401, + 167, 14, -401, -401, -401, 293, 292, 92, 209, -401, + 299, -401, 301, 299, -401, 216, 131, -401, -401, 217, + -401, -401, 221, 131, 131, -401, 212, -401, -401, -401, + -401, -401, -401, -401, 218, -401, -401, 220, 224, 225, + -401, 226, -401, 227, -401, 228, -401, 230, -401, 231, + -401, -401, -401, -401, -401, -401, -401, 304, 309, -401, + 312, -401, -401, -401, -401, -401, -401, -401, 232, -401, + -401, -401, -401, 161, 313, -401, 233, -401, 234, 238, + -401, 13, -401, -401, 137, -401, 242, -15, 243, 3, + -401, 314, -401, 133, 131, -401, -401, 296, 94, 146, + -401, 245, -401, 246, -401, 247, -401, -401, -401, -401, + -401, -401, -401, 249, -401, -401, -401, 131, -401, 332, + 337, -401, 131, -401, -401, -401, 131, 142, 114, 28, + -401, -401, -401, -401, -401, -401, -401, -401, 250, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, 331, -401, -401, + 68, -401, -401, -401, -401, 43, -401, -401, -401, -401, + 255, 256, 257, 258, -401, 300, 3, -401, -401, -401, + -401, -401, -401, 131, -401, 131, 201, 285, 288, 259, + -401, -401, 252, 264, 265, 263, 261, 266, 270, 313, + -401, 131, 133, -401, 285, -401, 288, 80, -401, -401, + -401, -401, 313, 267, -401 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -94, -88, 133, -369, -369, -334, -369, -85, -369, - -369, -369, -369, -369, -369, -369, -369, 128, -369, -369, - -369, -369, -369, -369, -369, 251, -369, -369, -369, 77, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -72, -369, -81, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -305, 101, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -22, -369, - -369, -336, -369, -369, -369, -369, -369, -369, 254, -369, - -369, -369, -369, -369, -369, -369, -342, -368, 256, -369, - -369, -369, -80, -110, -82, -369, -369, -369, -369, 279, - -369, 257, -369, -369, -369, -161, 156, -146, -369, -369, - -369, -369, -369, -369 + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -69, + -82, -401, -100, 151, -86, 210, -401, -401, -366, -401, + -54, -401, -401, -401, -401, -401, -401, -401, -401, 174, + -401, -401, -401, -118, -401, -401, 229, -401, -401, -401, + -401, -401, 295, -401, -401, -401, 110, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -51, -401, -88, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -311, 139, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -2, -401, -401, -400, -401, + -401, -401, -401, -401, -401, 298, -401, -401, -401, -401, + -401, -401, -401, -390, -295, 302, -401, -401, -136, -87, + -120, -89, -401, -401, -401, -401, -401, 251, -401, 176, + -401, -401, -401, -176, 198, -153, -401, -401, -401, -401, + -401, -401, -6 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -60 +#define YYTABLE_NINF -230 static const yytype_int16 yytable[] = { - 139, 133, 137, 192, 145, 231, 149, 106, 107, 152, - 216, 148, 254, 150, 151, 396, 147, 350, 147, 108, - 385, 147, 108, 239, 244, 85, 86, 183, 280, 380, - 56, 139, 280, 87, 281, 184, 5, 153, 281, 221, - 198, 280, 248, 381, 421, 154, 109, 281, 185, 282, - 109, 186, 301, 7, 353, 88, 89, 110, 187, 10, - 432, 110, 210, 382, 57, 354, 222, 240, 155, 419, - 90, 302, 188, 49, 284, 383, 417, 111, 284, 51, - 111, 407, 156, 112, 431, 283, 429, 284, 66, 140, - 430, 291, 52, 351, 53, 189, 190, 434, 113, 69, - 70, 141, 113, 69, 70, 158, 113, 292, 293, 225, - 54, 226, 203, 66, 160, 264, 161, 159, 76, 204, - 263, 213, 162, 227, 269, 226, 397, 147, 214, 163, - 164, 165, 74, 166, 252, 167, 232, 227, 398, 233, - 234, 253, 310, 235, 168, 81, 1, 2, 294, 82, - 344, 236, 61, 62, 63, 64, 65, 345, 433, 73, - 401, 169, 170, 390, 408, 386, 75, 402, 78, 237, - 139, 409, 69, 70, 11, 12, 13, 316, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 193, 201, 202, 194, 195, 93, 94, - 95, 96, 334, 335, 336, 337, 346, 347, 92, 79, - 98, 99, 80, 100, 101, 102, 103, 104, 125, 126, - 127, 56, 130, 378, 391, 139, 358, 137, 143, -59, - 199, 206, 197, 220, 200, 208, 209, 211, 212, 245, - 267, 270, 217, 218, 219, 224, 230, 242, 247, 249, - 250, 259, 139, 265, 262, 260, 272, 316, 274, 276, - 278, 287, 288, 290, 297, 305, 299, 307, 304, 312, - 311, 318, 320, 321, 327, 317, 329, 322, 323, 331, - 324, 339, 325, 363, 326, 333, 341, 342, 416, 343, - 349, 379, 392, 387, 388, 389, 390, 394, 403, 404, - 410, 425, 423, 411, 412, 413, 422, 426, 424, 139, - 358, 137, 428, 427, 435, 258, 139, 309, 316, 415, - 128, 279, 400, 0, 84, 0, 134, 129, 135, 246, - 0, 0, 316 + 152, 146, 150, 52, 208, 254, 164, 209, 383, 167, + 116, 117, 158, 116, 117, 162, 430, 162, 239, 163, + 162, 165, 166, 125, 278, 118, 233, 5, 118, 13, + 14, 15, 267, 262, 16, 152, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 419, 118, 119, + 271, 212, 119, 116, 117, 322, 323, 456, 310, 467, + 120, 276, 119, 120, 311, 387, 312, 198, 118, 207, + 7, 277, 473, 120, 470, 199, 388, 263, 53, 453, + 58, 55, 211, 121, 10, 11, 121, 122, 200, 275, + 122, 201, 119, 310, 233, 468, 324, 123, 202, 311, + 230, 68, 313, 120, 314, 124, 121, 321, 124, 442, + 292, 56, 203, 72, 73, 59, 72, 73, 124, 310, + 414, 124, 377, 10, 11, 311, 121, 331, 244, 293, + 122, 173, 378, 168, 415, 204, 205, 436, 289, 314, + 162, 169, 175, 174, 176, 88, 332, 437, 124, 299, + 177, 89, 443, 458, 416, 245, 341, 178, 179, 180, + 71, 181, 444, 182, 170, 314, 417, 68, 153, 91, + 92, 471, 183, 249, 72, 73, 432, 93, 171, 248, + 154, 249, 57, 420, 219, 250, 472, 152, 433, 184, + 185, 220, 424, 250, 347, 236, 1, 2, 348, 94, + 95, 255, 237, 112, 256, 257, 113, 114, 258, 99, + 100, 101, 102, 82, 96, 83, 259, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 63, + 64, 65, 66, 67, 260, 80, 78, 79, 367, 368, + 369, 370, 10, 11, 72, 73, 217, 218, 71, 225, + 379, 380, 81, 86, 84, 87, 98, 425, 143, 104, + 152, 392, 150, 110, 138, 105, 106, 107, 412, 108, + 141, 109, 136, 137, 215, 140, 222, 243, 156, 58, + -66, 268, 210, 159, 297, 216, 224, 229, 152, 213, + 234, 235, 288, 347, 240, 241, 242, 247, 253, 265, + 431, 270, 272, 273, 283, 284, 286, 295, 300, -229, + 290, 302, 304, 291, 306, 308, 327, 317, 318, 320, + 334, 329, 335, 452, 337, 343, 340, 360, 350, 342, + 349, 351, 362, 353, 354, 364, 372, 397, 355, 356, + 357, 385, 358, 359, 366, 374, 375, 152, 392, 150, + 376, 382, 386, 413, 152, 426, 347, 421, 422, 423, + 428, 424, 438, 439, 445, 446, 449, 464, 447, 448, + 459, 460, 347, 461, 462, 463, 466, 454, 465, 474, + 469, 294, 142, 339, 282, 451, 435, 147, 226, 285, + 214, 148, 309, 0, 0, 0, 269 }; static const yytype_int16 yycheck[] = { - 82, 82, 82, 113, 92, 166, 100, 22, 23, 103, - 156, 99, 22, 101, 102, 349, 98, 22, 100, 37, - 325, 103, 37, 25, 170, 28, 29, 28, 24, 25, - 64, 113, 24, 36, 30, 36, 0, 28, 30, 28, - 125, 24, 188, 39, 412, 36, 61, 30, 49, 32, - 61, 52, 34, 8, 61, 58, 59, 72, 59, 98, - 428, 72, 147, 59, 98, 72, 55, 69, 59, 411, - 73, 53, 73, 106, 70, 71, 410, 95, 70, 98, - 95, 386, 73, 98, 426, 68, 422, 70, 98, 26, - 424, 237, 98, 98, 98, 96, 97, 433, 113, 110, - 111, 38, 113, 110, 111, 33, 113, 40, 41, 24, - 98, 26, 60, 98, 27, 209, 29, 45, 98, 67, - 208, 60, 35, 38, 212, 26, 33, 209, 67, 42, - 43, 44, 106, 46, 107, 48, 47, 38, 45, 50, - 51, 114, 252, 54, 57, 108, 3, 4, 81, 112, - 107, 62, 19, 20, 21, 22, 23, 114, 104, 26, - 107, 74, 75, 109, 107, 326, 106, 114, 112, 80, - 252, 114, 110, 111, 5, 6, 7, 259, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 99, 22, 23, 102, 103, 99, 100, - 101, 102, 76, 77, 78, 79, 110, 111, 107, 112, - 107, 107, 112, 107, 107, 107, 107, 102, 107, 107, - 98, 64, 22, 321, 344, 317, 317, 317, 108, 108, - 98, 22, 108, 63, 109, 107, 107, 107, 107, 65, - 82, 22, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 107, 344, 102, 109, 112, 22, 349, 22, 22, - 66, 108, 108, 108, 22, 22, 28, 22, 108, 102, - 109, 108, 107, 107, 22, 113, 22, 109, 109, 22, - 109, 22, 109, 22, 109, 109, 109, 109, 408, 109, - 107, 56, 22, 109, 109, 109, 109, 22, 109, 31, - 107, 109, 114, 108, 108, 65, 108, 104, 107, 401, - 401, 401, 104, 109, 109, 197, 408, 250, 410, 401, - 79, 230, 354, -1, 55, -1, 82, 80, 82, 183, - -1, -1, 424 + 89, 89, 89, 9, 124, 181, 106, 125, 23, 109, + 23, 24, 98, 23, 24, 104, 382, 106, 171, 105, + 109, 107, 108, 77, 23, 38, 162, 0, 38, 5, + 6, 7, 185, 26, 10, 124, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 358, 38, 62, + 203, 137, 62, 23, 24, 41, 42, 447, 25, 459, + 73, 109, 62, 73, 31, 62, 33, 29, 38, 123, + 8, 119, 472, 73, 464, 37, 73, 70, 108, 445, + 65, 99, 136, 96, 99, 100, 96, 100, 50, 207, + 100, 53, 62, 25, 230, 461, 82, 110, 60, 31, + 110, 100, 69, 73, 71, 118, 96, 260, 118, 420, + 228, 99, 74, 113, 114, 100, 113, 114, 118, 25, + 26, 118, 109, 99, 100, 31, 96, 35, 29, 229, + 100, 34, 119, 29, 40, 97, 98, 109, 224, 71, + 229, 37, 28, 46, 30, 111, 54, 119, 118, 235, + 36, 117, 109, 448, 60, 56, 276, 43, 44, 45, + 99, 47, 119, 49, 60, 71, 72, 100, 27, 29, + 30, 466, 58, 27, 113, 114, 34, 37, 74, 25, + 39, 27, 99, 359, 61, 39, 106, 276, 46, 75, + 76, 68, 112, 39, 283, 61, 3, 4, 284, 59, + 60, 48, 68, 101, 51, 52, 104, 105, 55, 101, + 102, 103, 104, 9, 74, 11, 63, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 19, + 20, 21, 22, 23, 81, 108, 26, 27, 77, 78, + 79, 80, 99, 100, 113, 114, 23, 24, 99, 100, + 113, 114, 108, 117, 99, 117, 109, 377, 23, 109, + 349, 349, 349, 104, 99, 109, 109, 109, 354, 109, + 100, 109, 109, 109, 99, 109, 23, 64, 111, 65, + 111, 66, 111, 115, 83, 112, 109, 109, 377, 117, + 109, 109, 112, 382, 111, 111, 111, 111, 111, 111, + 386, 111, 111, 111, 109, 109, 117, 104, 23, 104, + 116, 23, 23, 116, 23, 67, 23, 111, 111, 111, + 111, 29, 23, 443, 23, 104, 110, 23, 110, 112, + 118, 111, 23, 109, 109, 23, 23, 23, 112, 112, + 112, 347, 112, 112, 112, 112, 112, 436, 436, 436, + 112, 109, 109, 57, 443, 23, 445, 112, 112, 112, + 23, 112, 112, 32, 109, 109, 66, 106, 111, 111, + 111, 119, 461, 109, 109, 112, 106, 446, 112, 112, + 462, 230, 87, 273, 210, 436, 388, 89, 159, 213, + 139, 89, 253, -1, -1, -1, 198 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_uint16 yystos[] = { - 0, 3, 4, 116, 117, 0, 118, 8, 119, 120, - 98, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 135, - 158, 159, 166, 167, 168, 230, 232, 235, 248, 106, - 233, 98, 98, 98, 98, 231, 64, 98, 138, 144, - 236, 138, 138, 138, 138, 138, 98, 139, 152, 110, - 111, 137, 229, 138, 106, 106, 98, 234, 112, 112, - 112, 108, 112, 170, 234, 28, 29, 36, 58, 59, - 73, 237, 107, 99, 100, 101, 102, 157, 107, 107, - 107, 107, 107, 107, 102, 154, 22, 23, 37, 61, - 72, 95, 98, 113, 143, 145, 160, 174, 177, 213, - 217, 220, 224, 226, 227, 107, 107, 98, 160, 236, - 22, 169, 173, 177, 213, 223, 225, 227, 228, 229, - 26, 38, 238, 108, 242, 137, 136, 229, 137, 136, - 137, 137, 136, 28, 36, 59, 73, 165, 33, 45, - 27, 29, 35, 42, 43, 44, 46, 48, 57, 74, - 75, 178, 180, 183, 185, 187, 191, 194, 196, 198, - 200, 203, 212, 28, 36, 49, 52, 59, 73, 96, - 97, 161, 228, 99, 102, 103, 156, 108, 143, 98, - 109, 22, 23, 60, 67, 239, 22, 245, 107, 107, - 143, 107, 107, 60, 67, 241, 242, 108, 108, 108, - 63, 28, 55, 195, 108, 24, 26, 38, 184, 240, - 108, 240, 47, 50, 51, 54, 62, 80, 207, 25, - 69, 199, 108, 244, 242, 65, 241, 108, 242, 108, - 108, 163, 107, 114, 22, 146, 147, 148, 152, 107, - 112, 171, 109, 137, 136, 102, 155, 82, 133, 137, - 22, 221, 22, 222, 22, 197, 22, 190, 66, 190, - 24, 30, 32, 68, 70, 179, 189, 108, 108, 208, - 108, 242, 40, 41, 81, 204, 205, 22, 247, 28, - 188, 34, 53, 192, 108, 22, 164, 22, 162, 164, - 228, 109, 102, 153, 140, 141, 229, 113, 108, 243, - 107, 107, 109, 109, 109, 109, 109, 22, 211, 22, - 209, 22, 210, 109, 76, 77, 78, 79, 193, 22, - 206, 109, 109, 109, 107, 114, 110, 111, 149, 107, - 22, 98, 142, 61, 72, 172, 175, 176, 177, 214, - 215, 218, 223, 22, 246, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 134, 137, 56, - 25, 39, 59, 71, 181, 189, 240, 109, 109, 109, - 109, 228, 22, 150, 22, 151, 141, 33, 45, 201, - 203, 107, 114, 109, 31, 182, 186, 189, 107, 114, - 107, 108, 108, 65, 202, 175, 228, 141, 216, 221, - 219, 222, 108, 114, 107, 109, 104, 109, 104, 206, - 141, 221, 222, 104, 206, 109 + 0, 3, 4, 121, 122, 0, 123, 8, 124, 125, + 99, 100, 262, 5, 6, 7, 10, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 141, 170, 171, 178, 179, 180, 242, 244, 245, + 248, 261, 262, 108, 246, 99, 99, 99, 65, 100, + 145, 151, 249, 145, 145, 145, 145, 145, 100, 146, + 159, 99, 113, 114, 144, 166, 168, 241, 145, 145, + 108, 108, 9, 11, 99, 247, 117, 117, 111, 117, + 182, 29, 30, 37, 59, 60, 74, 250, 109, 101, + 102, 103, 104, 164, 109, 109, 109, 109, 109, 109, + 104, 161, 101, 104, 105, 163, 23, 24, 38, 62, + 73, 96, 100, 110, 118, 150, 152, 172, 186, 189, + 225, 229, 232, 236, 238, 239, 109, 109, 99, 243, + 109, 100, 172, 23, 181, 185, 189, 225, 235, 237, + 239, 240, 241, 27, 39, 251, 111, 255, 144, 115, + 165, 142, 241, 144, 142, 144, 144, 142, 29, 37, + 60, 74, 177, 34, 46, 28, 30, 36, 43, 44, + 45, 47, 49, 58, 75, 76, 190, 192, 195, 197, + 199, 203, 206, 208, 210, 212, 215, 224, 29, 37, + 50, 53, 60, 74, 97, 98, 173, 150, 240, 163, + 111, 150, 144, 117, 247, 99, 112, 23, 24, 61, + 68, 252, 23, 258, 109, 100, 166, 167, 169, 109, + 110, 143, 150, 238, 109, 109, 61, 68, 254, 255, + 111, 111, 111, 64, 29, 56, 207, 111, 25, 27, + 39, 196, 253, 111, 253, 48, 51, 52, 55, 63, + 81, 219, 26, 70, 211, 111, 257, 255, 66, 254, + 111, 255, 111, 111, 175, 163, 109, 119, 23, 153, + 154, 155, 159, 109, 109, 249, 117, 183, 112, 144, + 116, 116, 163, 142, 143, 104, 162, 83, 139, 144, + 23, 233, 23, 234, 23, 209, 23, 202, 67, 202, + 25, 31, 33, 69, 71, 191, 201, 111, 111, 220, + 111, 255, 41, 42, 82, 216, 217, 23, 260, 29, + 200, 35, 54, 204, 111, 23, 176, 23, 174, 176, + 110, 240, 112, 104, 160, 147, 148, 241, 144, 118, + 110, 111, 256, 109, 109, 112, 112, 112, 112, 112, + 23, 223, 23, 221, 23, 222, 112, 77, 78, 79, + 80, 205, 23, 218, 112, 112, 112, 109, 119, 113, + 114, 156, 109, 23, 149, 262, 109, 62, 73, 184, + 187, 188, 189, 226, 227, 230, 235, 23, 259, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 140, 144, 57, 26, 40, 60, 72, 193, 201, + 253, 112, 112, 112, 112, 240, 23, 157, 23, 158, + 148, 144, 34, 46, 213, 215, 109, 119, 112, 32, + 194, 198, 201, 109, 119, 109, 109, 111, 111, 66, + 214, 187, 240, 148, 139, 228, 233, 231, 234, 111, + 119, 109, 109, 112, 106, 112, 106, 218, 148, 140, + 233, 234, 106, 218, 112 }; #define yyerrok (yyerrstatus = 0) @@ -2068,7 +2125,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 260 "program_parse.y" +#line 278 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2081,7 +2138,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 268 "program_parse.y" +#line 286 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2096,7 +2153,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 284 "program_parse.y" +#line 302 "program_parse.y" { int valid = 0; @@ -2123,7 +2180,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 312 "program_parse.y" +#line 330 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2143,7 +2200,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 330 "program_parse.y" +#line 348 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2153,85 +2210,79 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 335 "program_parse.y" +#line 353 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; ;} break; - case 23: + case 24: /* Line 1455 of yacc.c */ -#line 355 "program_parse.y" +#line 374 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 24: + case 25: /* Line 1455 of yacc.c */ -#line 361 "program_parse.y" +#line 380 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 25: + case 26: /* Line 1455 of yacc.c */ -#line 368 "program_parse.y" +#line 386 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 26: + case 27: /* Line 1455 of yacc.c */ -#line 375 "program_parse.y" +#line 392 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; - case 27: + case 28: /* Line 1455 of yacc.c */ -#line 383 "program_parse.y" +#line 399 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; - case 28: + case 29: /* Line 1455 of yacc.c */ -#line 391 "program_parse.y" +#line 406 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} break; - case 29: + case 30: /* Line 1455 of yacc.c */ -#line 398 "program_parse.y" +#line 412 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { const GLbitfield tex_mask = (1U << (yyvsp[(6) - (8)].integer)); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; (yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer); if ((yyvsp[(8) - (8)].integer) < 0) { @@ -2267,113 +2318,173 @@ yyreduce: ;} break; - case 30: + case 31: /* Line 1455 of yacc.c */ -#line 443 "program_parse.y" +#line 456 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; ;} break; - case 31: + case 32: + +/* Line 1455 of yacc.c */ +#line 461 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; + (yyval.inst)->Base.DstReg.CondSwizzle = (yyvsp[(2) - (2)].dst_reg).CondSwizzle; + (yyval.inst)->Base.DstReg.CondSrc = (yyvsp[(2) - (2)].dst_reg).CondSrc; + state->fragment.UsesKill = 1; + ;} + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 471 "program_parse.y" + { + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); + if ((yyval.inst) != NULL) { + const GLbitfield tex_mask = (1U << (yyvsp[(10) - (12)].integer)); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + (yyval.inst)->Base.TexSrcUnit = (yyvsp[(10) - (12)].integer); + + if ((yyvsp[(12) - (12)].integer) < 0) { + shadow_tex = tex_mask; + + (yyval.inst)->Base.TexSrcTarget = -(yyvsp[(12) - (12)].integer); + (yyval.inst)->Base.TexShadow = 1; + } else { + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(12) - (12)].integer); + } + + target_mask = (1U << (yyval.inst)->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[(yyvsp[(10) - (12)].integer)] != 0) + && ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& (yylsp[(12) - (12)]), state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + ;} + break; + + case 34: /* Line 1455 of yacc.c */ -#line 450 "program_parse.y" +#line 515 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 32: + case 35: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 520 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; - case 33: + case 36: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 521 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; - case 34: + case 37: /* Line 1455 of yacc.c */ -#line 457 "program_parse.y" +#line 522 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; - case 35: + case 38: /* Line 1455 of yacc.c */ -#line 458 "program_parse.y" +#line 523 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; - case 36: + case 39: /* Line 1455 of yacc.c */ -#line 459 "program_parse.y" +#line 524 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; - case 37: + case 40: /* Line 1455 of yacc.c */ -#line 460 "program_parse.y" +#line 525 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; - case 38: + case 41: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 526 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; - case 39: + case 42: /* Line 1455 of yacc.c */ -#line 462 "program_parse.y" +#line 527 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; - case 40: + case 43: /* Line 1455 of yacc.c */ -#line 463 "program_parse.y" +#line 528 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; - case 41: + case 44: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 529 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; - case 42: + case 45: /* Line 1455 of yacc.c */ -#line 465 "program_parse.y" +#line 530 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; - case 43: + case 46: /* Line 1455 of yacc.c */ -#line 466 "program_parse.y" +#line 531 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; - case 44: + case 47: /* Line 1455 of yacc.c */ -#line 470 "program_parse.y" +#line 535 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2381,31 +2492,79 @@ yyreduce: (yyvsp[(4) - (6)].src_reg).Base.Swizzle = (yyvsp[(6) - (6)].swiz_mask).swizzle; (yyvsp[(4) - (6)].src_reg).Base.Negate = (yyvsp[(6) - (6)].swiz_mask).mask; - (yyval.inst) = asm_instruction_ctor(OPCODE_SWZ, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); ;} break; - case 45: + case 48: /* Line 1455 of yacc.c */ -#line 483 "program_parse.y" +#line 547 "program_parse.y" { - (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); - if ((yyvsp[(1) - (3)].negate)) { + if ((yyvsp[(1) - (2)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + ;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 555 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (4)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (4)].negate)) { (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; } + (yyval.src_reg).Base.Abs = 1; + ;} + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 572 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, - (yyvsp[(3) - (3)].swiz_mask).swizzle); + (yyvsp[(2) - (2)].swiz_mask).swizzle); ;} break; - case 46: + case 51: + +/* Line 1455 of yacc.c */ +#line 579 "program_parse.y" + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (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, & (yyvsp[(1) - (1)].vector)); + + set_src_reg(& (yyval.src_reg), PROGRAM_CONSTANT, temp_sym.param_binding_begin); + ;} + break; + + case 52: /* Line 1455 of yacc.c */ -#line 496 "program_parse.y" +#line 596 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2418,13 +2577,38 @@ yyreduce: ;} break; - case 47: + case 53: /* Line 1455 of yacc.c */ -#line 509 "program_parse.y" +#line 607 "program_parse.y" { - (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); - (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (5)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (5)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Abs = 1; + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(4) - (5)].swiz_mask).swizzle); + ;} + break; + + case 54: + +/* Line 1455 of yacc.c */ +#line 627 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; + (yyval.dst_reg).CondMask = (yyvsp[(3) - (3)].dst_reg).CondMask; + (yyval.dst_reg).CondSwizzle = (yyvsp[(3) - (3)].dst_reg).CondSwizzle; + (yyval.dst_reg).CondSrc = (yyvsp[(3) - (3)].dst_reg).CondSrc; if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -2433,32 +2617,30 @@ yyreduce: */ if (state->option.PositionInvariant && ((yyval.dst_reg).Index == VERT_RESULT_HPOS)) { - yyerror(& (yylsp[(1) - (2)]), state, "position-invariant programs cannot " + yyerror(& (yylsp[(1) - (3)]), state, "position-invariant programs cannot " "write position"); YYERROR; } - state->prog->OutputsWritten |= (1U << (yyval.dst_reg).Index); + state->prog->OutputsWritten |= BITFIELD64_BIT((yyval.dst_reg).Index); } ;} break; - case 48: + case 55: /* Line 1455 of yacc.c */ -#line 531 "program_parse.y" +#line 652 "program_parse.y" { - init_dst_reg(& (yyval.dst_reg)); - (yyval.dst_reg).File = PROGRAM_ADDRESS; - (yyval.dst_reg).Index = 0; + set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; ;} break; - case 49: + case 56: /* Line 1455 of yacc.c */ -#line 540 "program_parse.y" +#line 659 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2491,20 +2673,20 @@ yyreduce: ;} break; - case 50: + case 57: /* Line 1455 of yacc.c */ -#line 573 "program_parse.y" +#line 692 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 51: + case 58: /* Line 1455 of yacc.c */ -#line 580 "program_parse.y" +#line 699 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2521,10 +2703,10 @@ yyreduce: ;} break; - case 52: + case 59: /* Line 1455 of yacc.c */ -#line 595 "program_parse.y" +#line 714 "program_parse.y" { char s; @@ -2579,10 +2761,10 @@ yyreduce: ;} break; - case 53: + case 60: /* Line 1455 of yacc.c */ -#line 650 "program_parse.y" +#line 769 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2604,16 +2786,13 @@ yyreduce: init_src_reg(& (yyval.src_reg)); switch (s->type) { case at_temp: - (yyval.src_reg).Base.File = PROGRAM_TEMPORARY; - (yyval.src_reg).Base.Index = s->temp_binding; + set_src_reg(& (yyval.src_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - (yyval.src_reg).Base.File = s->param_binding_type; - (yyval.src_reg).Base.Index = s->param_binding_begin; + set_src_reg(& (yyval.src_reg), s->param_binding_type, s->param_binding_begin); break; case at_attrib: - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = s->attrib_binding; + set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, s->attrib_binding); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { @@ -2628,14 +2807,12 @@ yyreduce: ;} break; - case 54: + case 61: /* Line 1455 of yacc.c */ -#line 694 "program_parse.y" +#line 810 "program_parse.y" { - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].attrib); + set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[(1) - (1)].attrib)); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { @@ -2644,10 +2821,10 @@ yyreduce: ;} break; - case 55: + case 62: /* Line 1455 of yacc.c */ -#line 705 "program_parse.y" +#line 819 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2670,34 +2847,31 @@ yyreduce: ;} break; - case 56: + case 63: /* Line 1455 of yacc.c */ -#line 726 "program_parse.y" +#line 840 "program_parse.y" { - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) + gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) ? (yyvsp[(1) - (1)].temp_sym).param_binding_type : PROGRAM_CONSTANT; - (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].temp_sym).param_binding_begin; + set_src_reg(& (yyval.src_reg), file, (yyvsp[(1) - (1)].temp_sym).param_binding_begin); ;} break; - case 57: + case 64: /* Line 1455 of yacc.c */ -#line 736 "program_parse.y" +#line 849 "program_parse.y" { - init_dst_reg(& (yyval.dst_reg)); - (yyval.dst_reg).File = PROGRAM_OUTPUT; - (yyval.dst_reg).Index = (yyvsp[(1) - (1)].result); + set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[(1) - (1)].result)); ;} break; - case 58: + case 65: /* Line 1455 of yacc.c */ -#line 742 "program_parse.y" +#line 853 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2712,28 +2886,24 @@ yyreduce: YYERROR; } - init_dst_reg(& (yyval.dst_reg)); switch (s->type) { case at_temp: - (yyval.dst_reg).File = PROGRAM_TEMPORARY; - (yyval.dst_reg).Index = s->temp_binding; + set_dst_reg(& (yyval.dst_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_output: - (yyval.dst_reg).File = PROGRAM_OUTPUT; - (yyval.dst_reg).Index = s->output_binding; + set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, s->output_binding); break; default: - (yyval.dst_reg).File = s->param_binding_type; - (yyval.dst_reg).Index = s->param_binding_begin; + set_dst_reg(& (yyval.dst_reg), s->param_binding_type, s->param_binding_begin); break; } ;} break; - case 59: + case 66: /* Line 1455 of yacc.c */ -#line 775 "program_parse.y" +#line 882 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2752,20 +2922,20 @@ yyreduce: ;} break; - case 62: + case 69: /* Line 1455 of yacc.c */ -#line 796 "program_parse.y" +#line 903 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 63: + case 70: /* Line 1455 of yacc.c */ -#line 803 "program_parse.y" +#line 910 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2777,35 +2947,37 @@ yyreduce: ;} break; - case 64: + case 71: /* Line 1455 of yacc.c */ -#line 814 "program_parse.y" +#line 921 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 65: + case 72: /* Line 1455 of yacc.c */ -#line 815 "program_parse.y" +#line 922 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 66: + case 73: /* Line 1455 of yacc.c */ -#line 816 "program_parse.y" +#line 923 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 67: + case 74: /* Line 1455 of yacc.c */ -#line 820 "program_parse.y" +#line 927 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -2813,14 +2985,16 @@ yyreduce: ;} break; - case 68: + case 75: /* Line 1455 of yacc.c */ -#line 832 "program_parse.y" +#line 941 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -2828,10 +3002,10 @@ yyreduce: ;} break; - case 69: + case 76: /* Line 1455 of yacc.c */ -#line 844 "program_parse.y" +#line 955 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2851,10 +3025,10 @@ yyreduce: ;} break; - case 70: + case 77: /* Line 1455 of yacc.c */ -#line 864 "program_parse.y" +#line 975 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2865,10 +3039,10 @@ yyreduce: ;} break; - case 71: + case 78: /* Line 1455 of yacc.c */ -#line 875 "program_parse.y" +#line 986 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2880,147 +3054,248 @@ yyreduce: ;} break; - case 76: - -/* Line 1455 of yacc.c */ -#line 891 "program_parse.y" - { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} - break; - - case 81: + case 83: /* Line 1455 of yacc.c */ -#line 895 "program_parse.y" +#line 1002 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 907 "program_parse.y" - { - struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); - - if (s == NULL) { - free((yyvsp[(2) - (4)].string)); - YYERROR; - } else { - s->attrib_binding = (yyvsp[(4) - (4)].attrib); - state->InputsBound |= (1U << s->attrib_binding); - - if (!validate_inputs(& (yylsp[(4) - (4)]), state)) { - YYERROR; - } - } - ;} +#line 1006 "program_parse.y" + { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 89: /* Line 1455 of yacc.c */ -#line 926 "program_parse.y" +#line 1010 "program_parse.y" { - (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} break; case 90: /* Line 1455 of yacc.c */ -#line 930 "program_parse.y" +#line 1014 "program_parse.y" { - (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} break; case 91: /* Line 1455 of yacc.c */ -#line 936 "program_parse.y" +#line 1018 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_POS; + (yyval.dst_reg).CondMask = COND_TR; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; ;} break; case 92: /* Line 1455 of yacc.c */ -#line 940 "program_parse.y" +#line 1026 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_WEIGHT; + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; ;} break; case 93: /* Line 1455 of yacc.c */ -#line 944 "program_parse.y" +#line 1033 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_NORMAL; + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; ;} break; case 94: /* Line 1455 of yacc.c */ -#line 948 "program_parse.y" +#line 1040 "program_parse.y" { - if (!state->ctx->Extensions.EXT_secondary_color) { - yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + YYERROR; } - (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; ;} break; case 95: /* Line 1455 of yacc.c */ -#line 957 "program_parse.y" +#line 1063 "program_parse.y" { - if (!state->ctx->Extensions.EXT_fog_coord) { - yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + YYERROR; } - (yyval.attrib) = VERT_ATTRIB_FOG; + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; ;} break; - case 96: + case 102: /* Line 1455 of yacc.c */ -#line 966 "program_parse.y" +#line 1094 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); - ;} - break; + struct asm_symbol *const s = + declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); - case 97: + if (s == NULL) { + free((yyvsp[(2) - (4)].string)); + YYERROR; + } else { + s->attrib_binding = (yyvsp[(4) - (4)].attrib); + state->InputsBound |= (1U << s->attrib_binding); + + if (!validate_inputs(& (yylsp[(4) - (4)]), state)) { + YYERROR; + } + } + ;} + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 1113 "program_parse.y" + { + (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + ;} + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 1117 "program_parse.y" + { + (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + ;} + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 1123 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_POS; + ;} + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 1127 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_WEIGHT; + ;} + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 1131 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_NORMAL; + ;} + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 1135 "program_parse.y" + { + if (!state->ctx->Extensions.EXT_secondary_color) { + yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); + YYERROR; + } + + (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 1144 "program_parse.y" + { + if (!state->ctx->Extensions.EXT_fog_coord) { + yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); + YYERROR; + } + + (yyval.attrib) = VERT_ATTRIB_FOG; + ;} + break; + + case 110: /* Line 1455 of yacc.c */ -#line 970 "program_parse.y" +#line 1153 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 1157 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 98: + case 112: /* Line 1455 of yacc.c */ -#line 975 "program_parse.y" +#line 1162 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 99: + case 113: /* Line 1455 of yacc.c */ -#line 981 "program_parse.y" +#line 1168 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3031,46 +3306,46 @@ yyreduce: ;} break; - case 103: + case 117: /* Line 1455 of yacc.c */ -#line 995 "program_parse.y" +#line 1182 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 104: + case 118: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1186 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 105: + case 119: /* Line 1455 of yacc.c */ -#line 1003 "program_parse.y" +#line 1190 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 106: + case 120: /* Line 1455 of yacc.c */ -#line 1007 "program_parse.y" +#line 1194 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 109: + case 123: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1202 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3087,10 +3362,10 @@ yyreduce: ;} break; - case 110: + case 124: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1219 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { free((yyvsp[(2) - (6)].string)); @@ -3114,19 +3389,19 @@ yyreduce: ;} break; - case 111: + case 125: /* Line 1455 of yacc.c */ -#line 1056 "program_parse.y" +#line 1243 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 112: + case 126: /* Line 1455 of yacc.c */ -#line 1060 "program_parse.y" +#line 1247 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3137,38 +3412,38 @@ yyreduce: ;} break; - case 113: + case 127: /* Line 1455 of yacc.c */ -#line 1071 "program_parse.y" +#line 1258 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 114: + case 128: /* Line 1455 of yacc.c */ -#line 1077 "program_parse.y" +#line 1264 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 116: + case 130: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1271 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 117: + case 131: /* Line 1455 of yacc.c */ -#line 1091 "program_parse.y" +#line 1278 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3176,10 +3451,10 @@ yyreduce: ;} break; - case 118: + case 132: /* Line 1455 of yacc.c */ -#line 1097 "program_parse.y" +#line 1284 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3187,10 +3462,10 @@ yyreduce: ;} break; - case 119: + case 133: /* Line 1455 of yacc.c */ -#line 1103 "program_parse.y" +#line 1290 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3198,10 +3473,10 @@ yyreduce: ;} break; - case 120: + case 134: /* Line 1455 of yacc.c */ -#line 1111 "program_parse.y" +#line 1298 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3209,10 +3484,10 @@ yyreduce: ;} break; - case 121: + case 135: /* Line 1455 of yacc.c */ -#line 1117 "program_parse.y" +#line 1304 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3220,10 +3495,10 @@ yyreduce: ;} break; - case 122: + case 136: /* Line 1455 of yacc.c */ -#line 1123 "program_parse.y" +#line 1310 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3231,10 +3506,10 @@ yyreduce: ;} break; - case 123: + case 137: /* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" +#line 1318 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3242,10 +3517,10 @@ yyreduce: ;} break; - case 124: + case 138: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1324 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3253,10 +3528,10 @@ yyreduce: ;} break; - case 125: + case 139: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1330 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3264,101 +3539,101 @@ yyreduce: ;} break; - case 126: + case 140: /* Line 1455 of yacc.c */ -#line 1150 "program_parse.y" +#line 1337 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 127: + case 141: /* Line 1455 of yacc.c */ -#line 1151 "program_parse.y" +#line 1338 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 128: + case 142: /* Line 1455 of yacc.c */ -#line 1154 "program_parse.y" +#line 1341 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 129: + case 143: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1342 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 130: + case 144: /* Line 1455 of yacc.c */ -#line 1156 "program_parse.y" +#line 1343 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: + case 145: /* Line 1455 of yacc.c */ -#line 1157 "program_parse.y" +#line 1344 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 132: + case 146: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1345 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 133: + case 147: /* Line 1455 of yacc.c */ -#line 1159 "program_parse.y" +#line 1346 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: + case 148: /* Line 1455 of yacc.c */ -#line 1160 "program_parse.y" +#line 1347 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 135: + case 149: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1348 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 136: + case 150: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1349 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 137: + case 151: /* Line 1455 of yacc.c */ -#line 1163 "program_parse.y" +#line 1350 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 138: + case 152: /* Line 1455 of yacc.c */ -#line 1164 "program_parse.y" +#line 1351 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 139: + case 153: /* Line 1455 of yacc.c */ -#line 1168 "program_parse.y" +#line 1355 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3367,37 +3642,37 @@ yyreduce: ;} break; - case 140: + case 154: /* Line 1455 of yacc.c */ -#line 1177 "program_parse.y" +#line 1364 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 141: + case 155: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1368 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 142: + case 156: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1372 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 143: + case 157: /* Line 1455 of yacc.c */ -#line 1191 "program_parse.y" +#line 1378 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3406,28 +3681,28 @@ yyreduce: ;} break; - case 144: + case 158: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1387 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 145: + case 159: /* Line 1455 of yacc.c */ -#line 1204 "program_parse.y" +#line 1391 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 146: + case 160: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1395 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3438,57 +3713,57 @@ yyreduce: ;} break; - case 147: + case 161: /* Line 1455 of yacc.c */ -#line 1217 "program_parse.y" +#line 1404 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 148: + case 162: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1408 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 149: + case 163: /* Line 1455 of yacc.c */ -#line 1227 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 150: + case 164: /* Line 1455 of yacc.c */ -#line 1233 "program_parse.y" +#line 1420 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 151: + case 165: /* Line 1455 of yacc.c */ -#line 1240 "program_parse.y" +#line 1427 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 152: + case 166: /* Line 1455 of yacc.c */ -#line 1245 "program_parse.y" +#line 1432 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3496,10 +3771,10 @@ yyreduce: ;} break; - case 153: + case 167: /* Line 1455 of yacc.c */ -#line 1253 "program_parse.y" +#line 1440 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3509,10 +3784,10 @@ yyreduce: ;} break; - case 155: + case 169: /* Line 1455 of yacc.c */ -#line 1265 "program_parse.y" +#line 1452 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3520,46 +3795,46 @@ yyreduce: ;} break; - case 156: + case 170: /* Line 1455 of yacc.c */ -#line 1273 "program_parse.y" +#line 1460 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 157: + case 171: /* Line 1455 of yacc.c */ -#line 1279 "program_parse.y" +#line 1466 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 158: + case 172: /* Line 1455 of yacc.c */ -#line 1283 "program_parse.y" +#line 1470 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 159: + case 173: /* Line 1455 of yacc.c */ -#line 1287 "program_parse.y" +#line 1474 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 160: + case 174: /* Line 1455 of yacc.c */ -#line 1293 "program_parse.y" +#line 1480 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3570,10 +3845,10 @@ yyreduce: ;} break; - case 161: + case 175: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1491 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3582,92 +3857,92 @@ yyreduce: ;} break; - case 162: + case 176: /* Line 1455 of yacc.c */ -#line 1313 "program_parse.y" +#line 1500 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 163: + case 177: /* Line 1455 of yacc.c */ -#line 1317 "program_parse.y" +#line 1504 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 164: + case 178: /* Line 1455 of yacc.c */ -#line 1322 "program_parse.y" +#line 1509 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 165: + case 179: /* Line 1455 of yacc.c */ -#line 1326 "program_parse.y" +#line 1513 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 166: + case 180: /* Line 1455 of yacc.c */ -#line 1330 "program_parse.y" +#line 1517 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 167: + case 181: /* Line 1455 of yacc.c */ -#line 1334 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 168: + case 182: /* Line 1455 of yacc.c */ -#line 1340 "program_parse.y" +#line 1527 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 169: + case 183: /* Line 1455 of yacc.c */ -#line 1347 "program_parse.y" +#line 1534 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 170: + case 184: /* Line 1455 of yacc.c */ -#line 1351 "program_parse.y" +#line 1538 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 171: + case 185: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1544 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3675,10 +3950,10 @@ yyreduce: ;} break; - case 172: + case 186: /* Line 1455 of yacc.c */ -#line 1365 "program_parse.y" +#line 1552 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3689,38 +3964,38 @@ yyreduce: ;} break; - case 173: + case 187: /* Line 1455 of yacc.c */ -#line 1376 "program_parse.y" +#line 1563 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 174: + case 188: /* Line 1455 of yacc.c */ -#line 1383 "program_parse.y" +#line 1570 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 175: + case 189: /* Line 1455 of yacc.c */ -#line 1387 "program_parse.y" +#line 1574 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 176: + case 190: /* Line 1455 of yacc.c */ -#line 1393 "program_parse.y" +#line 1580 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3730,10 +4005,10 @@ yyreduce: ;} break; - case 177: + case 191: /* Line 1455 of yacc.c */ -#line 1403 "program_parse.y" +#line 1590 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3743,20 +4018,20 @@ yyreduce: ;} break; - case 178: + case 192: /* Line 1455 of yacc.c */ -#line 1413 "program_parse.y" +#line 1600 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 179: + case 193: /* Line 1455 of yacc.c */ -#line 1418 "program_parse.y" +#line 1605 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3774,10 +4049,10 @@ yyreduce: ;} break; - case 180: + case 194: /* Line 1455 of yacc.c */ -#line 1436 "program_parse.y" +#line 1623 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3785,55 +4060,55 @@ yyreduce: ;} break; - case 181: + case 195: /* Line 1455 of yacc.c */ -#line 1444 "program_parse.y" +#line 1631 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 182: + case 196: /* Line 1455 of yacc.c */ -#line 1448 "program_parse.y" +#line 1635 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 183: + case 197: /* Line 1455 of yacc.c */ -#line 1454 "program_parse.y" +#line 1641 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 184: + case 198: /* Line 1455 of yacc.c */ -#line 1458 "program_parse.y" +#line 1645 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 185: + case 199: /* Line 1455 of yacc.c */ -#line 1462 "program_parse.y" +#line 1649 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 186: + case 200: /* Line 1455 of yacc.c */ -#line 1468 "program_parse.y" +#line 1655 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3844,88 +4119,88 @@ yyreduce: ;} break; - case 187: + case 201: /* Line 1455 of yacc.c */ -#line 1479 "program_parse.y" +#line 1666 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 188: + case 202: /* Line 1455 of yacc.c */ -#line 1484 "program_parse.y" +#line 1671 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 189: + case 203: /* Line 1455 of yacc.c */ -#line 1489 "program_parse.y" +#line 1676 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 190: + case 204: /* Line 1455 of yacc.c */ -#line 1494 "program_parse.y" +#line 1681 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 191: + case 205: /* Line 1455 of yacc.c */ -#line 1499 "program_parse.y" +#line 1686 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 192: + case 206: /* Line 1455 of yacc.c */ -#line 1504 "program_parse.y" +#line 1691 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 193: + case 207: /* Line 1455 of yacc.c */ -#line 1511 "program_parse.y" +#line 1698 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 194: + case 208: /* Line 1455 of yacc.c */ -#line 1515 "program_parse.y" +#line 1702 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 195: + case 209: /* Line 1455 of yacc.c */ -#line 1520 "program_parse.y" +#line 1707 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3939,10 +4214,10 @@ yyreduce: ;} break; - case 196: + case 210: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1720 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3951,10 +4226,10 @@ yyreduce: ;} break; - case 197: + case 211: /* Line 1455 of yacc.c */ -#line 1541 "program_parse.y" +#line 1728 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3965,20 +4240,20 @@ yyreduce: ;} break; - case 198: + case 212: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1739 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 203: + case 217: /* Line 1455 of yacc.c */ -#line 1564 "program_parse.y" +#line 1751 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3988,30 +4263,30 @@ yyreduce: ;} break; - case 204: + case 218: /* Line 1455 of yacc.c */ -#line 1574 "program_parse.y" +#line 1761 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 205: + case 219: /* Line 1455 of yacc.c */ -#line 1579 "program_parse.y" +#line 1766 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 206: + case 220: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1773 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4021,10 +4296,10 @@ yyreduce: ;} break; - case 207: + case 221: /* Line 1455 of yacc.c */ -#line 1596 "program_parse.y" +#line 1783 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4034,30 +4309,30 @@ yyreduce: ;} break; - case 208: + case 222: /* Line 1455 of yacc.c */ -#line 1605 "program_parse.y" +#line 1792 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 209: + case 223: /* Line 1455 of yacc.c */ -#line 1610 "program_parse.y" +#line 1797 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 210: + case 224: /* Line 1455 of yacc.c */ -#line 1617 "program_parse.y" +#line 1804 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4067,10 +4342,10 @@ yyreduce: ;} break; - case 211: + case 225: /* Line 1455 of yacc.c */ -#line 1627 "program_parse.y" +#line 1814 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4080,10 +4355,10 @@ yyreduce: ;} break; - case 212: + case 226: /* Line 1455 of yacc.c */ -#line 1637 "program_parse.y" +#line 1824 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4093,10 +4368,10 @@ yyreduce: ;} break; - case 217: + case 231: /* Line 1455 of yacc.c */ -#line 1652 "program_parse.y" +#line 1839 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4106,10 +4381,10 @@ yyreduce: ;} break; - case 218: + case 232: /* Line 1455 of yacc.c */ -#line 1662 "program_parse.y" +#line 1849 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4119,10 +4394,10 @@ yyreduce: ;} break; - case 219: + case 233: /* Line 1455 of yacc.c */ -#line 1670 "program_parse.y" +#line 1857 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4132,10 +4407,10 @@ yyreduce: ;} break; - case 220: + case 234: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1867 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4145,10 +4420,10 @@ yyreduce: ;} break; - case 221: + case 235: /* Line 1455 of yacc.c */ -#line 1688 "program_parse.y" +#line 1875 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4158,10 +4433,10 @@ yyreduce: ;} break; - case 222: + case 236: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1884 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4171,10 +4446,10 @@ yyreduce: ;} break; - case 223: + case 237: /* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" +#line 1893 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4184,63 +4459,110 @@ yyreduce: ;} break; - case 224: + case 238: /* Line 1455 of yacc.c */ -#line 1716 "program_parse.y" +#line 1903 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 225: + case 239: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1907 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 226: + case 240: /* Line 1455 of yacc.c */ -#line 1725 "program_parse.y" +#line 1912 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 227: + case 241: /* Line 1455 of yacc.c */ -#line 1726 "program_parse.y" +#line 1913 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 228: + case 242: /* Line 1455 of yacc.c */ -#line 1727 "program_parse.y" +#line 1914 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 229: + case 243: /* Line 1455 of yacc.c */ -#line 1730 "program_parse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} +#line 1917 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 231: + case 245: /* Line 1455 of yacc.c */ -#line 1733 "program_parse.y" +#line 1921 "program_parse.y" + { + /* 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(& (yylsp[(1) - (1)]), state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", (yyvsp[(1) - (1)].string)) == 0) { + } else if (strcmp("LONG", (yyvsp[(1) - (1)].string)) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + ;} + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1955 "program_parse.y" + { + ;} + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 1959 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 233: + case 249: /* Line 1455 of yacc.c */ -#line 1737 "program_parse.y" +#line 1963 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { free((yyvsp[(3) - (3)].string)); @@ -4249,10 +4571,10 @@ yyreduce: ;} break; - case 234: + case 250: /* Line 1455 of yacc.c */ -#line 1744 "program_parse.y" +#line 1970 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { free((yyvsp[(1) - (1)].string)); @@ -4261,27 +4583,27 @@ yyreduce: ;} break; - case 235: + case 251: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1979 "program_parse.y" { struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); + declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); if (s == NULL) { - free((yyvsp[(2) - (4)].string)); + free((yyvsp[(3) - (5)].string)); YYERROR; } else { - s->output_binding = (yyvsp[(4) - (4)].result); + s->output_binding = (yyvsp[(5) - (5)].result); } ;} break; - case 236: + case 252: /* Line 1455 of yacc.c */ -#line 1767 "program_parse.y" +#line 1993 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4292,10 +4614,10 @@ yyreduce: ;} break; - case 237: + case 253: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 2002 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4306,19 +4628,19 @@ yyreduce: ;} break; - case 238: + case 254: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 2011 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 239: + case 255: /* Line 1455 of yacc.c */ -#line 1789 "program_parse.y" +#line 2015 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4329,10 +4651,10 @@ yyreduce: ;} break; - case 240: + case 256: /* Line 1455 of yacc.c */ -#line 1798 "program_parse.y" +#line 2024 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4343,10 +4665,10 @@ yyreduce: ;} break; - case 241: + case 257: /* Line 1455 of yacc.c */ -#line 1807 "program_parse.y" +#line 2033 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4357,19 +4679,19 @@ yyreduce: ;} break; - case 242: + case 258: /* Line 1455 of yacc.c */ -#line 1818 "program_parse.y" +#line 2044 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 243: + case 259: /* Line 1455 of yacc.c */ -#line 1824 "program_parse.y" +#line 2050 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4377,10 +4699,10 @@ yyreduce: ;} break; - case 244: + case 260: /* Line 1455 of yacc.c */ -#line 1830 "program_parse.y" +#line 2056 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4391,10 +4713,10 @@ yyreduce: ;} break; - case 245: + case 261: /* Line 1455 of yacc.c */ -#line 1839 "program_parse.y" +#line 2065 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4405,19 +4727,19 @@ yyreduce: ;} break; - case 246: + case 262: /* Line 1455 of yacc.c */ -#line 1850 "program_parse.y" +#line 2076 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: + case 263: /* Line 1455 of yacc.c */ -#line 1854 "program_parse.y" +#line 2080 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4428,10 +4750,10 @@ yyreduce: ;} break; - case 248: + case 264: /* Line 1455 of yacc.c */ -#line 1863 "program_parse.y" +#line 2089 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4442,94 +4764,94 @@ yyreduce: ;} break; - case 249: + case 265: /* Line 1455 of yacc.c */ -#line 1873 "program_parse.y" +#line 2099 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: + case 266: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 2100 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: + case 267: /* Line 1455 of yacc.c */ -#line 1875 "program_parse.y" +#line 2101 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 252: + case 268: /* Line 1455 of yacc.c */ -#line 1878 "program_parse.y" +#line 2104 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 269: /* Line 1455 of yacc.c */ -#line 1879 "program_parse.y" +#line 2105 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 270: /* Line 1455 of yacc.c */ -#line 1880 "program_parse.y" +#line 2106 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 255: + case 271: /* Line 1455 of yacc.c */ -#line 1883 "program_parse.y" +#line 2109 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 272: /* Line 1455 of yacc.c */ -#line 1884 "program_parse.y" +#line 2110 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 257: + case 273: /* Line 1455 of yacc.c */ -#line 1887 "program_parse.y" +#line 2113 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 274: /* Line 1455 of yacc.c */ -#line 1888 "program_parse.y" +#line 2114 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: + case 275: /* Line 1455 of yacc.c */ -#line 1891 "program_parse.y" +#line 2117 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: + case 276: /* Line 1455 of yacc.c */ -#line 1892 "program_parse.y" +#line 2118 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 261: + case 277: /* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" +#line 2122 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4540,10 +4862,10 @@ yyreduce: ;} break; - case 262: + case 278: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 2133 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4554,10 +4876,10 @@ yyreduce: ;} break; - case 263: + case 279: /* Line 1455 of yacc.c */ -#line 1918 "program_parse.y" +#line 2144 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4568,22 +4890,23 @@ yyreduce: ;} break; - case 264: + case 280: /* Line 1455 of yacc.c */ -#line 1929 "program_parse.y" +#line 2155 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); struct asm_symbol *target = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(4) - (4)].string)); - free((yyvsp[(4) - (4)].string)); if (exist != NULL) { + char m[1000]; + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); free((yyvsp[(2) - (4)].string)); - yyerror(& (yylsp[(2) - (4)]), state, "redeclared identifier"); + yyerror(& (yylsp[(2) - (4)]), state, m); YYERROR; } else if (target == NULL) { free((yyvsp[(2) - (4)].string)); @@ -4599,7 +4922,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4603 "program_parse.tab.c" +#line 4926 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4818,7 +5141,49 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1953 "program_parse.y" +#line 2184 "program_parse.y" + + +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 * @@ -4828,37 +5193,37 @@ asm_instruction_ctor(gl_inst_opcode op, const struct asm_src_register *src1, const struct asm_src_register *src2) { - struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - /* 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; - } + asm_instruction_set_operands(inst, dst, src0, src1, src2); + } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + return inst; +} - 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_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; @@ -4876,6 +5241,26 @@ init_dst_reg(struct prog_dst_register *r) } +/** 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); + ASSERT(index <= 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) { @@ -4886,6 +5271,23 @@ init_src_reg(struct asm_src_register *r) } +/** Like init_src_reg() but set the File and Index fields. */ +void +set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; + const GLint minIndex = -(1 << INST_INDEX_BITS); + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file < PROGRAM_FILE_MAX); + memset(r, 0, sizeof(*r)); + r->Base.File = file; + r->Base.Index = index; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + /** * Validate the set of inputs used by a program * diff --git a/mesalib/src/mesa/shader/program_parse.tab.h b/mesalib/src/mesa/shader/program_parse.tab.h index dabb3bf1a..406100c85 100644 --- a/mesalib/src/mesa/shader/program_parse.tab.h +++ b/mesalib/src/mesa/shader/program_parse.tab.h @@ -58,90 +58,92 @@ ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -152,7 +154,7 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 107 "program_parse.y" +#line 122 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -181,7 +183,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 185 "program_parse.tab.h" +#line 187 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/mesalib/src/mesa/shader/program_parse.y b/mesalib/src/mesa/shader/program_parse.y index aad5eeb7d..8ca6f9805 100644 --- a/mesalib/src/mesa/shader/program_parse.y +++ b/mesalib/src/mesa/shader/program_parse.y @@ -66,12 +66,27 @@ static int validate_inputs(struct YYLTYPE *locp, 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 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) @@ -142,7 +157,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Tokens for instructions */ %token BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP -%token ARL KIL SWZ +%token ARL KIL SWZ TXD_OP %token INTEGER %token REAL @@ -169,7 +184,8 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %token VERTEX VTXATTRIB %token WEIGHT -%token IDENTIFIER +%token IDENTIFIER USED_IDENTIFIER +%type string %token MASK4 MASK3 MASK2 MASK1 SWIZZLE %token DOT_DOT %token DOT @@ -177,11 +193,11 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type instruction ALU_instruction TexInstruction %type ARL_instruction VECTORop_instruction %type SCALARop_instruction BINSCop_instruction BINop_instruction -%type TRIop_instruction SWZ_instruction SAMPLE_instruction +%type TRIop_instruction TXD_instruction SWZ_instruction SAMPLE_instruction %type KIL_instruction %type dstReg maskedDstReg maskedAddrReg -%type srcReg scalarSrcReg swizzleSrcReg +%type srcReg scalarUse scalarSrcReg swizzleSrcReg %type scalarSuffix swizzleSuffix extendedSwizzle %type extSwizComp extSwizSel %type optionalMask @@ -192,6 +208,8 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type addrReg %type addrComponent addrWriteMask +%type ccMaskRule ccTest ccMaskRule2 ccTest2 optionalCcMask + %type resultBinding resultColBinding %type optFaceType optColorType %type optResultFaceType optResultColorType @@ -280,7 +298,7 @@ optionSequence: optionSequence option | ; -option: OPTION IDENTIFIER ';' +option: OPTION string ';' { int valid = 0; @@ -349,6 +367,7 @@ ALU_instruction: ARL_instruction TexInstruction: SAMPLE_instruction | KIL_instruction + | TXD_instruction ; ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg @@ -359,51 +378,45 @@ ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; TRIop_instruction: TRI_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); } ; SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + $$ = 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.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $6; if ($8 < 0) { @@ -444,6 +457,58 @@ 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 @@ -474,21 +539,56 @@ SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle $4.Base.Swizzle = $6.swizzle; $4.Base.Negate = $6.mask; - $$ = asm_instruction_ctor(OPCODE_SWZ, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; -scalarSrcReg: optionalSign srcReg scalarSuffix +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, - $3.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); + + set_src_reg(& $$, PROGRAM_CONSTANT, temp_sym.param_binding_begin); } ; @@ -503,12 +603,33 @@ swizzleSrcReg: optionalSign srcReg swizzleSuffix $$.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 +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 @@ -522,16 +643,14 @@ maskedDstReg: dstReg optionalMask YYERROR; } - state->prog->OutputsWritten |= (1U << $$.Index); + state->prog->OutputsWritten |= BITFIELD64_BIT($$.Index); } } ; maskedAddrReg: addrReg addrWriteMask { - init_dst_reg(& $$); - $$.File = PROGRAM_ADDRESS; - $$.Index = 0; + set_dst_reg(& $$, PROGRAM_ADDRESS, 0); $$.WriteMask = $2.mask; } ; @@ -591,7 +710,7 @@ extSwizSel: INTEGER $$.xyzw_valid = 1; $$.rgba_valid = 1; } - | IDENTIFIER + | string { char s; @@ -646,7 +765,7 @@ extSwizSel: INTEGER } ; -srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ +srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -668,16 +787,13 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ init_src_reg(& $$); switch (s->type) { case at_temp: - $$.Base.File = PROGRAM_TEMPORARY; - $$.Base.Index = s->temp_binding; + set_src_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - $$.Base.File = s->param_binding_type; - $$.Base.Index = s->param_binding_begin; + set_src_reg(& $$, s->param_binding_type, s->param_binding_begin); break; case at_attrib: - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = s->attrib_binding; + set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding); state->prog->InputsRead |= (1U << $$.Base.Index); if (!validate_inputs(& @1, state)) { @@ -692,9 +808,7 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ } | attribBinding { - init_src_reg(& $$); - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = $1; + set_src_reg(& $$, PROGRAM_INPUT, $1); state->prog->InputsRead |= (1U << $$.Base.Index); if (!validate_inputs(& @1, state)) { @@ -724,21 +838,18 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ } | paramSingleItemUse { - init_src_reg(& $$); - $$.Base.File = ($1.name != NULL) + gl_register_file file = ($1.name != NULL) ? $1.param_binding_type : PROGRAM_CONSTANT; - $$.Base.Index = $1.param_binding_begin; + set_src_reg(& $$, file, $1.param_binding_begin); } ; dstReg: resultBinding { - init_dst_reg(& $$); - $$.File = PROGRAM_OUTPUT; - $$.Index = $1; + set_dst_reg(& $$, PROGRAM_OUTPUT, $1); } - | IDENTIFIER /* temporaryReg | vertexResultReg */ + | USED_IDENTIFIER /* temporaryReg | vertexResultReg */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -753,25 +864,21 @@ dstReg: resultBinding YYERROR; } - init_dst_reg(& $$); switch (s->type) { case at_temp: - $$.File = PROGRAM_TEMPORARY; - $$.Index = s->temp_binding; + set_dst_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding); break; case at_output: - $$.File = PROGRAM_OUTPUT; - $$.Index = s->output_binding; + set_dst_reg(& $$, PROGRAM_OUTPUT, s->output_binding); break; default: - $$.File = s->param_binding_type; - $$.Index = s->param_binding_begin; + set_dst_reg(& $$, s->param_binding_type, s->param_binding_begin); break; } } ; -progParamArray: IDENTIFIER +progParamArray: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -819,8 +926,10 @@ addrRegRelOffset: { $$ = 0; } addrRegPosOffset: INTEGER { if (($1 < 0) || ($1 > 63)) { - yyerror(& @1, state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", $1); + yyerror(& @1, state, s); YYERROR; } else { $$ = $1; @@ -831,8 +940,10 @@ addrRegPosOffset: INTEGER addrRegNegOffset: INTEGER { if (($1 < 0) || ($1 > 64)) { - yyerror(& @1, state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", $1); + yyerror(& @1, state, s); YYERROR; } else { $$ = $1; @@ -840,7 +951,7 @@ addrRegNegOffset: INTEGER } ; -addrReg: IDENTIFIER +addrReg: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -895,6 +1006,82 @@ 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) { + _mesa_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) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + namingStatement: ATTRIB_statement | PARAM_statement | TEMP_statement @@ -1727,7 +1914,46 @@ optionalSign: '+' { $$ = FALSE; } | { $$ = FALSE; } ; -TEMP_statement: TEMP { $$ = $1; } varNameList +TEMP_statement: optVarSize TEMP { $$ = $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) { + _mesa_free(err_str); + } + + YYERROR; + } + } + | + { + } ; ADDRESS_statement: ADDRESS { $$ = $1; } varNameList @@ -1749,16 +1975,16 @@ varNameList: varNameList ',' IDENTIFIER } ; -OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding +OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding { struct asm_symbol *const s = - declare_variable(state, $2, at_output, & @2); + declare_variable(state, $3, at_output, & @3); if (s == NULL) { - free($2); + free($3); YYERROR; } else { - s->output_binding = $4; + s->output_binding = $5; } } ; @@ -1925,19 +2151,20 @@ legacyTexUnitNum: INTEGER } ; -ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER +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, "redeclared identifier"); + yyerror(& @2, state, m); YYERROR; } else if (target == NULL) { free($2); @@ -1950,8 +2177,54 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER } ; +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, @@ -1959,37 +2232,37 @@ asm_instruction_ctor(gl_inst_opcode op, const struct asm_src_register *src1, const struct asm_src_register *src2) { - struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - /* 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; - } + asm_instruction_set_operands(inst, dst, src0, src1, src2); + } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + return inst; +} - 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_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; @@ -2007,6 +2280,26 @@ init_dst_reg(struct prog_dst_register *r) } +/** 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); + ASSERT(index <= 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) { @@ -2017,6 +2310,23 @@ init_src_reg(struct asm_src_register *r) } +/** Like init_src_reg() but set the File and Index fields. */ +void +set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; + const GLint minIndex = -(1 << INST_INDEX_BITS); + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file < PROGRAM_FILE_MAX); + memset(r, 0, sizeof(*r)); + r->Base.File = file; + r->Base.Index = index; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + /** * Validate the set of inputs used by a program * diff --git a/mesalib/src/mesa/shader/program_parse_extra.c b/mesalib/src/mesa/shader/program_parse_extra.c index 8e4be606f..0656c5eaa 100644 --- a/mesalib/src/mesa/shader/program_parse_extra.c +++ b/mesalib/src/mesa/shader/program_parse_extra.c @@ -33,6 +33,121 @@ * \author Ian Romanick */ +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) { @@ -102,6 +217,17 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) 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; diff --git a/mesalib/src/mesa/shader/program_parser.h b/mesalib/src/mesa/shader/program_parser.h index fa47d8456..c170948f7 100644 --- a/mesalib/src/mesa/shader/program_parser.h +++ b/mesalib/src/mesa/shader/program_parser.h @@ -35,7 +35,7 @@ enum asm_type { at_attrib, at_param, at_temp, - at_output, + at_output }; struct asm_symbol { @@ -202,6 +202,7 @@ struct asm_parser_state { unsigned Shadow:1; unsigned TexRect:1; unsigned TexArray:1; + unsigned NV_fragment:1; } option; struct { @@ -263,4 +264,31 @@ extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state, 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/shader/programopt.c b/mesalib/src/mesa/shader/programopt.c index f70c75cec..951454570 100644 --- a/mesalib/src/mesa/shader/programopt.c +++ b/mesalib/src/mesa/shader/programopt.c @@ -109,7 +109,7 @@ _mesa_insert_mvp_dp4_code(GLcontext *ctx, struct gl_vertex_program *vprog) vprog->Base.Instructions = newInst; vprog->Base.NumInstructions = newLen; vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); + vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS); } @@ -211,7 +211,7 @@ _mesa_insert_mvp_mad_code(GLcontext *ctx, struct gl_vertex_program *vprog) vprog->Base.Instructions = newInst; vprog->Base.NumInstructions = newLen; vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); + vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS); } @@ -528,15 +528,11 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) /* 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; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - 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]; - } + 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]; } } @@ -573,3 +569,94 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) } } } + + +/** + * 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(GLcontext *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(GLcontext *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/shader/programopt.h b/mesalib/src/mesa/shader/programopt.h index 96acaf956..21fac0784 100644 --- a/mesalib/src/mesa/shader/programopt.h +++ b/mesalib/src/mesa/shader/programopt.h @@ -42,4 +42,11 @@ _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(GLcontext *ctx, struct gl_fragment_program *prog); + +extern void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog); + + #endif /* PROGRAMOPT_H */ diff --git a/mesalib/src/mesa/shader/shader_api.c b/mesalib/src/mesa/shader/shader_api.c index b282d7af6..453cd3964 100644 --- a/mesalib/src/mesa/shader/shader_api.c +++ b/mesalib/src/mesa/shader/shader_api.c @@ -380,12 +380,18 @@ get_shader_flags(void) flags |= GLSL_DUMP; if (_mesa_strstr(env, "log")) flags |= GLSL_LOG; + if (_mesa_strstr(env, "nopvert")) + flags |= GLSL_NOP_VERT; + if (_mesa_strstr(env, "nopfrag")) + flags |= GLSL_NOP_FRAG; if (_mesa_strstr(env, "nopt")) flags |= GLSL_NO_OPT; else if (_mesa_strstr(env, "opt")) flags |= GLSL_OPT; if (_mesa_strstr(env, "uniform")) flags |= GLSL_UNIFORMS; + if (_mesa_strstr(env, "useprog")) + flags |= GLSL_USE_PROG; } return flags; @@ -1492,6 +1498,41 @@ _mesa_link_program(GLcontext *ctx, GLuint program) } +/** + * Print basic shader info (for debug). + */ +static void +print_shader_info(const struct gl_shader_program *shProg) +{ + GLuint i; + + _mesa_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 = ""; + } + _mesa_printf(" %s shader %u, checksum %u\n", s, + shProg->Shaders[i]->Name, + shProg->Shaders[i]->SourceChecksum); + } + if (shProg->VertexProgram) + _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + if (shProg->FragmentProgram) + _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); +} + + /** * Called via ctx->Driver.UseProgram() */ @@ -1506,8 +1547,6 @@ _mesa_use_program(GLcontext *ctx, GLuint program) return; } - FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); - if (program) { shProg = _mesa_lookup_shader_program_err(ctx, program, "glUseProgram"); if (!shProg) { @@ -1520,26 +1559,18 @@ _mesa_use_program(GLcontext *ctx, GLuint program) } /* debug code */ - if (0) { - GLuint i; - _mesa_printf("Use Shader %u\n", shProg->Name); - for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x, checksum %u\n", - shProg->Shaders[i]->Name, - shProg->Shaders[i]->Type, - 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); + if (ctx->Shader.Flags & GLSL_USE_PROG) { + print_shader_info(shProg); } } else { shProg = NULL; } - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); + if (ctx->Shader.CurrentProgram != shProg) { + FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); + } } diff --git a/mesalib/src/mesa/shader/slang/slang_codegen.c b/mesalib/src/mesa/shader/slang/slang_codegen.c index 344dfdc68..ee5a50ca8 100644 --- a/mesalib/src/mesa/shader/slang/slang_codegen.c +++ b/mesalib/src/mesa/shader/slang/slang_codegen.c @@ -925,7 +925,7 @@ gen_return_with_expression(slang_assemble_ctx *A, slang_operation *oper) slang_operation_copy(rhs, &oper->children[0]); } - ///blockOper->locals->outer_scope = oper->locals->outer_scope; + /*blockOper->locals->outer_scope = oper->locals->outer_scope;*/ /*slang_print_tree(blockOper, 0);*/ diff --git a/mesalib/src/mesa/shader/slang/slang_compile.c b/mesalib/src/mesa/shader/slang/slang_compile.c index c1b97c7cb..499e16e2d 100644 --- a/mesalib/src/mesa/shader/slang/slang_compile.c +++ b/mesalib/src/mesa/shader/slang/slang_compile.c @@ -2738,6 +2738,7 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) slang_info_log info_log; slang_code_object obj; slang_unit_type type; + GLenum progTarget; if (shader->Type == GL_VERTEX_SHADER) { type = SLANG_UNIT_VERTEX_SHADER; @@ -2754,17 +2755,18 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->Main = GL_FALSE; - if (!shader->Program) { - GLenum progTarget; - if (shader->Type == GL_VERTEX_SHADER) - progTarget = GL_VERTEX_PROGRAM_ARB; - else - progTarget = GL_FRAGMENT_PROGRAM_ARB; - shader->Program = ctx->Driver.NewProgram(ctx, progTarget, 1); - shader->Program->Parameters = _mesa_new_parameter_list(); - shader->Program->Varying = _mesa_new_parameter_list(); - shader->Program->Attributes = _mesa_new_parameter_list(); - } + /* free the shader's old instructions, etc */ + _mesa_reference_program(ctx, &shader->Program, NULL); + + /* allocate new GPU program, parameter lists, etc. */ + if (shader->Type == GL_VERTEX_SHADER) + progTarget = GL_VERTEX_PROGRAM_ARB; + else + progTarget = GL_FRAGMENT_PROGRAM_ARB; + shader->Program = ctx->Driver.NewProgram(ctx, progTarget, 1); + shader->Program->Parameters = _mesa_new_parameter_list(); + shader->Program->Varying = _mesa_new_parameter_list(); + shader->Program->Attributes = _mesa_new_parameter_list(); slang_info_log_construct(&info_log); _slang_code_object_ctr(&obj); @@ -2814,6 +2816,16 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) (ctx->Shader.Flags & GLSL_NO_OPT) == 0) { _mesa_optimize_program(ctx, shader->Program); } + if ((ctx->Shader.Flags & GLSL_NOP_VERT) && + shader->Program->Target == GL_VERTEX_PROGRAM_ARB) { + _mesa_nop_vertex_program(ctx, + (struct gl_vertex_program *) shader->Program); + } + if ((ctx->Shader.Flags & GLSL_NOP_FRAG) && + shader->Program->Target == GL_FRAGMENT_PROGRAM_ARB) { + _mesa_nop_fragment_program(ctx, + (struct gl_fragment_program *) shader->Program); + } } if (ctx->Shader.Flags & GLSL_LOG) { diff --git a/mesalib/src/mesa/shader/slang/slang_compile_operation.c b/mesalib/src/mesa/shader/slang/slang_compile_operation.c index 3e2bdbc91..be73094ca 100644 --- a/mesalib/src/mesa/shader/slang/slang_compile_operation.c +++ b/mesalib/src/mesa/shader/slang/slang_compile_operation.c @@ -52,6 +52,7 @@ slang_operation_construct(slang_operation * oper) _slang_variable_scope_ctr(oper->locals); oper->fun = NULL; oper->var = NULL; + oper->label = NULL; return GL_TRUE; } diff --git a/mesalib/src/mesa/shader/slang/slang_compile_operation.h b/mesalib/src/mesa/shader/slang/slang_compile_operation.h index 58f1edeed..1f15c1989 100644 --- a/mesalib/src/mesa/shader/slang/slang_compile_operation.h +++ b/mesalib/src/mesa/shader/slang/slang_compile_operation.h @@ -127,7 +127,6 @@ typedef struct slang_operation_ * indicate such. num_children indicates number of elements. */ GLboolean array_constructor; - double x; } slang_operation; diff --git a/mesalib/src/mesa/shader/slang/slang_emit.c b/mesalib/src/mesa/shader/slang/slang_emit.c index 3af301eac..c0e4b27aa 100644 --- a/mesalib/src/mesa/shader/slang/slang_emit.c +++ b/mesalib/src/mesa/shader/slang/slang_emit.c @@ -195,6 +195,9 @@ alloc_node_storage(slang_emit_info *emitInfo, slang_ir_node *n, if (!n->Store) { assert(defaultSize > 0); n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, defaultSize); + if (!n->Store) { + return GL_FALSE; + } } /* now allocate actual register(s). I.e. set n->Store->Index >= 0 */ @@ -431,6 +434,9 @@ new_instruction(slang_emit_info *emitInfo, gl_inst_opcode opcode) _mesa_realloc_instructions(prog->Instructions, prog->NumInstructions, emitInfo->MaxInstructions); + if (!prog->Instructions) { + return NULL; + } } inst = prog->Instructions + prog->NumInstructions; @@ -451,12 +457,14 @@ emit_arl_load(slang_emit_info *emitInfo, gl_register_file file, GLint index, GLuint swizzle) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL); - inst->SrcReg[0].File = file; - inst->SrcReg[0].Index = index; - inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); - inst->DstReg.File = PROGRAM_ADDRESS; - inst->DstReg.Index = 0; - inst->DstReg.WriteMask = WRITEMASK_X; + if (inst) { + inst->SrcReg[0].File = file; + inst->SrcReg[0].Index = index; + inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); + inst->DstReg.File = PROGRAM_ADDRESS; + inst->DstReg.Index = 0; + inst->DstReg.WriteMask = WRITEMASK_X; + } return inst; } @@ -765,7 +773,9 @@ static struct prog_instruction * emit_comment(slang_emit_info *emitInfo, const char *comment) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_NOP); - inst_comment(inst, comment); + if (inst) { + inst_comment(inst, comment); + } return inst; } @@ -792,7 +802,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]->Children[0]); /* A */ emit(emitInfo, n->Children[0]->Children[1]); /* B */ emit(emitInfo, n->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ + if (!alloc_node_storage(emitInfo, n, -1)) { /* dest */ + return NULL; + } inst = emit_instruction(emitInfo, OPCODE_MAD, @@ -813,7 +825,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]); /* A */ emit(emitInfo, n->Children[1]->Children[0]); /* B */ emit(emitInfo, n->Children[1]->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ + if (!alloc_node_storage(emitInfo, n, -1)) { /* dest */ + return NULL; + } inst = emit_instruction(emitInfo, OPCODE_MAD, @@ -839,7 +853,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) } /* result storage */ - alloc_node_storage(emitInfo, n, -1); + if (!alloc_node_storage(emitInfo, n, -1)) { + return NULL; + } inst = emit_instruction(emitInfo, info->InstOpcode, @@ -1093,7 +1109,9 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) * the intermediate result. Use a temp register instead. */ _mesa_bzero(&tmpNode, sizeof(tmpNode)); - alloc_node_storage(emitInfo, &tmpNode, n->Store->Size); + if (!alloc_node_storage(emitInfo, &tmpNode, n->Store->Size)) { + return NULL; + } /* tmp = max(ch[0], ch[1]) */ inst = emit_instruction(emitInfo, OPCODE_MAX, @@ -1191,6 +1209,9 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) * really just a NOP to attach the label to. */ inst = new_instruction(emitInfo, OPCODE_BGNSUB); + if (!inst) { + return NULL; + } inst_comment(inst, n->Label->Name); } @@ -1202,10 +1223,16 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) inst = prev_instruction(emitInfo); if (inst && inst->Opcode != OPCODE_RET) { inst = new_instruction(emitInfo, OPCODE_RET); + if (!inst) { + return NULL; + } } if (emitInfo->EmitBeginEndSub) { inst = new_instruction(emitInfo, OPCODE_ENDSUB); + if (!inst) { + return NULL; + } inst_comment(inst, n->Label->Name); } @@ -1215,6 +1242,9 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) /* emit the function call */ inst = new_instruction(emitInfo, OPCODE_CAL); + if (!inst) { + return NULL; + } /* The branch target is just the subroutine number (changed later) */ inst->BranchTarget = subroutineId; inst_comment(inst, n->Label->Name); @@ -1235,7 +1265,9 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n) assert(n->Opcode == IR_RETURN); assert(n->Label); inst = new_instruction(emitInfo, OPCODE_RET); - inst->DstReg.CondMask = COND_TR; /* always return */ + if (inst) { + inst->DstReg.CondMask = COND_TR; /* always return */ + } return inst; } @@ -1249,6 +1281,9 @@ emit_kill(slang_emit_info *emitInfo) * Note that ARB-KILL depends on sign of vector operand. */ inst = new_instruction(emitInfo, OPCODE_KIL_NV); + if (!inst) { + return NULL; + } inst->DstReg.CondMask = COND_TR; /* always kill */ assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB); @@ -1600,8 +1635,10 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) if (emitInfo->EmitHighLevelInstructions) { if (emitInfo->EmitCondCodes) { /* IF condcode THEN ... */ - struct prog_instruction *ifInst; - ifInst = new_instruction(emitInfo, OPCODE_IF); + struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_IF); + if (!ifInst) { + return NULL; + } ifInst->DstReg.CondMask = COND_NE; /* if cond is non-zero */ /* only test the cond code (1 of 4) that was updated by the * previous instruction. @@ -1620,6 +1657,9 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) else { /* conditional jump to else, or endif */ struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_BRA); + if (!ifInst) { + return NULL; + } ifInst->DstReg.CondMask = COND_EQ; /* BRA if cond is zero */ inst_comment(ifInst, "if zero"); ifInst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); @@ -1632,12 +1672,17 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) /* have else body */ elseInstLoc = prog->NumInstructions; if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ELSE); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ELSE); + if (!inst) { + return NULL; + } } else { /* jump to endif instruction */ - struct prog_instruction *inst; - inst = new_instruction(emitInfo, OPCODE_BRA); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_BRA); + if (!inst) { + return NULL; + } inst_comment(inst, "else"); inst->DstReg.CondMask = COND_TR; /* always branch */ } @@ -1650,7 +1695,10 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) } if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ENDIF); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ENDIF); + if (!inst) { + return NULL; + } } if (n->Children[2]) { @@ -1671,7 +1719,10 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) /* emit OPCODE_BGNLOOP */ beginInstLoc = prog->NumInstructions; if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_BGNLOOP); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_BGNLOOP); + if (!inst) { + return NULL; + } } /* body */ @@ -1689,10 +1740,16 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) if (emitInfo->EmitHighLevelInstructions) { /* emit OPCODE_ENDLOOP */ endInst = new_instruction(emitInfo, OPCODE_ENDLOOP); + if (!endInst) { + return NULL; + } } else { /* emit unconditional BRA-nch */ endInst = new_instruction(emitInfo, OPCODE_BRA); + if (!endInst) { + return NULL; + } endInst->DstReg.CondMask = COND_TR; /* always true */ } /* ENDLOOP's BranchTarget points to the BGNLOOP inst */ @@ -1762,7 +1819,9 @@ emit_cont_break(slang_emit_info *emitInfo, slang_ir_node *n) } n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_TR; /* always true */ + if (inst) { + inst->DstReg.CondMask = COND_TR; /* always true */ + } return inst; } @@ -1798,8 +1857,10 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) */ const GLuint condWritemask = inst->DstReg.WriteMask; inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + if (inst) { + inst->DstReg.CondMask = COND_NE; + inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + } return inst; } else { @@ -1817,7 +1878,13 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); + if (!inst) { + return NULL; + } inst = new_instruction(emitInfo, OPCODE_ENDIF); + if (!inst) { + return NULL; + } emitInfo->prog->Instructions[ifInstLoc].BranchTarget = emitInfo->prog->NumInstructions; @@ -1828,8 +1895,10 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) const GLuint condWritemask = inst->DstReg.WriteMask; assert(emitInfo->EmitCondCodes); inst = new_instruction(emitInfo, OPCODE_BRA); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + if (inst) { + inst->DstReg.CondMask = COND_NE; + inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + } return inst; } } @@ -2201,7 +2270,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) if (n->Comment) { inst = new_instruction(emitInfo, OPCODE_NOP); - inst->Comment = _mesa_strdup(n->Comment); + if (inst) { + inst->Comment = _mesa_strdup(n->Comment); + } inst = NULL; } @@ -2503,6 +2574,9 @@ _slang_emit_code(slang_ir_node *n, slang_var_table *vt, if (withEnd) { struct prog_instruction *inst; inst = new_instruction(&emitInfo, OPCODE_END); + if (!inst) { + return GL_FALSE; + } } _slang_resolve_subroutines(&emitInfo); diff --git a/mesalib/src/mesa/shader/slang/slang_link.c b/mesalib/src/mesa/shader/slang/slang_link.c index 144c12652..0a2bc4978 100644 --- a/mesalib/src/mesa/shader/slang/slang_link.c +++ b/mesalib/src/mesa/shader/slang/slang_link.c @@ -515,7 +515,7 @@ _slang_update_inputs_outputs(struct gl_program *prog) } if (inst->DstReg.File == PROGRAM_OUTPUT) { - prog->OutputsWritten |= 1 << inst->DstReg.Index; + prog->OutputsWritten |= BITFIELD64_BIT(inst->DstReg.Index); if (inst->DstReg.RelAddr) { /* If the output attribute is indexed with relative addressing * we know that it must be a varying or texcoord such as @@ -528,14 +528,17 @@ _slang_update_inputs_outputs(struct gl_program *prog) if (prog->Target == GL_VERTEX_PROGRAM_ARB) { if (inst->DstReg.Index == VERT_RESULT_TEX0) { /* mark all texcoord outputs as written */ - const GLbitfield mask = - ((1 << MAX_TEXTURE_COORD_UNITS) - 1) << VERT_RESULT_TEX0; + const GLbitfield64 mask = + BITFIELD64_RANGE(VERT_RESULT_TEX0, + (VERT_RESULT_TEX0 + + MAX_TEXTURE_COORD_UNITS - 1)); prog->OutputsWritten |= mask; } else if (inst->DstReg.Index == VERT_RESULT_VAR0) { /* mark all generic varying outputs as written */ - const GLbitfield mask = - ((1 << MAX_VARYING) - 1) << VERT_RESULT_VAR0; + const GLbitfield64 mask = + BITFIELD64_RANGE(VERT_RESULT_VAR0, + (VERT_RESULT_VAR0 + MAX_VARYING - 1)); prog->OutputsWritten |= mask; } } @@ -807,7 +810,8 @@ _slang_link(GLcontext *ctx, if (shProg->VertexProgram) { _slang_update_inputs_outputs(&shProg->VertexProgram->Base); _slang_count_temporaries(&shProg->VertexProgram->Base); - if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { + if (!(shProg->VertexProgram->Base.OutputsWritten + & BITFIELD64_BIT(VERT_RESULT_HPOS))) { /* the vertex program did not compute a vertex position */ link_error(shProg, "gl_Position was not written by vertex shader\n"); @@ -825,7 +829,7 @@ _slang_link(GLcontext *ctx, if (shProg->FragmentProgram) { const GLbitfield varyingRead = shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0; - const GLbitfield varyingWritten = shProg->VertexProgram ? + const GLbitfield64 varyingWritten = shProg->VertexProgram ? shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0; if ((varyingRead & varyingWritten) != varyingRead) { link_error(shProg, @@ -836,9 +840,10 @@ _slang_link(GLcontext *ctx, /* check that gl_FragColor and gl_FragData are not both written to */ if (shProg->FragmentProgram) { - GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten; - if ((outputsWritten & ((1 << FRAG_RESULT_COLOR))) && - (outputsWritten >= (1 << FRAG_RESULT_DATA0))) { + const GLbitfield64 outputsWritten = + shProg->FragmentProgram->Base.OutputsWritten; + if ((outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) && + (outputsWritten >= BITFIELD64_BIT(FRAG_RESULT_DATA0))) { link_error(shProg, "Fragment program cannot write both gl_FragColor" " and gl_FragData[].\n"); return; diff --git a/mesalib/src/mesa/shader/slang/slang_simplify.c b/mesalib/src/mesa/shader/slang/slang_simplify.c index b8a21f642..13b9ca3c8 100644 --- a/mesalib/src/mesa/shader/slang/slang_simplify.c +++ b/mesalib/src/mesa/shader/slang/slang_simplify.c @@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; + GLint values[16]; + values[0] = -1; + _mesa_GetIntegerv(info[i].Token, values); + ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ + return values[0]; } } return -1; diff --git a/mesalib/src/mesa/shader/slang/slang_vartable.c b/mesalib/src/mesa/shader/slang/slang_vartable.c index a4ebacc09..e07e3a226 100644 --- a/mesalib/src/mesa/shader/slang/slang_vartable.c +++ b/mesalib/src/mesa/shader/slang/slang_vartable.c @@ -311,10 +311,10 @@ _slang_free_temp(slang_var_table *vt, slang_ir_storage *store) { struct table *t = vt->Top; GLuint i; - GLuint r = store->Index; + GLint r = store->Index; assert(store->Size > 0); assert(r >= 0); - assert(r + store->Size <= vt->MaxRegisters * 4); + assert((GLuint)r + store->Size <= vt->MaxRegisters * 4); if (dbg) printf("Free temp sz %d at %d.%s (level %d) store %p\n", store->Size, r, _mesa_swizzle_string(store->Swizzle, 0, 0), diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak index fa2a6307a..a0d7dbbac 100644 --- a/mesalib/src/mesa/sources.mak +++ b/mesalib/src/mesa/sources.mak @@ -33,6 +33,7 @@ MAIN_SOURCES = \ main/feedback.c \ main/ffvertex_prog.c \ main/fog.c \ + main/formats.c \ main/framebuffer.c \ main/get.c \ main/getstring.c \ @@ -55,6 +56,7 @@ MAIN_SOURCES = \ main/rastpos.c \ main/rbadaptors.c \ main/readpix.c \ + main/remap.c \ main/renderbuffer.c \ main/scissor.c \ main/shaders.c \ @@ -67,6 +69,7 @@ MAIN_SOURCES = \ main/texcompress_fxt1.c \ main/texenv.c \ main/texenvprogram.c \ + main/texfetch.c \ main/texformat.c \ main/texgen.c \ main/texgetimage.c \ @@ -115,7 +118,6 @@ SWRAST_SOURCES = \ swrast/s_feedback.c \ swrast/s_fog.c \ swrast/s_fragprog.c \ - swrast/s_imaging.c \ swrast/s_lines.c \ swrast/s_logic.c \ swrast/s_masking.c \ @@ -125,7 +127,6 @@ SWRAST_SOURCES = \ swrast/s_stencil.c \ swrast/s_texcombine.c \ swrast/s_texfilter.c \ - swrast/s_texstore.c \ swrast/s_triangle.c \ swrast/s_zoom.c @@ -190,7 +191,6 @@ STATETRACKER_SOURCES = \ state_tracker/st_cb_bufferobjects.c \ state_tracker/st_cb_clear.c \ state_tracker/st_cb_flush.c \ - state_tracker/st_cb_get.c \ state_tracker/st_cb_drawpixels.c \ state_tracker/st_cb_fbo.c \ state_tracker/st_cb_feedback.c \ diff --git a/mesalib/src/mesa/swrast/NOTES b/mesalib/src/mesa/swrast/NOTES deleted file mode 100644 index f906e41b9..000000000 --- a/mesalib/src/mesa/swrast/NOTES +++ /dev/null @@ -1,55 +0,0 @@ -INTRODUCTION - -Mesa's native software rasterizer. This module provides the fallback -paths for rasterization operations and states that aren't accelerated -in hardware drivers, and as the full rasterization engine in software -drivers. - -The swrast module 'stands alone', relying only on interfaces to core -mesa and it's own driver interface. It knows nothing about the tnl or -other modules, allowing it to be used for fallback paths in future tnl -schemes without modification. - -As well as providing triangle/line/point rasterization functionality, -the module provides implementations of the pixel operations -(ReadPixels, etc), and texture operations (CopyTexSubImage) which may -be plugged in to the core Mesa driver interface where accelerated -versions of these operations are unavailable. - - -STATE - -To create and destroy the module: - - GLboolean _swrast_CreateContext( GLcontext *ctx ); - void _swrast_DestroyContext( GLcontext *ctx ); - -This module tracks state changes internally and maintains derived -values based on the current state. For this to work, the driver -ensure the following funciton is called whenever the state changes and -the swsetup module is 'awake': - - void _swrast_InvalidateState( GLcontext *ctx, GLuint new_state ); - -There is no explicit call to put the swrast module to sleep. - - -CUSTOMIZATION - - void (*choose_point)( GLcontext * ); - void (*choose_line)( GLcontext * ); - void (*choose_triangle)( GLcontext * ); - -Drivers may add additional triangle/line/point functions to swrast by -overriding these functions. It is necessary for the driver to be very -careful that it doesn't return an inappropriate function, eg a -rasterization function in feedback mode. See the X11 driver for -examples. - -DRIVER INTERFACE - -The swrast device driver provides swrast primarily with span- and -pixel- level interfaces to a framebuffer, with a few additional hooks -for locking and setting the read buffer. - -See the definition of struct swrast_device_driver in swrast.h. \ No newline at end of file diff --git a/mesalib/src/mesa/swrast/s_atifragshader.c b/mesalib/src/mesa/swrast/s_atifragshader.c index 5fefae6c4..e88ff1912 100644 --- a/mesalib/src/mesa/swrast/s_atifragshader.c +++ b/mesalib/src/mesa/swrast/s_atifragshader.c @@ -279,7 +279,7 @@ handle_sample_op(GLcontext * ctx, struct atifs_machine *machine, /* sample from unit idx using texinst->src as coords */ GLuint swizzle = texinst->swizzle; GLuint coord_source = texinst->src; - GLfloat tex_coords[4]; + GLfloat tex_coords[4] = { 0 }; if (coord_source >= GL_TEXTURE0_ARB && coord_source <= GL_TEXTURE7_ARB) { coord_source -= GL_TEXTURE0_ARB; diff --git a/mesalib/src/mesa/swrast/s_clear.c b/mesalib/src/mesa/swrast/s_clear.c index 35080fd39..002718ded 100644 --- a/mesalib/src/mesa/swrast/s_clear.c +++ b/mesalib/src/mesa/swrast/s_clear.c @@ -24,6 +24,7 @@ #include "main/glheader.h" #include "main/colormac.h" +#include "main/formats.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" @@ -211,9 +212,6 @@ clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) ASSERT(!ctx->Visual.rgbMode); - ASSERT((ctx->Color.IndexMask & ((1 << rb->IndexBits) - 1)) - == (GLuint) ((1 << rb->IndexBits) - 1)); - ASSERT(rb->PutMonoRow); /* setup clear value */ @@ -264,8 +262,8 @@ clear_color_buffers(GLcontext *ctx) } else { struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - const GLuint indexBits = (1 << rb->IndexBits) - 1; - if ((ctx->Color.IndexMask & indexBits) == indexBits) { + const GLuint indexMask = (1 << _mesa_get_format_bits(rb->Format, GL_INDEX_BITS)) - 1; + if ((ctx->Color.IndexMask & indexMask) == indexMask) { masking = GL_FALSE; } else { diff --git a/mesalib/src/mesa/swrast/s_depth.c b/mesalib/src/mesa/swrast/s_depth.c index 7086cae0c..c37a54eb3 100644 --- a/mesalib/src/mesa/swrast/s_depth.c +++ b/mesalib/src/mesa/swrast/s_depth.c @@ -25,6 +25,7 @@ #include "main/glheader.h" #include "main/context.h" +#include "main/formats.h" #include "main/macros.h" #include "main/imports.h" #include "main/fbobject.h" @@ -497,6 +498,43 @@ depth_test_span32( GLcontext *ctx, GLuint n, return passed; } +/* Apply ARB_depth_clamp to span of fragments. */ +void +_swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ) +{ + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->_DepthBuffer; + const GLuint count = span->end; + GLuint *zValues = span->array->z; + GLuint min, max; + GLfloat min_f, max_f; + int i; + + if (ctx->Viewport.Near < ctx->Viewport.Far) { + min_f = ctx->Viewport.Near; + max_f = ctx->Viewport.Far; + } else { + min_f = ctx->Viewport.Far; + max_f = ctx->Viewport.Near; + } + + if (rb->DataType == GL_UNSIGNED_SHORT) { + CLAMPED_FLOAT_TO_USHORT(min, min_f); + CLAMPED_FLOAT_TO_USHORT(max, max_f); + } else { + assert(rb->DataType == GL_UNSIGNED_INT); + min = FLOAT_TO_UINT(min_f); + max = FLOAT_TO_UINT(max_f); + } + + for (i = 0; i < count; i++) { + if (zValues[i] < min) + zValues[i] = min; + if (zValues[i] > max) + zValues[i] = max; + } +} + /* @@ -1272,12 +1310,16 @@ void _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, GLint n, GLint x, GLint y, GLuint depth[] ) { + GLuint depthBits; + if (!rb) { /* really only doing this to prevent FP exceptions later */ _mesa_bzero(depth, n * sizeof(GLuint)); return; } + depthBits = _mesa_get_format_bits(rb->Format, GL_DEPTH_BITS); + ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT); if (y < 0 || y >= (GLint) rb->Height || @@ -1309,8 +1351,8 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (rb->DataType == GL_UNSIGNED_INT) { rb->GetRow(ctx, rb, n, x, y, depth); - if (rb->DepthBits < 32) { - GLuint shift = 32 - rb->DepthBits; + if (depthBits < 32) { + GLuint shift = 32 - depthBits; GLint i; for (i = 0; i < n; i++) { GLuint z = depth[i]; @@ -1322,14 +1364,14 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, GLushort temp[MAX_WIDTH]; GLint i; rb->GetRow(ctx, rb, n, x, y, temp); - if (rb->DepthBits == 16) { + if (depthBits == 16) { for (i = 0; i < n; i++) { GLuint z = temp[i]; depth[i] = (z << 16) | z; } } else { - GLuint shift = 16 - rb->DepthBits; + GLuint shift = 16 - depthBits; for (i = 0; i < n; i++) { GLuint z = temp[i]; depth[i] = (z << (shift + 16)) | (z << shift); /* XXX lsb bits? */ diff --git a/mesalib/src/mesa/swrast/s_depth.h b/mesalib/src/mesa/swrast/s_depth.h index 368862568..7eae36674 100644 --- a/mesalib/src/mesa/swrast/s_depth.h +++ b/mesalib/src/mesa/swrast/s_depth.h @@ -33,6 +33,8 @@ extern GLuint _swrast_depth_test_span( GLcontext *ctx, SWspan *span); +extern void +_swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ); extern GLboolean _swrast_depth_bounds_test( GLcontext *ctx, SWspan *span ); diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c index 77a77f0bc..a22d34415 100644 --- a/mesalib/src/mesa/swrast/s_fragprog.c +++ b/mesalib/src/mesa/swrast/s_fragprog.c @@ -190,7 +190,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_fragment_program *program = ctx->FragmentProgram._Current; - const GLbitfield outputsWritten = program->Base.OutputsWritten; + const GLbitfield64 outputsWritten = program->Base.OutputsWritten; struct gl_program_machine *machine = &swrast->FragProgMachine; GLuint i; @@ -201,7 +201,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) if (_mesa_execute_program(ctx, &program->Base, machine)) { /* Store result color */ - if (outputsWritten & (1 << FRAG_RESULT_COLOR)) { + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) { COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], machine->Outputs[FRAG_RESULT_COLOR]); } @@ -212,7 +212,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) */ GLuint buf; for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) { - if (outputsWritten & (1 << (FRAG_RESULT_DATA0 + 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]); } @@ -220,7 +220,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) } /* Store result depth/z */ - if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) { + 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; @@ -256,12 +256,12 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) run_program(ctx, span, 0, span->end); - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR)) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) { span->interpMask &= ~SPAN_RGBA; span->arrayMask |= SPAN_RGBA; } - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) { + 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_imaging.c b/mesalib/src/mesa/swrast/s_imaging.c deleted file mode 100644 index 3578b713f..000000000 --- a/mesalib/src/mesa/swrast/s_imaging.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * 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. - */ - -/* KW: Moved these here to remove knowledge of swrast from core mesa. - * Should probably pull the entire software implementation of these - * extensions into either swrast or a sister module. - */ - -#include "main/glheader.h" -#include "main/colortab.h" -#include "main/convolve.h" -#include "s_context.h" -#include "s_span.h" - - -void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, rgba ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - /* store as convolution filter */ - _mesa_ConvolutionFilter1D(target, internalFormat, width, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - struct gl_pixelstore_attrib packSave; - GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4]; - GLint i; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - swrast_render_start(ctx); - - /* read pixels from framebuffer */ - for (i = 0; i < height; i++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y + i, CHAN_TYPE, rgba[i] ); - } - - swrast_render_finish(ctx); - - /* - * HACK: save & restore context state so we can store this as a - * convolution filter via the GL api. Doesn't call any callbacks - * hanging off ctx->Unpack statechanges. - */ - - packSave = ctx->Unpack; /* save pixel packing params */ - - ctx->Unpack.Alignment = 1; - ctx->Unpack.RowLength = MAX_CONVOLUTION_WIDTH; - ctx->Unpack.SkipPixels = 0; - ctx->Unpack.SkipRows = 0; - ctx->Unpack.ImageHeight = 0; - ctx->Unpack.SkipImages = 0; - ctx->Unpack.SwapBytes = GL_FALSE; - ctx->Unpack.LsbFirst = GL_FALSE; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - ctx->NewState |= _NEW_PACKUNPACK; - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ConvolutionFilter2D(target, internalFormat, width, height, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; - - ctx->Unpack = packSave; /* restore pixel packing params */ - ctx->NewState |= _NEW_PACKUNPACK; -} diff --git a/mesalib/src/mesa/swrast/s_readpix.c b/mesalib/src/mesa/swrast/s_readpix.c index 48b9408d2..44a11cd6d 100644 --- a/mesalib/src/mesa/swrast/s_readpix.c +++ b/mesalib/src/mesa/swrast/s_readpix.c @@ -29,6 +29,7 @@ #include "main/convolve.h" #include "main/context.h" #include "main/feedback.h" +#include "main/formats.h" #include "main/image.h" #include "main/macros.h" #include "main/imports.h" @@ -107,7 +108,7 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 16-bit unsigned depth values. */ GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT16); + 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, @@ -119,8 +120,12 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 24-bit unsigned depth values. */ GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT24); - ASSERT(rb->DataType == GL_UNSIGNED_INT); + 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, @@ -128,9 +133,18 @@ read_depth_pixels( GLcontext *ctx, GLint k; rb->GetRow(ctx, rb, width, x, y, dest); /* convert range from 24-bit to 32-bit */ - for (k = 0; k < width; k++) { - /* Note: put MSByte of 24-bit value into LSByte */ - dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff); + 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); + } } } } @@ -138,7 +152,7 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 32-bit unsigned depth values. */ GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT32); + 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, @@ -555,15 +569,15 @@ _swrast_ReadPixels( GLcontext *ctx, 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 (ctx->NewState) - _mesa_update_state(ctx); - if (swrast->NewState) _swrast_validate_derived( ctx ); diff --git a/mesalib/src/mesa/swrast/s_span.c b/mesalib/src/mesa/swrast/s_span.c index 0e2793b47..d36c8132f 100644 --- a/mesalib/src/mesa/swrast/s_span.c +++ b/mesalib/src/mesa/swrast/s_span.c @@ -885,6 +885,9 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); + if (ctx->Transform.DepthClamp) + _swrast_depth_clamp_span(ctx, span); + if (ctx->Stencil._Enabled) { if (!_swrast_stencil_and_ztest_span(ctx, span)) { span->arrayMask = origArrayMask; @@ -901,7 +904,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; @@ -909,7 +911,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) for (i = 0; i < span->end; i++) q->Result += span->array->mask[i]; } -#endif /* we have to wait until after occlusion to do this test */ if (ctx->Color.IndexMask == 0) { @@ -1355,6 +1356,10 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (ctx->Stencil._Enabled || ctx->Depth.Test) { if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); + + if (ctx->Transform.DepthClamp) + _swrast_depth_clamp_span(ctx, span); + if (ctx->Stencil._Enabled) { /* Combined Z/stencil tests */ if (!_swrast_stencil_and_ztest_span(ctx, span)) { @@ -1373,7 +1378,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; @@ -1381,7 +1385,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) for (i = 0; i < span->end; i++) q->Result += span->array->mask[i]; } -#endif /* We had to wait until now to check for glColorMask(0,0,0,0) because of * the occlusion test. diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c index efe6f2347..0bb988e3e 100644 --- a/mesalib/src/mesa/swrast/s_texfilter.c +++ b/mesalib/src/mesa/swrast/s_texfilter.c @@ -745,7 +745,7 @@ get_border_color(const struct gl_texture_object *tObj, const struct gl_texture_image *img, GLfloat rgba[4]) { - switch (img->TexFormat->BaseFormat) { + switch (img->_BaseFormat) { case GL_RGB: rgba[0] = tObj->BorderColor[0]; rgba[1] = tObj->BorderColor[1]; @@ -1152,7 +1152,7 @@ sample_2d_linear_repeat(GLcontext *ctx, ASSERT(tObj->WrapS == GL_REPEAT); ASSERT(tObj->WrapT == GL_REPEAT); ASSERT(img->Border == 0); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); + ASSERT(img->_BaseFormat != GL_COLOR_INDEX); ASSERT(img->_IsPowerOfTwo); linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi); @@ -1343,17 +1343,17 @@ opt_sample_rgb_2d(GLcontext *ctx, ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); ASSERT(img->Border==0); - ASSERT(img->TexFormat->MesaFormat==MESA_FORMAT_RGB); + ASSERT(img->TexFormat == MESA_FORMAT_RGB888); ASSERT(img->_IsPowerOfTwo); for (k=0; kData) + 3*pos; - rgba[k][RCOMP] = CHAN_TO_FLOAT(texel[0]); - rgba[k][GCOMP] = CHAN_TO_FLOAT(texel[1]); - rgba[k][BCOMP] = CHAN_TO_FLOAT(texel[2]); + GLubyte *texel = ((GLubyte *) img->Data) + 3*pos; + rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[2]); + rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]); + rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[0]); } } @@ -1384,18 +1384,18 @@ opt_sample_rgba_2d(GLcontext *ctx, ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); ASSERT(img->Border==0); - ASSERT(img->TexFormat->MesaFormat==MESA_FORMAT_RGBA); + ASSERT(img->TexFormat == MESA_FORMAT_RGBA8888); ASSERT(img->_IsPowerOfTwo); for (i = 0; i < n; i++) { const GLint col = IFLOOR(texcoords[i][0] * width) & colMask; const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; - const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ - rgba[i][RCOMP] = CHAN_TO_FLOAT(texel[0]); - rgba[i][GCOMP] = CHAN_TO_FLOAT(texel[1]); - rgba[i][BCOMP] = CHAN_TO_FLOAT(texel[2]); - rgba[i][ACOMP] = CHAN_TO_FLOAT(texel[3]); + const GLuint texel = *((GLuint *) img->Data + pos); + rgba[i][RCOMP] = UBYTE_TO_FLOAT( (texel >> 24) ); + rgba[i][GCOMP] = UBYTE_TO_FLOAT( (texel >> 16) & 0xff ); + rgba[i][BCOMP] = UBYTE_TO_FLOAT( (texel >> 8) & 0xff ); + rgba[i][ACOMP] = UBYTE_TO_FLOAT( (texel ) & 0xff ); } } @@ -1414,7 +1414,7 @@ sample_lambda_2d(GLcontext *ctx, const GLboolean repeatNoBorderPOT = (tObj->WrapS == GL_REPEAT) && (tObj->WrapT == GL_REPEAT) && (tImg->Border == 0 && (tImg->Width == tImg->RowStride)) - && (tImg->TexFormat->BaseFormat != GL_COLOR_INDEX) + && (tImg->_BaseFormat != GL_COLOR_INDEX) && tImg->_IsPowerOfTwo; ASSERT(lambda != NULL); @@ -1427,12 +1427,12 @@ sample_lambda_2d(GLcontext *ctx, switch (tObj->MinFilter) { case GL_NEAREST: if (repeatNoBorderPOT) { - switch (tImg->TexFormat->MesaFormat) { - case MESA_FORMAT_RGB: + switch (tImg->TexFormat) { + case MESA_FORMAT_RGB888: opt_sample_rgb_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; - case MESA_FORMAT_RGBA: + case MESA_FORMAT_RGBA8888: opt_sample_rgba_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; @@ -1484,12 +1484,12 @@ sample_lambda_2d(GLcontext *ctx, switch (tObj->MagFilter) { case GL_NEAREST: if (repeatNoBorderPOT) { - switch (tImg->TexFormat->MesaFormat) { - case MESA_FORMAT_RGB: + switch (tImg->TexFormat) { + case MESA_FORMAT_RGB888: opt_sample_rgb_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; - case MESA_FORMAT_RGBA: + case MESA_FORMAT_RGBA8888: opt_sample_rgba_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; @@ -1905,8 +1905,12 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - newCoord[0] = ( sc / ma + 1.0F ) * 0.5F; - newCoord[1] = ( tc / ma + 1.0F ) * 0.5F; + { + const float ima = 1.0F / ma; + newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; + newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; + } + return (const struct gl_texture_image **) texObj->Image[face]; } @@ -2148,7 +2152,7 @@ sample_nearest_rect(GLcontext *ctx, ASSERT(tObj->WrapT == GL_CLAMP || tObj->WrapT == GL_CLAMP_TO_EDGE || tObj->WrapT == GL_CLAMP_TO_BORDER); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); + ASSERT(img->_BaseFormat != GL_COLOR_INDEX); for (i = 0; i < n; i++) { GLint row, col; @@ -2182,7 +2186,7 @@ sample_linear_rect(GLcontext *ctx, ASSERT(tObj->WrapT == GL_CLAMP || tObj->WrapT == GL_CLAMP_TO_EDGE || tObj->WrapT == GL_CLAMP_TO_BORDER); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); + ASSERT(img->_BaseFormat != GL_COLOR_INDEX); for (i = 0; i < n; i++) { GLint i0, j0, i1, j1; @@ -2969,8 +2973,8 @@ sample_depth_texture( GLcontext *ctx, (void) lambda; - ASSERT(img->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - img->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT); + ASSERT(img->_BaseFormat == GL_DEPTH_COMPONENT || + img->_BaseFormat == GL_DEPTH_STENCIL_EXT); ASSERT(tObj->Target == GL_TEXTURE_1D || tObj->Target == GL_TEXTURE_2D || @@ -3133,7 +3137,7 @@ null_sample_func( GLcontext *ctx, rgba[i][RCOMP] = 0; rgba[i][GCOMP] = 0; rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = CHAN_MAX; + rgba[i][ACOMP] = 1.0; } } @@ -3150,7 +3154,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, } else { const GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter); - const GLenum format = t->Image[0][t->BaseLevel]->TexFormat->BaseFormat; + const GLenum format = t->Image[0][t->BaseLevel]->_BaseFormat; switch (t->Target) { case GL_TEXTURE_1D: @@ -3185,14 +3189,14 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, t->WrapT == GL_REPEAT && img->_IsPowerOfTwo && img->Border == 0 && - img->TexFormat->MesaFormat == MESA_FORMAT_RGB) { + img->TexFormat == MESA_FORMAT_RGB888) { return &opt_sample_rgb_2d; } else if (t->WrapS == GL_REPEAT && t->WrapT == GL_REPEAT && img->_IsPowerOfTwo && img->Border == 0 && - img->TexFormat->MesaFormat == MESA_FORMAT_RGBA) { + img->TexFormat == MESA_FORMAT_RGBA8888) { return &opt_sample_rgba_2d; } else { diff --git a/mesalib/src/mesa/swrast/s_texstore.c b/mesalib/src/mesa/swrast/s_texstore.c deleted file mode 100644 index f9ff9ad6a..000000000 --- a/mesalib/src/mesa/swrast/s_texstore.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - * 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. - */ - -/* - * Authors: - * Brian Paul - */ - - -/* - * The functions in this file are mostly related to software texture fallbacks. - * This includes texture image transfer/packing and texel fetching. - * Hardware drivers will likely override most of this. - */ - - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/convolve.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/mipmap.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "main/texstore.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_span.h" - - -/** - * Read an RGBA image from the frame buffer. - * This is used by glCopyTex[Sub]Image[12]D(). - * \param x window source x - * \param y window source y - * \param width image width - * \param height image height - * \param type datatype for returned GL_RGBA image - * \return pointer to image - */ -static GLvoid * -read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type); - const GLint stride = width * pixelSize; - GLint row; - GLubyte *image, *dst; - - image = (GLubyte *) _mesa_malloc(width * height * pixelSize); - if (!image) - return NULL; - - swrast_render_start(ctx); - - dst = image; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst); - dst += stride; - } - - swrast_render_finish(ctx); - - return image; -} - - -/** - * As above, but read data from depth buffer. Returned as GLuints. - * \sa read_color_image - */ -static GLuint * -read_depth_image( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer; - GLuint *image, *dst; - GLint i; - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - swrast_render_start(ctx); - - dst = image; - for (i = 0; i < height; i++) { - _swrast_read_depth_span_uint(ctx, rb, width, x, y + i, dst); - dst += width; - } - - swrast_render_finish(ctx); - - return image; -} - - -/** - * As above, but read data from depth+stencil buffers. - */ -static GLuint * -read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height) -{ - struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer; - GLuint *image, *dst; - GLint i; - - ASSERT(depthRb); - ASSERT(stencilRb); - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - swrast_render_start(ctx); - - /* read from depth buffer */ - dst = image; - if (depthRb->DataType == GL_UNSIGNED_INT) { - for (i = 0; i < height; i++) { - _swrast_get_row(ctx, depthRb, width, x, y + i, dst, sizeof(GLuint)); - dst += width; - } - } - else { - GLushort z16[MAX_WIDTH]; - ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < height; i++) { - GLint j; - _swrast_get_row(ctx, depthRb, width, x, y + i, z16, sizeof(GLushort)); - /* convert GLushorts to GLuints */ - for (j = 0; j < width; j++) { - dst[j] = z16[j]; - } - dst += width; - } - } - - /* put depth values into bits 0xffffff00 */ - if (ctx->ReadBuffer->Visual.depthBits == 24) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] <<= 8; - } - } - else if (ctx->ReadBuffer->Visual.depthBits == 16) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] = (image[j] << 16) | (image[j] & 0xff00); - } - } - else { - /* this handles arbitrary depthBits >= 12 */ - const GLint rShift = ctx->ReadBuffer->Visual.depthBits; - const GLint lShift = 32 - rShift; - GLint j; - for (j = 0; j < width * height; j++) { - GLuint z = (image[j] << lShift); - image[j] = z | (z >> rShift); - } - } - - /* read stencil values and interleave into image array */ - dst = image; - for (i = 0; i < height; i++) { - GLstencil stencil[MAX_WIDTH]; - GLint j; - ASSERT(8 * sizeof(GLstencil) == stencilRb->StencilBits); - _swrast_get_row(ctx, stencilRb, width, x, y + i, - stencil, sizeof(GLstencil)); - for (j = 0; j < width; j++) { - dst[j] = (dst[j] & 0xffffff00) | (stencil[j] & 0xff); - } - dst += width; - } - - swrast_render_finish(ctx); - - return image; -} - - -static GLboolean -is_depth_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean -is_depth_stencil_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/* - * Fallback for Driver.CopyTexImage1D(). - */ -void -_swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/** - * Fallback for Driver.CopyTexImage2D(). - * - * We implement CopyTexImage by reading the image from the framebuffer - * then passing it to the ctx->Driver.TexImage2D() function. - * - * Device drivers should try to implement direct framebuffer->texture copies. - */ -void -_swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage1D(). - */ -void -_swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - - /* call glTexSubImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" ); - return; - } - /* now call glTexSubImage1D to do the real work */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/** - * Fallback for Driver.CopyTexSubImage2D(). - * - * Read the image from the framebuffer then hand it - * off to ctx->Driver.TexSubImage2D(). - */ -void -_swrast_copy_texsubimage2d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" ); - return; - } - /* now call glTexSubImage2D to do the real work */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage3D(). - */ -void -_swrast_copy_texsubimage3d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage3D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" ); - return; - } - /* now call glTexSubImage3D to do the real work */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} diff --git a/mesalib/src/mesa/swrast/s_triangle.c b/mesalib/src/mesa/swrast/s_triangle.c index 1ab0e19f9..5bec60669 100644 --- a/mesalib/src/mesa/swrast/s_triangle.c +++ b/mesalib/src/mesa/swrast/s_triangle.c @@ -134,22 +134,24 @@ _swrast_culltriangle( GLcontext *ctx, #define SETUP_CODE \ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ - const GLint smask = obj->Image[0][b]->Width - 1; \ - const GLint tmask = obj->Image[0][b]->Height - 1; \ + 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; \ - GLchan rgb[MAX_WIDTH][3]; \ + 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++) { \ @@ -157,9 +159,9 @@ _swrast_culltriangle( GLcontext *ctx, 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]; \ + rgb[i][RCOMP] = texture[pos+2]; \ rgb[i][GCOMP] = texture[pos+1]; \ - rgb[i][BCOMP] = texture[pos+2]; \ + rgb[i][BCOMP] = texture[pos+0]; \ span.intTex[0] += span.intTexStep[0]; \ span.intTex[1] += span.intTexStep[1]; \ } \ @@ -186,22 +188,24 @@ _swrast_culltriangle( GLcontext *ctx, #define SETUP_CODE \ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ - const GLint smask = obj->Image[0][b]->Width - 1; \ - const GLint tmask = obj->Image[0][b]->Height - 1; \ + 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; \ - GLchan rgb[MAX_WIDTH][3]; \ + 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++) { \ @@ -211,9 +215,9 @@ _swrast_culltriangle( GLcontext *ctx, 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]; \ + rgb[i][RCOMP] = texture[pos+2]; \ rgb[i][GCOMP] = texture[pos+1]; \ - rgb[i][BCOMP] = texture[pos+2]; \ + rgb[i][BCOMP] = texture[pos+0]; \ zRow[i] = z; \ span.array->mask[i] = 1; \ } \ @@ -276,25 +280,29 @@ affine_span(GLcontext *ctx, SWspan *span, * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST). */ -#define NEAREST_RGB \ - sample[RCOMP] = tex00[RCOMP]; \ - sample[GCOMP] = tex00[GCOMP]; \ - sample[BCOMP] = tex00[BCOMP]; \ - sample[ACOMP] = CHAN_MAX +#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[0], tex01[0], tex10[0], tex11[0]);\ + 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[2], tex01[2], tex10[2], tex11[2]);\ + sample[BCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\ sample[ACOMP] = CHAN_MAX; -#define NEAREST_RGBA COPY_CHAN4(sample, tex00) +#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[0], tex01[0], tex10[0], tex11[0]);\ - sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\ - sample[BCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ - sample[ACOMP] = ilerp_2d(sf, tf, tex00[3], tex01[3], tex10[3], tex11[3]) + 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); \ @@ -345,7 +353,11 @@ affine_span(GLcontext *ctx, SWspan *span, dest[2] = sample[2]; \ dest[3] = FixedToInt(span->alpha); -#define NEAREST_RGBA_REPLACE COPY_CHAN4(dest, tex00) +#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++) { \ @@ -406,7 +418,7 @@ affine_span(GLcontext *ctx, SWspan *span, switch (info->filter) { case GL_NEAREST: switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGB;MODULATE,3); @@ -426,7 +438,7 @@ affine_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch(info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGBA;MODULATE,4); @@ -455,7 +467,7 @@ affine_span(GLcontext *ctx, SWspan *span, span->intTex[0] -= FIXED_HALF; span->intTex[1] -= FIXED_HALF; switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGB;MODULATE,3); @@ -475,7 +487,7 @@ affine_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGBA;MODULATE,4); @@ -528,18 +540,22 @@ affine_span(GLcontext *ctx, SWspan *span, #define SETUP_CODE \ struct affine_info info; \ struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - info.texture = (const GLchan *) obj->Image[0][b]->Data; \ - info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ - info.smask = obj->Image[0][b]->Width - 1; \ - info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->_BaseFormat; \ + 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->MinFilter; \ info.envmode = unit->EnvMode; \ + info.er = 0; \ + info.eg = 0; \ + info.eb = 0; \ span.arrayMask |= SPAN_RGBA; \ \ if (info.envmode == GL_BLEND) { \ @@ -555,25 +571,17 @@ affine_span(GLcontext *ctx, SWspan *span, } \ \ switch (info.format) { \ - case GL_ALPHA: \ - case GL_LUMINANCE: \ - case GL_INTENSITY: \ - info.tbytesline = obj->Image[0][b]->Width; \ - break; \ - case GL_LUMINANCE_ALPHA: \ - info.tbytesline = obj->Image[0][b]->Width * 2; \ + case MESA_FORMAT_RGB888: \ + info.tbytesline = texImg->Width * 3; \ break; \ - case GL_RGB: \ - info.tbytesline = obj->Image[0][b]->Width * 3; \ - break; \ - case GL_RGBA: \ - info.tbytesline = obj->Image[0][b]->Width * 4; \ + case MESA_FORMAT_RGBA8888: \ + info.tbytesline = texImg->Width * 4; \ break; \ default: \ _mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\ return; \ } \ - info.tsize = obj->Image[0][b]->Height * info.tbytesline; + info.tsize = texImg->Height * info.tbytesline; #define RENDER_SPAN( span ) affine_span(ctx, &span, &info); @@ -680,7 +688,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, switch (info->filter) { case GL_NEAREST: switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGB;MODULATE,3); @@ -700,7 +708,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch(info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGBA;MODULATE,4); @@ -727,7 +735,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, case GL_LINEAR: switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGB;MODULATE,3); @@ -747,7 +755,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGBA;MODULATE,4); @@ -799,16 +807,20 @@ fast_persp_span(GLcontext *ctx, SWspan *span, #define SETUP_CODE \ struct persp_info info; \ const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - info.texture = (const GLchan *) obj->Image[0][b]->Data; \ - info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ - info.smask = obj->Image[0][b]->Width - 1; \ - info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->_BaseFormat; \ + 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->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) */ \ @@ -823,25 +835,17 @@ fast_persp_span(GLcontext *ctx, SWspan *span, } \ \ switch (info.format) { \ - case GL_ALPHA: \ - case GL_LUMINANCE: \ - case GL_INTENSITY: \ - info.tbytesline = obj->Image[0][b]->Width; \ - break; \ - case GL_LUMINANCE_ALPHA: \ - info.tbytesline = obj->Image[0][b]->Width * 2; \ - break; \ - case GL_RGB: \ - info.tbytesline = obj->Image[0][b]->Width * 3; \ + case MESA_FORMAT_RGB888: \ + info.tbytesline = texImg->Width * 3; \ break; \ - case GL_RGBA: \ - info.tbytesline = obj->Image[0][b]->Width * 4; \ + case MESA_FORMAT_RGBA8888: \ + info.tbytesline = texImg->Width * 4; \ break; \ default: \ _mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\ return; \ } \ - info.tsize = obj->Image[0][b]->Height * info.tbytesline; + info.tsize = texImg->Height * info.tbytesline; #define RENDER_SPAN( span ) \ span.interpMask &= ~SPAN_RGBA; \ @@ -883,7 +887,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, return; \ } #define RENDER_SPAN( span ) \ - if (rb->DepthBits <= 16) { \ + if (rb->Format == MESA_FORMAT_Z16) { \ GLuint i; \ const GLushort *zRow = (const GLushort *) \ rb->GetPointer(ctx, rb, span.x, span.y); \ @@ -1055,19 +1059,20 @@ _swrast_choose_triangle( GLcontext *ctx ) const struct gl_texture_object *texObj2D; const struct gl_texture_image *texImg; GLenum minFilter, magFilter, envMode; - GLint format; + gl_format format; texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL; - format = texImg ? texImg->TexFormat->MesaFormat : -1; - minFilter = texObj2D ? texObj2D->MinFilter : (GLenum) 0; - magFilter = texObj2D ? texObj2D->MagFilter : (GLenum) 0; + format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE; + minFilter = texObj2D ? texObj2D->MinFilter : GL_NONE; + magFilter = texObj2D ? texObj2D->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->WrapS == GL_REPEAT && texObj2D->WrapT == GL_REPEAT @@ -1075,7 +1080,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && texImg->_IsPowerOfTwo && texImg->Border == 0 && texImg->Width == texImg->RowStride - && (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA) + && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888) && minFilter == magFilter && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR && !swrast->_FogEnabled @@ -1083,7 +1088,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) { if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) { if (minFilter == GL_NEAREST - && format == MESA_FORMAT_RGB + && format == MESA_FORMAT_RGB888 && (envMode == GL_REPLACE || envMode == GL_DECAL) && ((swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT) && ctx->Depth.Func == GL_LESS @@ -1102,7 +1107,15 @@ _swrast_choose_triangle( GLcontext *ctx ) #if CHAN_BITS != 8 USE(general_triangle); #else - USE(affine_textured_triangle); + 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 } } diff --git a/mesalib/src/mesa/swrast/swrast.h b/mesalib/src/mesa/swrast/swrast.h index c319ca62f..c183b315b 100644 --- a/mesalib/src/mesa/swrast/swrast.h +++ b/mesalib/src/mesa/swrast/swrast.h @@ -207,60 +207,6 @@ extern void _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ); -/* - * Imaging fallbacks (a better solution should be found, perhaps - * moving all the imaging fallback code to a new module) - */ -extern void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, - GLsizei height); -extern void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); - - -/* - * Texture fallbacks. Could also live in a new module - * with the rest of the texture store fallbacks? - */ -extern void -_swrast_copy_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border); - -extern void -_swrast_copy_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border); - - -extern void -_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width); - -extern void -_swrast_copy_texsubimage2d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - -extern void -_swrast_copy_texsubimage3d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - extern void _swrast_eject_texture_images(GLcontext *ctx); diff --git a/mesalib/src/mesa/swrast_setup/NOTES b/mesalib/src/mesa/swrast_setup/NOTES deleted file mode 100644 index c6cb4ab34..000000000 --- a/mesalib/src/mesa/swrast_setup/NOTES +++ /dev/null @@ -1,65 +0,0 @@ -INTRODUCTION - -A helper module which provides glue to bind the software rasterizer to -the software t&l module. The main task of this module is to build -swrast vertices from the t&l vertex_buffer structs, and to use them to -perform triangle setup functions not implemented in the software -rasterizer. - -The module implements a full set of functions to plug into the -t_vb_render.c driver interface (tnl->Driver.Render.*). - -There are strong advantages to decoupling the software rasterizer from -the t&l module, primarily allowing hardware drivers better control -over fallbacks, the removal of implicit knowledge about the software -rasterizer in the t&l module, allowing the two modules to evolve -independently and allowing either to be substituted with equivalent -functionality from another codebase. - -This module implements triangle/quad setup for offset, unfilled and -twoside-lit triangles. The software rasterizer doesn't handle these -primitives directly. - -Hardware rasterization drivers typically use this module in situations -where no hardware rasterization is possible, ie during total -fallbacks. - -STATE - -To create and destroy the module: - - GLboolean _swsetup_CreateContext( GLcontext *ctx ); - void _swsetup_DestroyContext( GLcontext *ctx ); - -The module is not active by default, and must be installed by calling -_swrast_Wakeup(). This function installs internal swrast_setup -functions into all the tnl->Driver.Render driver hooks, thus taking -over the task of rasterization entirely: - - void _swrast_Wakeup( GLcontext *ctx ); - - -This module tracks state changes internally and maintains derived -values based on the current state. For this to work, the driver -ensure the following funciton is called whenever the state changes and -the swsetup module is 'awake': - - void _swsetup_InvalidateState( GLcontext *ctx, GLuint new_state ); - -There is no explicit call to put the swsetup module to sleep. Simply -install other function pointers into all the tnl->Driver.Render.* -hooks, and (optionally) cease calling _swsetup_InvalidateState(). - -DRIVER INTERFACE - -The module offers a minimal driver interface: - - void (*Start)( GLcontext *ctx ); - void (*Finish)( GLcontext *ctx ); - -These are called before and after the completion of all swrast drawing -activity. As swrast doesn't call callbacks during triangle, line or -point rasterization, these are necessary to provide locking hooks for -some drivers. They may otherwise be left null. - - diff --git a/mesalib/src/mesa/swrast_setup/ss_tritmp.h b/mesalib/src/mesa/swrast_setup/ss_tritmp.h index 724b5e94f..bd20a8d97 100644 --- a/mesalib/src/mesa/swrast_setup/ss_tritmp.h +++ b/mesalib/src/mesa/swrast_setup/ss_tritmp.h @@ -41,9 +41,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) GLenum mode = GL_FILL; GLuint facing = 0; GLchan saved_color[3][4]; - GLfloat saved_col0[3][4]; - GLfloat saved_spec[3][4]; - GLfloat saved_index[3]; + GLfloat saved_col0[3][4] = { { 0 } }; + GLfloat saved_spec[3][4] = { { 0 } }; + GLfloat saved_index[3] = { 0 }; v[0] = &verts[e0]; v[1] = &verts[e1]; diff --git a/mesalib/src/mesa/tnl/NOTES b/mesalib/src/mesa/tnl/NOTES deleted file mode 100644 index c39b43485..000000000 --- a/mesalib/src/mesa/tnl/NOTES +++ /dev/null @@ -1,102 +0,0 @@ -INTRODUCTION - -A generic, configurable software implementation of GL transformation & -lighting. - -This module provides an implementation of the routines required by the -'vtxfmt' mechanism of core mesa for tnl functionality in all -combinations of compile and execute modes. - -Most current drivers use the tnl module exclusively to provide this -functionality, though there is an experimental alternate -implementation provided by the tnl_dd/t_dd_imm_* files which can -handle a small subset of GL states in execute mode only. - - -STATE - -To create and destroy the module: - - GLboolean _tnl_CreateContext( GLcontext *ctx ); - void _tnl_DestroyContext( GLcontext *ctx ); - -The module is not active by default, and must be installed by calling -_tnl_Wakeup(). This function installs internal tnl functions into all -the vtxfmt dispatch hooks, thus taking over the task of transformation -and lighting entirely: - - void _tnl_wakeup_exec( GLcontext *ctx ); - void _tnl_wakeup_save_exec( GLcontext *ctx ); - - -This module tracks state changes internally and maintains derived -values based on the current state. For this to work, the driver -ensure the following funciton is called whenever the state changes and -the swsetup module is 'awake': - - void _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ); - -There is no explicit call to put the tnl module to sleep. Simply -install other function pointers into all the vtxfmt dispatch slots, -and (optionally) cease calling _tnl_InvalidateState(). - -CUSTOMIZATION - -The module provides customizability through several mechanisms. The -most important is by allowing drivers to specify the pipeline through -which vertex data is passed, including its eventual transfer to -rasterization hardware (or software). - -The default pipeline is specified in t_pipeline.c, and is usually a -starting point for driver pipelines. Some drivers will remove a stage -where hardware provides support for the implemented operation (for -instance fog where per-pixel hardware fog is available, as in the dri -tdfx driver), or add stages to shortcircuit latter operations (for -example taking advantage of hardware support for strips and other -higher-level primitives (for example the radeon driver). - -In addition, the following functions provide further tweaks: - -extern void -_tnl_need_projected_coords( GLcontext *ctx, GLboolean flag ); - - - Direct the default vertex transformation stage to - produce/not produce projected clip coordinates. - -extern void -_tnl_need_dlist_loopback( GLcontext *ctx, GLboolean flag ); - - - Direct the display list component of the tnl module to - replay display lists as 'glVertex' type calls, rather than - passing the display list data directly into the tnl pipeline - mechanism. - - This allows display lists to be replayed by the tnl module - even when the module is not strictly active. - - -extern void -_tnl_need_dlist_norm_lengths( GLcontext *ctx, GLboolean flag ); - - - Direct the display list component to enable/disable caching - 1/length values for display list normals. Doing so is - ususally helpful when lighting is performed in software, but - wasteful otherwise. - - -DRIVER INTERFACE - -The module itself offers a minimal driver interface: - - void (*RunPipeline)( GLcontext *ctx ); - -Normally this is set to _tnl_RunPipeline(), however the driver can use -this hook to wrap checks or other code around this call. - -In addition, the driver interface for the default render pipeline -stage is housed in the tnl context struct (this could be cleaner). - - -RENDER DRIVER INTERFACE - -See t_context.h for the definition and explanation of this. \ No newline at end of file diff --git a/mesalib/src/mesa/tnl/t_context.c b/mesalib/src/mesa/tnl/t_context.c index f2771cde0..db21b4589 100644 --- a/mesalib/src/mesa/tnl/t_context.c +++ b/mesalib/src/mesa/tnl/t_context.c @@ -171,7 +171,7 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) if (vp) { GLuint i; for (i = 0; i < MAX_VARYING; i++) { - if (vp->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) { + if (vp->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) { RENDERINPUTS_SET(tnl->render_inputs_bitset, _TNL_ATTRIB_GENERIC(i)); } diff --git a/mesalib/src/mesa/tnl/t_context.h b/mesalib/src/mesa/tnl/t_context.h index c19eb3df3..6137c2d2f 100644 --- a/mesalib/src/mesa/tnl/t_context.h +++ b/mesalib/src/mesa/tnl/t_context.h @@ -548,4 +548,8 @@ typedef struct #define MAX_TYPES TYPE_IDX(GL_DOUBLE)+1 /* 0xa + 1 */ +extern void +tnl_clip_prepare(GLcontext *ctx); + + #endif diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c index c64c2c207..04fa10630 100644 --- a/mesalib/src/mesa/tnl/t_draw.c +++ b/mesalib/src/mesa/tnl/t_draw.c @@ -316,22 +316,27 @@ static void bind_indices( GLcontext *ctx, ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); - if (ib->type == GL_UNSIGNED_INT) { + 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_SHORT) { + 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++); + *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; } else { const GLubyte *in = (GLubyte *)ptr; for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++); + *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; } } } @@ -390,10 +395,14 @@ void _tnl_draw_prims( GLcontext *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); const GLuint TEST_SPLIT = 0; const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES; + GLuint max_basevertex = prim->basevertex; + GLuint i; + + for (i = 1; i < nr_prims; i++) + max_basevertex = MAX2(max_basevertex, prim[i].basevertex); if (0) { - GLuint i; _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); for (i = 0; i < nr_prims; i++) _mesa_printf("prim %d: %s start %d count %d\n", i, @@ -410,7 +419,7 @@ void _tnl_draw_prims( GLcontext *ctx, _tnl_vbo_draw_prims ); return; } - else if (max_index > max) { + else if (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. @@ -424,7 +433,7 @@ void _tnl_draw_prims( GLcontext *ctx, * recursively call back into this function. */ vbo_split_prims( ctx, arrays, prim, nr_prims, ib, - 0, max_index, + 0, max_index + prim->basevertex, _tnl_vbo_draw_prims, &limits ); } @@ -435,17 +444,34 @@ void _tnl_draw_prims( GLcontext *ctx, struct gl_buffer_object *bo[VERT_ATTRIB_MAX + 1]; GLuint nr_bo = 0; - /* Binding inputs may imply mapping some vertex buffer objects. - * They will need to be unmapped below. - */ - bind_inputs(ctx, arrays, max_index+1, bo, &nr_bo); - bind_indices(ctx, ib, bo, &nr_bo); - bind_prims(ctx, prim, nr_prims ); + 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; + } + + /* Binding inputs may imply mapping some vertex buffer objects. + * They will need to be unmapped below. + */ + 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_CONTEXT(ctx)->Driver.RunPipeline(ctx); + TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx); - unmap_vbos(ctx, bo, nr_bo); - free_space(ctx); + unmap_vbos(ctx, bo, nr_bo); + free_space(ctx); + + i += this_nr_prims; + } } } diff --git a/mesalib/src/mesa/tnl/t_rasterpos.c b/mesalib/src/mesa/tnl/t_rasterpos.c index f1fdddf0f..99b678745 100644 --- a/mesalib/src/mesa/tnl/t_rasterpos.c +++ b/mesalib/src/mesa/tnl/t_rasterpos.c @@ -46,11 +46,10 @@ * \return zero if outside view volume, or one if inside. */ static GLuint -viewclip_point( const GLfloat v[] ) +viewclip_point_xy( const GLfloat v[] ) { if ( v[0] > v[3] || v[0] < -v[3] - || v[1] > v[3] || v[1] < -v[3] - || v[2] > v[3] || v[2] < -v[3] ) { + || v[1] > v[3] || v[1] < -v[3] ) { return 0; } else { @@ -408,18 +407,18 @@ _tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) /* apply projection matrix: clip = Proj * eye */ TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye ); - /* clip to view volume */ - if (ctx->Transform.RasterPositionUnclipped) { - /* GL_IBM_rasterpos_clip: only clip against Z */ + /* clip to view volume. */ + if (!ctx->Transform.DepthClamp) { if (viewclip_point_z(clip) == 0) { ctx->Current.RasterPosValid = GL_FALSE; return; } } - else if (viewclip_point(clip) == 0) { - /* Normal OpenGL behaviour */ - ctx->Current.RasterPosValid = GL_FALSE; - return; + if (!ctx->Transform.RasterPositionUnclipped) { + if (viewclip_point_xy(clip) == 0) { + ctx->Current.RasterPosValid = GL_FALSE; + return; + } } /* clip to user clipping planes */ @@ -443,6 +442,12 @@ _tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) / ctx->DrawBuffer->_DepthMaxF; ctx->Current.RasterPos[3] = clip[3]; + if (ctx->Transform.DepthClamp) { + ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3], + ctx->Viewport.Near, + ctx->Viewport.Far); + } + /* compute raster distance */ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; diff --git a/mesalib/src/mesa/tnl/t_vb_program.c b/mesalib/src/mesa/tnl/t_vb_program.c index dc954bcba..e69f7d576 100644 --- a/mesalib/src/mesa/tnl/t_vb_program.c +++ b/mesalib/src/mesa/tnl/t_vb_program.c @@ -131,13 +131,16 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) store->ormask = 0; store->andmask = CLIP_FRUSTUM_BITS; + tnl_clip_prepare(ctx); + if (tnl->NeedNdcCoords) { VB->NdcPtr = _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr, &store->ndcCoords, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } else { VB->NdcPtr = NULL; @@ -145,7 +148,8 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) NULL, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } if (store->andmask) { @@ -325,7 +329,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) /* make list of outputs to save some time below */ numOutputs = 0; for (i = 0; i < VERT_RESULT_MAX; i++) { - if (program->Base.OutputsWritten & (1 << i)) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(i)) { outputs[numOutputs++] = i; } } @@ -403,14 +407,14 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) /* Fixup fog and point size results if needed */ if (program->IsNVProgram) { if (ctx->Fog.Enabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) { + (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) { for (i = 0; i < VB->Count; i++) { store->results[VERT_RESULT_FOGC].data[i][0] = 1.0; } } if (ctx->VertexProgram.PointSizeEnabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) { + (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) { for (i = 0; i < VB->Count; i++) { store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size; } @@ -468,7 +472,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) } for (i = 0; i < ctx->Const.MaxVarying; i++) { - if (program->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) { /* Note: varying results get put into the generic attributes */ VB->AttribPtr[VERT_ATTRIB_GENERIC0+i] = &store->results[VERT_RESULT_VAR0 + i]; diff --git a/mesalib/src/mesa/tnl/t_vb_vertex.c b/mesalib/src/mesa/tnl/t_vb_vertex.c index 30aa7c408..4734754ea 100644 --- a/mesalib/src/mesa/tnl/t_vb_vertex.c +++ b/mesalib/src/mesa/tnl/t_vb_vertex.c @@ -118,6 +118,22 @@ static void (*(usercliptab[5]))( GLcontext *, }; +void +tnl_clip_prepare(GLcontext *ctx) +{ + /* Neither the x86 nor sparc asm cliptest functions have been updated + * for ARB_depth_clamp, so force the C paths. + */ + if (ctx->Transform.DepthClamp) { + static GLboolean c_funcs_installed = GL_FALSE; + if (!c_funcs_installed) { + init_c_cliptest(); + c_funcs_installed = GL_TRUE; + } + } +} + + static GLboolean run_vertex_stage( GLcontext *ctx, struct tnl_pipeline_stage *stage ) @@ -129,6 +145,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx, if (ctx->VertexProgram._Current) return GL_TRUE; + tnl_clip_prepare(ctx); + if (ctx->_NeedEyeCoords) { /* Separate modelview transformation: * Use combined ModelProject to avoid some depth artifacts @@ -173,7 +191,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx, &store->proj, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } else { VB->NdcPtr = NULL; @@ -181,7 +200,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx, NULL, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } if (store->andmask) diff --git a/mesalib/src/mesa/vbo/vbo.h b/mesalib/src/mesa/vbo/vbo.h index 5986e9357..b24ecfd7c 100644 --- a/mesalib/src/mesa/vbo/vbo.h +++ b/mesalib/src/mesa/vbo/vbo.h @@ -44,6 +44,7 @@ struct _mesa_prim { GLuint start; GLuint count; + GLint basevertex; }; /* Would like to call this a "vbo_index_buffer", but this would be diff --git a/mesalib/src/mesa/vbo/vbo_exec.h b/mesalib/src/mesa/vbo/vbo_exec.h index 7fb592616..98c1f363d 100644 --- a/mesalib/src/mesa/vbo/vbo_exec.h +++ b/mesalib/src/mesa/vbo/vbo_exec.h @@ -138,6 +138,10 @@ struct vbo_exec_context */ const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; } array; + +#ifdef DEBUG + GLint flush_call_depth; +#endif }; @@ -161,8 +165,26 @@ 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 ); diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c index acc764790..f0a7eeadd 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_api.c +++ b/mesalib/src/mesa/vbo/vbo_exec_api.c @@ -35,9 +35,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/macros.h" #include "main/vtxfmt.h" -#if FEATURE_dlist #include "main/dlist.h" -#endif +#include "main/eval.h" #include "main/state.h" #include "main/light.h" #include "main/api_arrayelt.h" @@ -58,7 +57,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. static void reset_attrfv( struct vbo_exec_context *exec ); -/* Close off the last primitive, execute the buffer, restart the +/** + * Close off the last primitive, execute the buffer, restart the * primitive. */ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) @@ -107,7 +107,8 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) } -/* Deal with buffer wrapping where provoked by the vertex buffer +/** + * Deal with buffer wrapping where provoked by the vertex buffer * filling up, as opposed to upgrade_vertex(). */ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) @@ -136,7 +137,7 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) } -/* +/** * Copy the active vertex's values to the ctx->Current fields. */ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) @@ -209,7 +210,8 @@ static void vbo_exec_copy_from_current( struct vbo_exec_context *exec ) } -/* Flush existing data, set new attrib size, replay copied vertices. +/** + * Flush existing data, set new attrib size, replay copied vertices. */ static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec, GLuint attr, @@ -349,7 +351,7 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx, } - +#if FEATURE_beginend /* */ @@ -392,8 +394,8 @@ do { \ -/* Eval - */ +#if FEATURE_evaluators + static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) { GET_CURRENT_CONTEXT( ctx ); @@ -485,9 +487,15 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) vbo_exec_EvalCoord2f( u, v ); } +/* use noop eval mesh */ +#define vbo_exec_EvalMesh1 _mesa_noop_EvalMesh1 +#define vbo_exec_EvalMesh2 _mesa_noop_EvalMesh2 + +#endif /* FEATURE_evaluators */ -/* Build a list of primitives on the fly. Keep - * ctx->Driver.CurrentExecPrimitive uptodate as well. + +/** + * Called via glBegin. */ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) { @@ -531,6 +539,10 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) } + +/** + * Called via glEnd. + */ static void GLAPIENTRY vbo_exec_End( void ) { GET_CURRENT_CONTEXT( ctx ); @@ -557,24 +569,15 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) { GLvertexformat *vfmt = &exec->vtxfmt; - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = vbo_exec_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif vfmt->End = vbo_exec_End; - vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; - vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; - vfmt->EvalCoord2f = vbo_exec_EvalCoord2f; - vfmt->EvalCoord2fv = vbo_exec_EvalCoord2fv; - vfmt->EvalPoint1 = vbo_exec_EvalPoint1; - vfmt->EvalPoint2 = vbo_exec_EvalPoint2; - vfmt->Rectf = _mesa_noop_Rectf; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + _MESA_INIT_EVAL_VTXFMT(vfmt, vbo_exec_); + vfmt->Rectf = _mesa_noop_Rectf; /* from attrib_tmp.h: */ @@ -638,6 +641,98 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) } +#else /* FEATURE_beginend */ + + +#define ATTR( A, N, V0, V1, V2, V3 ) \ +do { \ + struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \ + \ + /* FLUSH_UPDATE_CURRENT needs to be set manually */ \ + exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ + \ + if (exec->vtx.active_sz[A] != N) \ + vbo_exec_fixup_vertex(ctx, A, N); \ + \ + { \ + GLfloat *dest = exec->vtx.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; \ + } \ +} while (0) + +#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ) +#define TAG(x) vbo_##x + +#include "vbo_attrib_tmp.h" + +static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) +{ + /* silence warnings */ + (void) vbo_Color3f; + (void) vbo_Color3fv; + (void) vbo_Color4f; + (void) vbo_Color4fv; + (void) vbo_FogCoordfEXT; + (void) vbo_FogCoordfvEXT; + (void) vbo_MultiTexCoord1f; + (void) vbo_MultiTexCoord1fv; + (void) vbo_MultiTexCoord2f; + (void) vbo_MultiTexCoord2fv; + (void) vbo_MultiTexCoord3f; + (void) vbo_MultiTexCoord3fv; + (void) vbo_MultiTexCoord4f; + (void) vbo_MultiTexCoord4fv; + (void) vbo_Normal3f; + (void) vbo_Normal3fv; + (void) vbo_SecondaryColor3fEXT; + (void) vbo_SecondaryColor3fvEXT; + (void) vbo_TexCoord1f; + (void) vbo_TexCoord1fv; + (void) vbo_TexCoord2f; + (void) vbo_TexCoord2fv; + (void) vbo_TexCoord3f; + (void) vbo_TexCoord3fv; + (void) vbo_TexCoord4f; + (void) vbo_TexCoord4fv; + (void) vbo_Vertex2f; + (void) vbo_Vertex2fv; + (void) vbo_Vertex3f; + (void) vbo_Vertex3fv; + (void) vbo_Vertex4f; + (void) vbo_Vertex4fv; + + (void) vbo_VertexAttrib1fARB; + (void) vbo_VertexAttrib1fvARB; + (void) vbo_VertexAttrib2fARB; + (void) vbo_VertexAttrib2fvARB; + (void) vbo_VertexAttrib3fARB; + (void) vbo_VertexAttrib3fvARB; + (void) vbo_VertexAttrib4fARB; + (void) vbo_VertexAttrib4fvARB; + + (void) vbo_VertexAttrib1fNV; + (void) vbo_VertexAttrib1fvNV; + (void) vbo_VertexAttrib2fNV; + (void) vbo_VertexAttrib2fvNV; + (void) vbo_VertexAttrib3fNV; + (void) vbo_VertexAttrib3fvNV; + (void) vbo_VertexAttrib4fNV; + (void) vbo_VertexAttrib4fvNV; + + (void) vbo_Materialfv; + + (void) vbo_EdgeFlag; + (void) vbo_Indexf; + (void) vbo_Indexfv; +} + + +#endif /* FEATURE_beginend */ + + /** * Tell the VBO module to use a real OpenGL vertex buffer object to * store accumulated immediate-mode vertex data. @@ -772,15 +867,27 @@ void vbo_exec_FlushVertices_internal( GLcontext *ctx, GLboolean unmap ) } - +/** + * \param flags bitmask of FLUSH_STORED_VERTICES, FLUSH_UPDATE_CURRENT + */ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; +#ifdef DEBUG + /* debug check: make sure we don't get called recursively */ + exec->flush_call_depth++; + assert(exec->flush_call_depth == 1); +#endif + if (0) _mesa_printf("%s\n", __FUNCTION__); if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__); +#ifdef DEBUG + exec->flush_call_depth--; + assert(exec->flush_call_depth == 0); +#endif return; } @@ -794,6 +901,11 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) } exec->ctx->Driver.NeedFlush &= ~flags; + +#ifdef DEBUG + exec->flush_call_depth--; + assert(exec->flush_call_depth == 0); +#endif } diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index 39c295763..6de8f059b 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -33,6 +33,7 @@ #include "main/api_noop.h" #include "main/varray.h" #include "main/bufferobj.h" +#include "main/enums.h" #include "main/macros.h" #include "glapi/dispatch.h" @@ -53,10 +54,9 @@ vbo_get_minmax_index(GLcontext *ctx, const void *indices; if (_mesa_is_bufferobj(ib->obj)) { - const GLvoid *map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - 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; @@ -105,9 +105,7 @@ vbo_get_minmax_index(GLcontext *ctx, } if (_mesa_is_bufferobj(ib->obj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - ib->obj); + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj); } } @@ -125,10 +123,9 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, 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); + array->BufferObj->Pointer = + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, + GL_READ_ONLY, array->BufferObj); } data = ADD_POINTERS(data, array->BufferObj->Pointer); } @@ -149,7 +146,7 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, array->Ptr, array->BufferObj->Name); f[k] = 1.0; /* XXX replace the bad value! */ } - //assert(!IS_INF_OR_NAN(f[k])); + /*assert(!IS_INF_OR_NAN(f[k]));*/ } } break; @@ -169,9 +166,7 @@ unmap_array_buffer(GLcontext *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); + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj); } } @@ -181,7 +176,7 @@ unmap_array_buffer(GLcontext *ctx, struct gl_client_array *array) */ static void check_draw_elements_data(GLcontext *ctx, GLsizei count, GLenum elemType, - const void *elements) + const void *elements, GLint basevertex) { struct gl_array_object *arrayObj = ctx->Array.ArrayObj; const void *elemMap; @@ -222,13 +217,13 @@ check_draw_elements_data(GLcontext *ctx, GLsizei count, GLenum elemType, 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); + 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->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ctx->Array.ElementArrayBufferObj); } @@ -459,7 +454,6 @@ bind_arrays(GLcontext *ctx) } else if (exec->array.program_mode != get_program_mode(ctx) || exec->array.enabled_flags != ctx->Array.ArrayObj->_Enabled) { - recalculate_input_bindings(ctx); } #else @@ -482,6 +476,10 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) struct vbo_exec_context *exec = &vbo->exec; struct _mesa_prim prim[1]; + 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; @@ -518,6 +516,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) prim[0].start = start; prim[0].count = count; prim[0].indexed = 0; + prim[0].basevertex = 0; vbo->draw_prims( ctx, exec->array.inputs, prim, 1, NULL, GL_TRUE, start, start + count - 1 ); @@ -581,18 +580,19 @@ dump_element_buffer(GLcontext *ctx, GLenum type) ; } - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ctx->Array.ElementArrayBufferObj); } + /* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ static void vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, GLboolean index_bounds_valid, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices) + const GLvoid *indices, + GLint basevertex) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; @@ -626,6 +626,7 @@ vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, prim[0].start = 0; prim[0].count = count; prim[0].indexed = 1; + prim[0].basevertex = basevertex; /* Need to give special consideration to rendering a range of * indices starting somewhere above zero. Typically the @@ -663,17 +664,31 @@ vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, } static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid *indices) +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 )) + 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! + */ + if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ warnCount++; @@ -726,10 +741,12 @@ vbo_exec_DrawRangeElements(GLenum mode, #endif } else if (0) { - _mesa_printf("glDraw[Range]Elements" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n", + _mesa_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); + ctx->Array.ElementArrayBufferObj->Name, + basevertex); } #if 0 @@ -739,7 +756,24 @@ vbo_exec_DrawRangeElements(GLenum mode, #endif vbo_validated_drawrangeelements(ctx, mode, GL_TRUE, start, end, - count, type, indices); + count, type, indices, basevertex); +} + + +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); } @@ -749,18 +783,45 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, { GET_CURRENT_CONTEXT(ctx); - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) + 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); + count, type, indices, 0); } -/* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ + +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); +} + + +/** Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ static void vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount) + const GLvoid **indices, GLsizei primcount, + const GLint *basevertex) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; @@ -854,6 +915,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size; prim[i].count = count[i]; prim[i].indexed = 1; + if (basevertex != NULL) + prim[i].basevertex = basevertex[i]; + else + prim[i].basevertex = 0; } vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib, @@ -874,6 +939,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, prim[0].start = 0; prim[0].count = count[i]; prim[0].indexed = 1; + if (basevertex != NULL) + prim[0].basevertex = basevertex[i]; + else + prim[0].basevertex = 0; } vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib, @@ -882,6 +951,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, _mesa_free(prim); } + static void GLAPIENTRY vbo_exec_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, @@ -894,14 +964,38 @@ vbo_exec_MultiDrawElements(GLenum mode, ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements( ctx, mode, count[i], type, indices[i] )) + if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], + 0)) return; } - vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount); + 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); +} + /*********************************************************************** * Initialization @@ -915,11 +1009,17 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) 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; #else exec->vtxfmt.DrawArrays = _mesa_noop_DrawArrays; exec->vtxfmt.DrawElements = _mesa_noop_DrawElements; exec->vtxfmt.DrawRangeElements = _mesa_noop_DrawRangeElements; exec->vtxfmt.MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; + exec->vtxfmt.DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; + exec->vtxfmt.DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; + exec->vtxfmt.MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; #endif } @@ -947,6 +1047,13 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, 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); +} + /* This API entrypoint is not ordinarily used */ void GLAPIENTRY @@ -956,6 +1063,17 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, 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); +} + + /* GL_EXT_multi_draw_arrays */ void GLAPIENTRY _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, @@ -963,3 +1081,14 @@ _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, { 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_exec_draw.c b/mesalib/src/mesa/vbo/vbo_exec_draw.c index f41d62945..4f4385601 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_draw.c +++ b/mesalib/src/mesa/vbo/vbo_exec_draw.c @@ -35,6 +35,9 @@ #include "vbo_context.h" +#if FEATURE_beginend + + static void vbo_exec_debug_verts( struct vbo_exec_context *exec ) { @@ -415,3 +418,6 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) exec->vtx.prim_count = 0; exec->vtx.vert_count = 0; } + + +#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/vbo/vbo_exec_eval.c b/mesalib/src/mesa/vbo/vbo_exec_eval.c index 0c691b3a5..a7846213d 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_eval.c +++ b/mesalib/src/mesa/vbo/vbo_exec_eval.c @@ -35,17 +35,20 @@ static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map1)); exec->eval.map1[attr].map = NULL; } static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map2)); exec->eval.map2[attr].map = NULL; } static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_1d_map *map ) { + assert(attr < Elements(exec->eval.map1)); if (!exec->eval.map1[attr].map) { exec->eval.map1[attr].map = map; exec->eval.map1[attr].sz = dim; @@ -55,6 +58,7 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_2d_map *map ) { + assert(attr < Elements(exec->eval.map2)); if (!exec->eval.map2[attr].map) { exec->eval.map2[attr].map = map; exec->eval.map2[attr].sz = dim; @@ -73,18 +77,6 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) clear_active_eval2( exec, attr ); } - /* _NEW_PROGRAM */ - if (ctx->VertexProgram._Enabled) { - for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) { - /* _NEW_EVAL */ - if (ctx->Eval.Map1Attrib[attr]) - set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); - - if (ctx->Eval.Map2Attrib[attr]) - set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); - } - } - if (ctx->Eval.Map1Color4) set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); @@ -125,6 +117,23 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) else if (ctx->Eval.Map2Vertex3) set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); + /* _NEW_PROGRAM */ + if (ctx->VertexProgram._Enabled) { + /* These are the 16 evaluators which GL_NV_vertex_program defines. + * They alias and override the conventional vertex attributs. + */ + for (attr = 0; attr < 16; attr++) { + /* _NEW_EVAL */ + assert(attr < Elements(ctx->Eval.Map1Attrib)); + if (ctx->Eval.Map1Attrib[attr]) + set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); + + assert(attr < Elements(ctx->Eval.Map2Attrib)); + if (ctx->Eval.Map2Attrib[attr]) + set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); + } + } + exec->eval.recalculate_maps = 0; } diff --git a/mesalib/src/mesa/vbo/vbo_rebase.c b/mesalib/src/mesa/vbo/vbo_rebase.c index 3bf7ef580..55a82ee36 100644 --- a/mesalib/src/mesa/vbo/vbo_rebase.c +++ b/mesalib/src/mesa/vbo/vbo_rebase.c @@ -126,7 +126,23 @@ void vbo_rebase_prims( GLcontext *ctx, if (0) _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); - if (ib) { + + /* XXX this path is disabled for now. + * There's rendering corruption in some apps when it's enabled. + */ + if (0 && ib && ctx->Extensions.ARB_draw_elements_base_vertex) { + /* If we can just tell the hardware or the TNL to interpret our + * indices with a different base, do so. + */ + tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); + + for (i = 0; i < nr_prims; i++) { + tmp_prims[i] = prim[i]; + tmp_prims[i].basevertex -= min_index; + } + + prim = tmp_prims; + } else if (ib) { /* Unfortunately need to adjust each index individually. */ GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer; diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c index 1771510d8..3f86c68b2 100644 --- a/mesalib/src/mesa/vbo/vbo_save_api.c +++ b/mesalib/src/mesa/vbo/vbo_save_api.c @@ -72,6 +72,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/dlist.h" #include "main/enums.h" +#include "main/eval.h" #include "main/macros.h" #include "main/api_noop.h" #include "main/api_validate.h" @@ -269,7 +270,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) * being compiled. */ node = (struct vbo_save_vertex_list *) - _mesa_alloc_instruction(ctx, save->opcode_vertex_list, sizeof(*node)); + _mesa_dlist_alloc(ctx, save->opcode_vertex_list, sizeof(*node)); if (!node) return; @@ -826,6 +827,33 @@ static void GLAPIENTRY _save_DrawRangeElements(GLenum mode, _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); @@ -907,7 +935,7 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum GET_CURRENT_CONTEXT(ctx); GLint i; - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; _ae_map_vbos( ctx ); @@ -948,7 +976,7 @@ static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, GET_CURRENT_CONTEXT(ctx); if (_mesa_validate_DrawRangeElements( ctx, mode, start, end, - count, type, indices )) + count, type, indices, 0 )) _save_OBE_DrawElements( mode, count, type, indices ); } @@ -961,7 +989,8 @@ static void _save_vtxfmt_init( GLcontext *ctx ) struct vbo_save_context *save = &vbo_context(ctx)->save; GLvertexformat *vfmt = &save->vtxfmt; - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _save_Begin; vfmt->Color3f = _save_Color3f; vfmt->Color3fv = _save_Color3fv; @@ -1020,28 +1049,23 @@ static void _save_vtxfmt_init( GLcontext *ctx ) /* This will all require us to fallback to saving the list as opcodes: */ - vfmt->CallList = _save_CallList; /* inside begin/end */ - vfmt->CallLists = _save_CallLists; /* inside begin/end */ - vfmt->EvalCoord1f = _save_EvalCoord1f; - vfmt->EvalCoord1fv = _save_EvalCoord1fv; - vfmt->EvalCoord2f = _save_EvalCoord2f; - vfmt->EvalCoord2fv = _save_EvalCoord2fv; - vfmt->EvalPoint1 = _save_EvalPoint1; - vfmt->EvalPoint2 = _save_EvalPoint2; + _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->EvalMesh1 = _save_EvalMesh1; - vfmt->EvalMesh2 = _save_EvalMesh2; 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; } @@ -1209,11 +1233,11 @@ void vbo_save_api_init( struct vbo_save_context *save ) GLuint i; save->opcode_vertex_list = - _mesa_alloc_opcode( ctx, - sizeof(struct vbo_save_vertex_list), - vbo_save_playback_vertex_list, - vbo_destroy_vertex_list, - vbo_print_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; @@ -1233,6 +1257,7 @@ void vbo_save_api_init( struct vbo_save_context *save ) 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 ); } diff --git a/mesalib/src/mesa/vbo/vbo_split.c b/mesalib/src/mesa/vbo/vbo_split.c index 58e879628..c445acca7 100644 --- a/mesalib/src/mesa/vbo/vbo_split.c +++ b/mesalib/src/mesa/vbo/vbo_split.c @@ -50,6 +50,7 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/mtypes.h" +#include "main/macros.h" #include "vbo_split.h" #include "vbo.h" @@ -107,7 +108,12 @@ void vbo_split_prims( GLcontext *ctx, vbo_draw_func draw, const struct split_limits *limits ) { - + GLuint max_basevertex = prim->basevertex; + GLuint i; + + for (i = 1; i < nr_prims; i++) + max_basevertex = MAX2(max_basevertex, prim[i].basevertex); + if (ib) { if (limits->max_indices == 0) { /* Could traverse the indices, re-emitting vertices in turn. diff --git a/mesalib/src/mesa/vbo/vbo_split_copy.c b/mesalib/src/mesa/vbo/vbo_split_copy.c index 8ec180d55..c45190b9d 100644 --- a/mesalib/src/mesa/vbo/vbo_split_copy.c +++ b/mesalib/src/mesa/vbo/vbo_split_copy.c @@ -589,28 +589,40 @@ void vbo_split_copy( GLcontext *ctx, const struct split_limits *limits ) { struct copy_context copy; - GLuint i; + GLuint i, this_nr_prims; + + for (i = 0; i < 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; + } - memset(©, 0, sizeof(copy)); + memset(©, 0, sizeof(copy)); - /* Require indexed primitives: - */ - assert(ib); - - copy.ctx = ctx; - copy.array = arrays; - copy.prim = prim; - copy.nr_prims = nr_prims; - copy.ib = ib; - copy.draw = draw; - copy.limits = limits; + /* Require indexed primitives: + */ + assert(ib); - /* Clear the vertex cache: - */ - for (i = 0; i < ELT_TABLE_SIZE; i++) - copy.vert_cache[i].in = ~0; + copy.ctx = ctx; + copy.array = arrays; + copy.prim = &prim[i]; + copy.nr_prims = this_nr_prims; + copy.ib = ib; + copy.draw = draw; + copy.limits = limits; - replay_init(©); - replay_elts(©); - replay_finish(©); + /* Clear the vertex cache: + */ + for (i = 0; i < ELT_TABLE_SIZE; i++) + copy.vert_cache[i].in = ~0; + + replay_init(©); + replay_elts(©); + replay_finish(©); + } } -- cgit v1.2.3