From f4092abdf94af6a99aff944d6264bc1284e8bdd4 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:43:39 +0200 Subject: Imported nx-X11-3.1.0-1.tar.gz Summary: Imported nx-X11-3.1.0-1.tar.gz Keywords: Imported nx-X11-3.1.0-1.tar.gz into Git repository --- nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile | 34 + .../Mesa/src/mesa/drivers/dri/Makefile.template | 109 + .../Mesa/src/mesa/drivers/dri/common/depthtmp.h | 253 + .../Mesa/src/mesa/drivers/dri/common/dri_util.c | 1073 ++++ .../Mesa/src/mesa/drivers/dri/common/dri_util.h | 555 ++ .../src/mesa/drivers/dri/common/drirenderbuffer.c | 98 + .../src/mesa/drivers/dri/common/drirenderbuffer.h | 39 + .../src/mesa/drivers/dri/common/extension_helper.h | 5887 +++++++++++++++++++ .../src/mesa/drivers/dri/common/glcontextmodes.c | 496 ++ .../src/mesa/drivers/dri/common/glcontextmodes.h | 52 + .../Mesa/src/mesa/drivers/dri/common/memops.h | 17 + .../extras/Mesa/src/mesa/drivers/dri/common/mmio.h | 62 + .../extras/Mesa/src/mesa/drivers/dri/common/mmx.h | 560 ++ .../Mesa/src/mesa/drivers/dri/common/spantmp.h | 328 ++ .../Mesa/src/mesa/drivers/dri/common/spantmp2.h | 609 ++ .../src/mesa/drivers/dri/common/spantmp_common.h | 81 + .../Mesa/src/mesa/drivers/dri/common/stenciltmp.h | 182 + .../Mesa/src/mesa/drivers/dri/common/texmem.c | 1339 +++++ .../Mesa/src/mesa/drivers/dri/common/texmem.h | 327 ++ .../Mesa/src/mesa/drivers/dri/common/utils.c | 695 +++ .../Mesa/src/mesa/drivers/dri/common/utils.h | 119 + .../Mesa/src/mesa/drivers/dri/common/vblank.c | 347 ++ .../Mesa/src/mesa/drivers/dri/common/vblank.h | 69 + .../Mesa/src/mesa/drivers/dri/common/xmlconfig.c | 1002 ++++ .../Mesa/src/mesa/drivers/dri/common/xmlconfig.h | 124 + .../Mesa/src/mesa/drivers/dri/common/xmlpool.h | 94 + .../src/mesa/drivers/dri/common/xmlpool/Makefile | 96 + .../Mesa/src/mesa/drivers/dri/common/xmlpool/de.po | 231 + .../Mesa/src/mesa/drivers/dri/common/xmlpool/es.po | 219 + .../Mesa/src/mesa/drivers/dri/common/xmlpool/fr.po | 225 + .../mesa/drivers/dri/common/xmlpool/gen_xmlpool.py | 191 + .../Mesa/src/mesa/drivers/dri/common/xmlpool/nl.po | 230 + .../src/mesa/drivers/dri/common/xmlpool/options.h | 462 ++ .../mesa/drivers/dri/common/xmlpool/t_options.h | 230 + .../extras/Mesa/src/mesa/drivers/dri/fb/Doxyfile | 232 + .../extras/Mesa/src/mesa/drivers/dri/fb/Makefile | 21 + .../extras/Mesa/src/mesa/drivers/dri/fb/fb_dri.c | 786 +++ .../extras/Mesa/src/mesa/drivers/dri/fb/fb_egl.c | 881 +++ .../extras/Mesa/src/mesa/drivers/dri/ffb/Makefile | 36 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.c | 159 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.h | 8 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_clear.c | 354 ++ .../Mesa/src/mesa/drivers/dri/ffb/ffb_clear.h | 9 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_context.h | 306 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.c | 119 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.h | 36 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_depth.c | 245 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_depth.h | 8 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_fifo.h | 28 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fog.c | 73 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_lines.c | 111 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_lines.h | 18 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_linetmp.h | 81 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_lock.h | 37 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_points.c | 93 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_points.h | 15 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_pointtmp.h | 55 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_rendertmp.h | 646 ++ .../Mesa/src/mesa/drivers/dri/ffb/ffb_span.c | 135 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_span.h | 10 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_state.c | 1223 ++++ .../Mesa/src/mesa/drivers/dri/ffb/ffb_state.h | 13 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.c | 226 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.h | 8 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.c | 53 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.h | 34 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_tris.c | 945 +++ .../Mesa/src/mesa/drivers/dri/ffb/ffb_tris.h | 26 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_tritmp.h | 239 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.c | 209 + .../extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.h | 45 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_vbtmp.h | 151 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c | 427 ++ .../Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h | 8 + .../Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.c | 753 +++ .../Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.h | 26 + .../Mesa/src/mesa/drivers/dri/ffb/server/ffb_dac.h | 367 ++ .../src/mesa/drivers/dri/ffb/server/ffb_drishare.h | 48 + .../src/mesa/drivers/dri/ffb/server/ffb_regs.h | 509 ++ .../Mesa/src/mesa/drivers/dri/gamma/Makefile | 35 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_client.h | 6185 ++++++++++++++++++++ .../src/mesa/drivers/dri/gamma/gamma_context.c | 226 + .../src/mesa/drivers/dri/gamma/gamma_context.h | 403 ++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_dd.c | 128 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_inithw.c | 551 ++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_lock.c | 59 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_lock.h | 84 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_macros.h | 324 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_regs.h | 659 +++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_render.c | 220 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_screen.c | 147 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_screen.h | 30 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_span.c | 313 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_state.c | 1730 ++++++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_tex.c | 433 ++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_texmem.c | 535 ++ .../src/mesa/drivers/dri/gamma/gamma_texstate.c | 216 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_tris.c | 659 +++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_tris.h | 36 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h | 497 ++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_vb.c | 362 ++ .../Mesa/src/mesa/drivers/dri/gamma/gamma_vb.h | 60 + .../Mesa/src/mesa/drivers/dri/gamma/gamma_xmesa.c | 266 + .../mesa/drivers/dri/gamma/server/glint_common.h | 64 + .../src/mesa/drivers/dri/gamma/server/glint_dri.h | 123 + .../extras/Mesa/src/mesa/drivers/dri/i810/Makefile | 32 + .../Mesa/src/mesa/drivers/dri/i810/i810_3d_reg.h | 636 ++ .../Mesa/src/mesa/drivers/dri/i810/i810context.c | 572 ++ .../Mesa/src/mesa/drivers/dri/i810/i810context.h | 252 + .../Mesa/src/mesa/drivers/dri/i810/i810ioctl.c | 511 ++ .../Mesa/src/mesa/drivers/dri/i810/i810ioctl.h | 49 + .../Mesa/src/mesa/drivers/dri/i810/i810render.c | 173 + .../Mesa/src/mesa/drivers/dri/i810/i810screen.c | 471 ++ .../Mesa/src/mesa/drivers/dri/i810/i810screen.h | 99 + .../Mesa/src/mesa/drivers/dri/i810/i810span.c | 201 + .../Mesa/src/mesa/drivers/dri/i810/i810span.h | 14 + .../Mesa/src/mesa/drivers/dri/i810/i810state.c | 1025 ++++ .../Mesa/src/mesa/drivers/dri/i810/i810state.h | 15 + .../Mesa/src/mesa/drivers/dri/i810/i810tex.c | 564 ++ .../Mesa/src/mesa/drivers/dri/i810/i810tex.h | 78 + .../Mesa/src/mesa/drivers/dri/i810/i810texmem.c | 183 + .../Mesa/src/mesa/drivers/dri/i810/i810texstate.c | 746 +++ .../Mesa/src/mesa/drivers/dri/i810/i810tris.c | 871 +++ .../Mesa/src/mesa/drivers/dri/i810/i810tris.h | 36 + .../extras/Mesa/src/mesa/drivers/dri/i810/i810vb.c | 489 ++ .../extras/Mesa/src/mesa/drivers/dri/i810/i810vb.h | 60 + .../src/mesa/drivers/dri/i810/server/i810_common.h | 192 + .../src/mesa/drivers/dri/i810/server/i810_dri.c | 975 +++ .../src/mesa/drivers/dri/i810/server/i810_dri.h | 128 + .../src/mesa/drivers/dri/i810/server/i810_reg.h | 992 ++++ .../extras/Mesa/src/mesa/drivers/dri/i830/Makefile | 31 + .../Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h | 677 +++ .../Mesa/src/mesa/drivers/dri/i830/i830_context.c | 626 ++ .../Mesa/src/mesa/drivers/dri/i830/i830_context.h | 327 ++ .../Mesa/src/mesa/drivers/dri/i830/i830_debug.c | 415 ++ .../Mesa/src/mesa/drivers/dri/i830/i830_debug.h | 48 + .../Mesa/src/mesa/drivers/dri/i830/i830_ioctl.c | 841 +++ .../Mesa/src/mesa/drivers/dri/i830/i830_ioctl.h | 105 + .../Mesa/src/mesa/drivers/dri/i830/i830_render.c | 226 + .../Mesa/src/mesa/drivers/dri/i830/i830_screen.c | 557 ++ .../Mesa/src/mesa/drivers/dri/i830/i830_screen.h | 113 + .../Mesa/src/mesa/drivers/dri/i830/i830_span.c | 427 ++ .../Mesa/src/mesa/drivers/dri/i830/i830_span.h | 51 + .../Mesa/src/mesa/drivers/dri/i830/i830_state.c | 1707 ++++++ .../Mesa/src/mesa/drivers/dri/i830/i830_state.h | 68 + .../Mesa/src/mesa/drivers/dri/i830/i830_tex.c | 700 +++ .../Mesa/src/mesa/drivers/dri/i830/i830_tex.h | 70 + .../Mesa/src/mesa/drivers/dri/i830/i830_texmem.c | 237 + .../Mesa/src/mesa/drivers/dri/i830/i830_texstate.c | 716 +++ .../Mesa/src/mesa/drivers/dri/i830/i830_tris.c | 1056 ++++ .../Mesa/src/mesa/drivers/dri/i830/i830_tris.h | 37 + .../src/mesa/drivers/dri/i830/server/i830_common.h | 288 + .../src/mesa/drivers/dri/i830/server/i830_dri.h | 140 + .../extras/Mesa/src/mesa/drivers/dri/i915/Makefile | 47 + .../Mesa/src/mesa/drivers/dri/i915/i830_context.c | 122 + .../Mesa/src/mesa/drivers/dri/i915/i830_context.h | 215 + .../Mesa/src/mesa/drivers/dri/i915/i830_metaops.c | 733 +++ .../Mesa/src/mesa/drivers/dri/i915/i830_reg.h | 641 ++ .../Mesa/src/mesa/drivers/dri/i915/i830_state.c | 1089 ++++ .../Mesa/src/mesa/drivers/dri/i915/i830_tex.c | 345 ++ .../Mesa/src/mesa/drivers/dri/i915/i830_texblend.c | 465 ++ .../Mesa/src/mesa/drivers/dri/i915/i830_texstate.c | 483 ++ .../Mesa/src/mesa/drivers/dri/i915/i830_vtbl.c | 456 ++ .../Mesa/src/mesa/drivers/dri/i915/i915_context.c | 181 + .../Mesa/src/mesa/drivers/dri/i915/i915_context.h | 351 ++ .../Mesa/src/mesa/drivers/dri/i915/i915_debug.c | 299 + .../Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c | 1065 ++++ .../Mesa/src/mesa/drivers/dri/i915/i915_metaops.c | 516 ++ .../Mesa/src/mesa/drivers/dri/i915/i915_program.c | 466 ++ .../Mesa/src/mesa/drivers/dri/i915/i915_program.h | 163 + .../Mesa/src/mesa/drivers/dri/i915/i915_reg.h | 833 +++ .../Mesa/src/mesa/drivers/dri/i915/i915_state.c | 954 +++ .../Mesa/src/mesa/drivers/dri/i915/i915_tex.c | 182 + .../Mesa/src/mesa/drivers/dri/i915/i915_texprog.c | 668 +++ .../Mesa/src/mesa/drivers/dri/i915/i915_texstate.c | 922 +++ .../Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c | 353 ++ .../src/mesa/drivers/dri/i915/intel_batchbuffer.c | 688 +++ .../src/mesa/drivers/dri/i915/intel_batchbuffer.h | 123 + .../Mesa/src/mesa/drivers/dri/i915/intel_context.c | 712 +++ .../Mesa/src/mesa/drivers/dri/i915/intel_context.h | 519 ++ .../Mesa/src/mesa/drivers/dri/i915/intel_ioctl.c | 607 ++ .../Mesa/src/mesa/drivers/dri/i915/intel_ioctl.h | 66 + .../Mesa/src/mesa/drivers/dri/i915/intel_pixel.c | 490 ++ .../Mesa/src/mesa/drivers/dri/i915/intel_reg.h | 84 + .../Mesa/src/mesa/drivers/dri/i915/intel_render.c | 240 + .../Mesa/src/mesa/drivers/dri/i915/intel_screen.c | 511 ++ .../Mesa/src/mesa/drivers/dri/i915/intel_screen.h | 101 + .../Mesa/src/mesa/drivers/dri/i915/intel_span.c | 379 ++ .../Mesa/src/mesa/drivers/dri/i915/intel_span.h | 41 + .../Mesa/src/mesa/drivers/dri/i915/intel_state.c | 285 + .../Mesa/src/mesa/drivers/dri/i915/intel_tex.c | 831 +++ .../Mesa/src/mesa/drivers/dri/i915/intel_tex.h | 42 + .../Mesa/src/mesa/drivers/dri/i915/intel_tris.c | 920 +++ .../Mesa/src/mesa/drivers/dri/i915/intel_tris.h | 46 + .../src/mesa/drivers/dri/i915/server/i830_common.h | 169 + .../src/mesa/drivers/dri/i915/server/i830_dri.h | 69 + .../Mesa/src/mesa/drivers/dri/mach64/Makefile | 33 + .../src/mesa/drivers/dri/mach64/mach64_context.c | 338 ++ .../src/mesa/drivers/dri/mach64/mach64_context.h | 405 ++ .../Mesa/src/mesa/drivers/dri/mach64/mach64_dd.c | 135 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_dd.h | 36 + .../src/mesa/drivers/dri/mach64/mach64_ioctl.c | 912 +++ .../src/mesa/drivers/dri/mach64/mach64_ioctl.h | 148 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_lock.c | 93 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_lock.h | 104 + .../src/mesa/drivers/dri/mach64/mach64_native_vb.c | 257 + .../mesa/drivers/dri/mach64/mach64_native_vbtmp.h | 562 ++ .../Mesa/src/mesa/drivers/dri/mach64/mach64_reg.h | 406 ++ .../src/mesa/drivers/dri/mach64/mach64_screen.c | 553 ++ .../src/mesa/drivers/dri/mach64/mach64_screen.h | 78 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_span.c | 231 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_span.h | 41 + .../src/mesa/drivers/dri/mach64/mach64_state.c | 1216 ++++ .../src/mesa/drivers/dri/mach64/mach64_state.h | 47 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_tex.c | 610 ++ .../Mesa/src/mesa/drivers/dri/mach64/mach64_tex.h | 99 + .../src/mesa/drivers/dri/mach64/mach64_texmem.c | 867 +++ .../src/mesa/drivers/dri/mach64/mach64_texstate.c | 558 ++ .../Mesa/src/mesa/drivers/dri/mach64/mach64_tris.c | 1921 ++++++ .../Mesa/src/mesa/drivers/dri/mach64/mach64_tris.h | 43 + .../Mesa/src/mesa/drivers/dri/mach64/mach64_vb.c | 642 ++ .../Mesa/src/mesa/drivers/dri/mach64/mach64_vb.h | 77 + .../src/mesa/drivers/dri/mach64/mach64_vbtmp.h | 770 +++ .../mesa/drivers/dri/mach64/server/mach64_dri.h | 126 + .../extras/Mesa/src/mesa/drivers/dri/mga/Doxyfile | 234 + .../extras/Mesa/src/mesa/drivers/dri/mga/Makefile | 34 + nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/README | 26 + .../Mesa/src/mesa/drivers/dri/mga/mga_texcombine.c | 672 +++ .../Mesa/src/mesa/drivers/dri/mga/mga_texstate.c | 902 +++ .../Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c | 1020 ++++ .../Mesa/src/mesa/drivers/dri/mga/mga_xmesa.h | 155 + .../Mesa/src/mesa/drivers/dri/mga/mgacontext.h | 372 ++ .../extras/Mesa/src/mesa/drivers/dri/mga/mgadd.c | 98 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgadd.h | 36 + .../Mesa/src/mesa/drivers/dri/mga/mgaioctl.c | 743 +++ .../Mesa/src/mesa/drivers/dri/mga/mgaioctl.h | 111 + .../Mesa/src/mesa/drivers/dri/mga/mgapixel.c | 664 +++ .../Mesa/src/mesa/drivers/dri/mga/mgapixel.h | 36 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgaregs.h | 1395 +++++ .../Mesa/src/mesa/drivers/dri/mga/mgarender.c | 172 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.c | 312 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.h | 40 + .../Mesa/src/mesa/drivers/dri/mga/mgastate.c | 1237 ++++ .../Mesa/src/mesa/drivers/dri/mga/mgastate.h | 39 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgatex.c | 538 ++ .../extras/Mesa/src/mesa/drivers/dri/mga/mgatex.h | 51 + .../Mesa/src/mesa/drivers/dri/mga/mgatexmem.c | 278 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgatris.c | 912 +++ .../extras/Mesa/src/mesa/drivers/dri/mga/mgatris.h | 52 + .../extras/Mesa/src/mesa/drivers/dri/mga/mgavb.c | 480 ++ .../extras/Mesa/src/mesa/drivers/dri/mga/mgavb.h | 66 + .../Mesa/src/mesa/drivers/dri/mga/server/mga.h | 115 + .../src/mesa/drivers/dri/mga/server/mga_bios.h | 143 + .../Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c | 1089 ++++ .../Mesa/src/mesa/drivers/dri/mga/server/mga_dri.h | 113 + .../src/mesa/drivers/dri/mga/server/mga_macros.h | 118 + .../Mesa/src/mesa/drivers/dri/mga/server/mga_reg.h | 484 ++ .../extras/Mesa/src/mesa/drivers/dri/r128/Makefile | 32 + .../Mesa/src/mesa/drivers/dri/r128/r128_context.c | 364 ++ .../Mesa/src/mesa/drivers/dri/r128/r128_context.h | 269 + .../Mesa/src/mesa/drivers/dri/r128/r128_dd.c | 148 + .../Mesa/src/mesa/drivers/dri/r128/r128_dd.h | 41 + .../Mesa/src/mesa/drivers/dri/r128/r128_ioctl.c | 813 +++ .../Mesa/src/mesa/drivers/dri/r128/r128_ioctl.h | 144 + .../Mesa/src/mesa/drivers/dri/r128/r128_lock.c | 123 + .../Mesa/src/mesa/drivers/dri/r128/r128_lock.h | 108 + .../Mesa/src/mesa/drivers/dri/r128/r128_screen.c | 547 ++ .../Mesa/src/mesa/drivers/dri/r128/r128_screen.h | 84 + .../Mesa/src/mesa/drivers/dri/r128/r128_span.c | 368 ++ .../Mesa/src/mesa/drivers/dri/r128/r128_span.h | 46 + .../Mesa/src/mesa/drivers/dri/r128/r128_state.c | 1261 ++++ .../Mesa/src/mesa/drivers/dri/r128/r128_state.h | 51 + .../Mesa/src/mesa/drivers/dri/r128/r128_tex.c | 617 ++ .../Mesa/src/mesa/drivers/dri/r128/r128_tex.h | 85 + .../Mesa/src/mesa/drivers/dri/r128/r128_texmem.c | 301 + .../Mesa/src/mesa/drivers/dri/r128/r128_texobj.h | 68 + .../Mesa/src/mesa/drivers/dri/r128/r128_texstate.c | 648 ++ .../Mesa/src/mesa/drivers/dri/r128/r128_tris.c | 769 +++ .../Mesa/src/mesa/drivers/dri/r128/r128_tris.h | 48 + .../src/mesa/drivers/dri/r128/server/pci_ids.h | 57 + .../Mesa/src/mesa/drivers/dri/r128/server/r128.h | 465 ++ .../src/mesa/drivers/dri/r128/server/r128_dri.c | 1113 ++++ .../src/mesa/drivers/dri/r128/server/r128_dri.h | 103 + .../src/mesa/drivers/dri/r128/server/r128_macros.h | 135 + .../src/mesa/drivers/dri/r128/server/r128_reg.h | 1394 +++++ .../mesa/drivers/dri/r128/server/r128_version.h | 60 + .../extras/Mesa/src/mesa/drivers/dri/r200/Doxyfile | 232 + .../extras/Mesa/src/mesa/drivers/dri/r200/Makefile | 62 + .../Mesa/src/mesa/drivers/dri/r200/r200_cmdbuf.c | 423 ++ .../Mesa/src/mesa/drivers/dri/r200/r200_context.c | 694 +++ .../Mesa/src/mesa/drivers/dri/r200/r200_context.h | 995 ++++ .../Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c | 966 +++ .../Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h | 215 + .../Mesa/src/mesa/drivers/dri/r200/r200_lock.c | 127 + .../Mesa/src/mesa/drivers/dri/r200/r200_lock.h | 107 + .../Mesa/src/mesa/drivers/dri/r200/r200_maos.c | 15 + .../Mesa/src/mesa/drivers/dri/r200/r200_maos.h | 44 + .../src/mesa/drivers/dri/r200/r200_maos_arrays.c | 530 ++ .../Mesa/src/mesa/drivers/dri/r200/r200_pixel.c | 492 ++ .../Mesa/src/mesa/drivers/dri/r200/r200_pixel.h | 40 + .../Mesa/src/mesa/drivers/dri/r200/r200_reg.h | 1454 +++++ .../Mesa/src/mesa/drivers/dri/r200/r200_sanity.c | 1341 +++++ .../Mesa/src/mesa/drivers/dri/r200/r200_sanity.h | 8 + .../Mesa/src/mesa/drivers/dri/r200/r200_screen.c | 737 +++ .../Mesa/src/mesa/drivers/dri/r200/r200_screen.h | 106 + .../Mesa/src/mesa/drivers/dri/r200/r200_span.c | 367 ++ .../Mesa/src/mesa/drivers/dri/r200/r200_span.h | 46 + .../Mesa/src/mesa/drivers/dri/r200/r200_state.c | 2383 ++++++++ .../Mesa/src/mesa/drivers/dri/r200/r200_state.h | 67 + .../src/mesa/drivers/dri/r200/r200_state_init.c | 798 +++ .../Mesa/src/mesa/drivers/dri/r200/r200_swtcl.c | 957 +++ .../Mesa/src/mesa/drivers/dri/r200/r200_swtcl.h | 76 + .../Mesa/src/mesa/drivers/dri/r200/r200_tcl.c | 583 ++ .../Mesa/src/mesa/drivers/dri/r200/r200_tcl.h | 69 + .../Mesa/src/mesa/drivers/dri/r200/r200_tex.c | 1183 ++++ .../Mesa/src/mesa/drivers/dri/r200/r200_tex.h | 47 + .../Mesa/src/mesa/drivers/dri/r200/r200_texmem.c | 526 ++ .../Mesa/src/mesa/drivers/dri/r200/r200_texstate.c | 1468 +++++ .../Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.c | 1227 ++++ .../Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.h | 123 + .../Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_c.c | 1002 ++++ .../src/mesa/drivers/dri/r200/r200_vtxfmt_sse.c | 234 + .../src/mesa/drivers/dri/r200/r200_vtxfmt_x86.c | 440 ++ .../src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S | 495 ++ .../extras/Mesa/src/mesa/drivers/dri/r300/Makefile | 83 + .../Mesa/src/mesa/drivers/dri/r300/pixel_shader.h | 103 + .../Mesa/src/mesa/drivers/dri/r300/r200_context.h | 822 +++ .../Mesa/src/mesa/drivers/dri/r300/r200_ioctl.h | 204 + .../Mesa/src/mesa/drivers/dri/r300/r200_reg.h | 1423 +++++ .../Mesa/src/mesa/drivers/dri/r300/r200_sanity.h | 7 + .../Mesa/src/mesa/drivers/dri/r300/r200_state.h | 58 + .../Mesa/src/mesa/drivers/dri/r300/r200_tcl.h | 50 + .../Mesa/src/mesa/drivers/dri/r300/r200_tex.h | 51 + .../Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.c | 655 +++ .../Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.h | 118 + .../Mesa/src/mesa/drivers/dri/r300/r300_context.c | 453 ++ .../Mesa/src/mesa/drivers/dri/r300/r300_context.h | 844 +++ .../Mesa/src/mesa/drivers/dri/r300/r300_emit.h | 282 + .../mesa/drivers/dri/r300/r300_fixed_pipelines.h | 294 + .../Mesa/src/mesa/drivers/dri/r300/r300_fragprog.c | 1090 ++++ .../Mesa/src/mesa/drivers/dri/r300/r300_fragprog.h | 49 + .../src/mesa/drivers/dri/r300/r300_fragprog_swz.c | 1343 +++++ .../Mesa/src/mesa/drivers/dri/r300/r300_ioctl.c | 774 +++ .../Mesa/src/mesa/drivers/dri/r300/r300_ioctl.h | 62 + .../Mesa/src/mesa/drivers/dri/r300/r300_maos.c | 561 ++ .../Mesa/src/mesa/drivers/dri/r300/r300_maos.h | 49 + .../Mesa/src/mesa/drivers/dri/r300/r300_program.h | 151 + .../Mesa/src/mesa/drivers/dri/r300/r300_reg.h | 1387 +++++ .../Mesa/src/mesa/drivers/dri/r300/r300_render.c | 726 +++ .../Mesa/src/mesa/drivers/dri/r300/r300_shader.c | 112 + .../Mesa/src/mesa/drivers/dri/r300/r300_state.c | 2321 ++++++++ .../Mesa/src/mesa/drivers/dri/r300/r300_state.h | 69 + .../Mesa/src/mesa/drivers/dri/r300/r300_tex.c | 1051 ++++ .../Mesa/src/mesa/drivers/dri/r300/r300_tex.h | 51 + .../Mesa/src/mesa/drivers/dri/r300/r300_texmem.c | 514 ++ .../Mesa/src/mesa/drivers/dri/r300/r300_texprog.c | 270 + .../Mesa/src/mesa/drivers/dri/r300/r300_texprog.h | 9 + .../Mesa/src/mesa/drivers/dri/r300/r300_texstate.c | 1465 +++++ .../src/mesa/drivers/dri/r300/r300_vertexprog.c | 952 +++ .../src/mesa/drivers/dri/r300/radeon_context.c | 312 + .../src/mesa/drivers/dri/r300/radeon_context.h | 249 + .../Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c | 372 ++ .../Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.h | 53 + .../Mesa/src/mesa/drivers/dri/r300/radeon_lock.c | 166 + .../Mesa/src/mesa/drivers/dri/r300/radeon_lock.h | 122 + .../Mesa/src/mesa/drivers/dri/r300/radeon_screen.c | 879 +++ .../Mesa/src/mesa/drivers/dri/r300/radeon_screen.h | 112 + .../Mesa/src/mesa/drivers/dri/r300/radeon_span.c | 391 ++ .../Mesa/src/mesa/drivers/dri/r300/radeon_span.h | 46 + .../Mesa/src/mesa/drivers/dri/r300/radeon_state.c | 245 + .../Mesa/src/mesa/drivers/dri/r300/radeon_state.h | 45 + .../Mesa/src/mesa/drivers/dri/r300/vertex_shader.h | 91 + .../Mesa/src/mesa/drivers/dri/radeon/Makefile | 42 + .../src/mesa/drivers/dri/radeon/radeon_compat.c | 302 + .../src/mesa/drivers/dri/radeon/radeon_context.c | 630 ++ .../src/mesa/drivers/dri/radeon/radeon_context.h | 868 +++ .../src/mesa/drivers/dri/radeon/radeon_ioctl.c | 1283 ++++ .../src/mesa/drivers/dri/radeon/radeon_ioctl.h | 217 + .../src/mesa/drivers/dri/radeon/radeon_lighting.c | 682 +++ .../Mesa/src/mesa/drivers/dri/radeon/radeon_lock.c | 135 + .../Mesa/src/mesa/drivers/dri/radeon/radeon_lock.h | 108 + .../Mesa/src/mesa/drivers/dri/radeon/radeon_maos.c | 12 + .../Mesa/src/mesa/drivers/dri/radeon/radeon_maos.h | 44 + .../mesa/drivers/dri/radeon/radeon_maos_arrays.c | 604 ++ .../mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 284 + .../mesa/drivers/dri/radeon/radeon_maos_verts.c | 367 ++ .../src/mesa/drivers/dri/radeon/radeon_sanity.c | 1070 ++++ .../src/mesa/drivers/dri/radeon/radeon_sanity.h | 8 + .../src/mesa/drivers/dri/radeon/radeon_screen.c | 656 +++ .../src/mesa/drivers/dri/radeon/radeon_screen.h | 103 + .../Mesa/src/mesa/drivers/dri/radeon/radeon_span.c | 346 ++ .../Mesa/src/mesa/drivers/dri/radeon/radeon_span.h | 46 + .../src/mesa/drivers/dri/radeon/radeon_state.c | 2295 ++++++++ .../src/mesa/drivers/dri/radeon/radeon_state.h | 74 + .../mesa/drivers/dri/radeon/radeon_state_init.c | 572 ++ .../src/mesa/drivers/dri/radeon/radeon_swtcl.c | 983 ++++ .../src/mesa/drivers/dri/radeon/radeon_swtcl.h | 69 + .../Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c | 489 ++ .../Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.h | 66 + .../Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c | 866 +++ .../Mesa/src/mesa/drivers/dri/radeon/radeon_tex.h | 50 + .../src/mesa/drivers/dri/radeon/radeon_texmem.c | 404 ++ .../src/mesa/drivers/dri/radeon/radeon_texstate.c | 1171 ++++ .../src/mesa/drivers/dri/radeon/radeon_vtxfmt.c | 1093 ++++ .../src/mesa/drivers/dri/radeon/radeon_vtxfmt.h | 120 + .../src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c | 922 +++ .../mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c | 232 + .../mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c | 437 ++ .../mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S | 494 ++ .../src/mesa/drivers/dri/radeon/server/radeon.h | 202 + .../mesa/drivers/dri/radeon/server/radeon_dri.c | 1336 +++++ .../mesa/drivers/dri/radeon/server/radeon_dri.h | 116 + .../mesa/drivers/dri/radeon/server/radeon_egl.c | 978 ++++ .../mesa/drivers/dri/radeon/server/radeon_macros.h | 129 + .../mesa/drivers/dri/radeon/server/radeon_reg.h | 2142 +++++++ .../extras/Mesa/src/mesa/drivers/dri/s3v/Makefile | 36 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_common.h | 83 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_context.c | 258 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_context.h | 444 ++ .../extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dd.c | 108 + .../extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dri.h | 143 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_inithw.c | 79 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_lock.c | 62 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_lock.h | 99 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_macros.h | 229 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_regs.h | 367 ++ .../Mesa/src/mesa/drivers/dri/s3v/s3v_render.c | 203 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_screen.c | 99 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_screen.h | 39 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_span.c | 334 ++ .../Mesa/src/mesa/drivers/dri/s3v/s3v_state.c | 888 +++ .../extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.c | 554 ++ .../extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.h | 28 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_texmem.c | 582 ++ .../Mesa/src/mesa/drivers/dri/s3v/s3v_texstate.c | 300 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_tris.c | 850 +++ .../Mesa/src/mesa/drivers/dri/s3v/s3v_tris.h | 11 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_tritmp.h | 958 +++ .../extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.c | 339 ++ .../extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.h | 39 + .../Mesa/src/mesa/drivers/dri/s3v/s3v_xmesa.c | 362 ++ .../Mesa/src/mesa/drivers/dri/s3v/s3virgetri.h | 383 ++ .../Mesa/src/mesa/drivers/dri/savage/Makefile | 30 + .../src/mesa/drivers/dri/savage/savage_3d_reg.h | 699 +++ .../Mesa/src/mesa/drivers/dri/savage/savage_bci.h | 612 ++ .../Mesa/src/mesa/drivers/dri/savage/savage_init.h | 168 + .../src/mesa/drivers/dri/savage/savage_xmesa.c | 1056 ++++ .../src/mesa/drivers/dri/savage/savagecontext.h | 331 ++ .../Mesa/src/mesa/drivers/dri/savage/savagedd.c | 119 + .../Mesa/src/mesa/drivers/dri/savage/savagedd.h | 32 + .../Mesa/src/mesa/drivers/dri/savage/savageioctl.c | 657 +++ .../Mesa/src/mesa/drivers/dri/savage/savageioctl.h | 203 + .../src/mesa/drivers/dri/savage/savagerender.c | 370 ++ .../Mesa/src/mesa/drivers/dri/savage/savagespan.c | 343 ++ .../Mesa/src/mesa/drivers/dri/savage/savagespan.h | 137 + .../Mesa/src/mesa/drivers/dri/savage/savagestate.c | 1765 ++++++ .../Mesa/src/mesa/drivers/dri/savage/savagestate.h | 41 + .../Mesa/src/mesa/drivers/dri/savage/savagetex.c | 2133 +++++++ .../Mesa/src/mesa/drivers/dri/savage/savagetex.h | 83 + .../Mesa/src/mesa/drivers/dri/savage/savagetris.c | 1297 ++++ .../Mesa/src/mesa/drivers/dri/savage/savagetris.h | 49 + .../mesa/drivers/dri/savage/server/savage_dri.h | 76 + .../extras/Mesa/src/mesa/drivers/dri/sis/Makefile | 35 + .../src/mesa/drivers/dri/sis/server/sis_common.h | 63 + .../Mesa/src/mesa/drivers/dri/sis/server/sis_dri.h | 85 + .../Mesa/src/mesa/drivers/dri/sis/sis_alloc.c | 243 + .../Mesa/src/mesa/drivers/dri/sis/sis_alloc.h | 44 + .../Mesa/src/mesa/drivers/dri/sis/sis_clear.c | 451 ++ .../Mesa/src/mesa/drivers/dri/sis/sis_common2.h | 140 + .../Mesa/src/mesa/drivers/dri/sis/sis_context.c | 523 ++ .../Mesa/src/mesa/drivers/dri/sis/sis_context.h | 440 ++ .../extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.c | 181 + .../extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.h | 39 + .../Mesa/src/mesa/drivers/dri/sis/sis_debug.c | 156 + .../Mesa/src/mesa/drivers/dri/sis/sis_debug.h | 45 + .../extras/Mesa/src/mesa/drivers/dri/sis/sis_fog.c | 190 + .../Mesa/src/mesa/drivers/dri/sis/sis_lock.c | 76 + .../Mesa/src/mesa/drivers/dri/sis/sis_lock.h | 87 + .../extras/Mesa/src/mesa/drivers/dri/sis/sis_reg.h | 868 +++ .../Mesa/src/mesa/drivers/dri/sis/sis_screen.c | 468 ++ .../Mesa/src/mesa/drivers/dri/sis/sis_screen.h | 62 + .../Mesa/src/mesa/drivers/dri/sis/sis_span.c | 237 + .../Mesa/src/mesa/drivers/dri/sis/sis_span.h | 46 + .../Mesa/src/mesa/drivers/dri/sis/sis_state.c | 853 +++ .../Mesa/src/mesa/drivers/dri/sis/sis_state.h | 54 + .../Mesa/src/mesa/drivers/dri/sis/sis_stencil.c | 185 + .../Mesa/src/mesa/drivers/dri/sis/sis_stencil.h | 37 + .../extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.c | 484 ++ .../extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.h | 38 + .../Mesa/src/mesa/drivers/dri/sis/sis_texstate.c | 672 +++ .../Mesa/src/mesa/drivers/dri/sis/sis_tris.c | 1071 ++++ .../Mesa/src/mesa/drivers/dri/sis/sis_tris.h | 71 + .../Mesa/src/mesa/drivers/dri/sis/sis_tritmp.h | 70 + nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/BUGS | 64 + .../extras/Mesa/src/mesa/drivers/dri/tdfx/Makefile | 37 + .../mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S | 84 + .../mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h | 314 + .../Mesa/src/mesa/drivers/dri/tdfx/dri_glide.h | 60 + .../src/mesa/drivers/dri/tdfx/server/tdfx_dri.c | 471 ++ .../src/mesa/drivers/dri/tdfx/server/tdfx_dri.h | 28 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c | 1028 ++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.h | 1007 ++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.c | 322 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.h | 45 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_glide.h | 606 ++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.c | 90 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.h | 144 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 689 +++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.h | 77 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c | 808 +++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.h | 50 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.c | 492 ++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.h | 73 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.c | 1427 +++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.h | 49 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.c | 1449 +++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.h | 61 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.c | 1914 ++++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.h | 102 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.c | 994 ++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.h | 84 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.c | 2209 +++++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.h | 44 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.c | 1293 ++++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.h | 42 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.c | 353 ++ .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.h | 69 + .../Mesa/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h | 266 + .../Mesa/src/mesa/drivers/dri/trident/Makefile | 26 + .../src/mesa/drivers/dri/trident/trident_context.c | 472 ++ .../src/mesa/drivers/dri/trident/trident_context.h | 242 + .../Mesa/src/mesa/drivers/dri/trident/trident_dd.c | 127 + .../src/mesa/drivers/dri/trident/trident_dri.h | 28 + .../src/mesa/drivers/dri/trident/trident_lock.h | 11 + .../src/mesa/drivers/dri/trident/trident_state.c | 555 ++ .../src/mesa/drivers/dri/trident/trident_tris.c | 1125 ++++ .../Mesa/src/mesa/drivers/dri/trident/trident_vb.c | 434 ++ .../Mesa/src/mesa/drivers/dri/unichrome/Makefile | 32 + .../src/mesa/drivers/dri/unichrome/server/via.h | 11 + .../mesa/drivers/dri/unichrome/server/via_dri.c | 1252 ++++ .../mesa/drivers/dri/unichrome/server/via_dri.h | 78 + .../mesa/drivers/dri/unichrome/server/via_driver.h | 309 + .../mesa/drivers/dri/unichrome/server/via_priv.h | 70 + .../mesa/drivers/dri/unichrome/server/via_regs.h | 197 + .../src/mesa/drivers/dri/unichrome/via_3d_reg.h | 1652 ++++++ .../src/mesa/drivers/dri/unichrome/via_context.c | 782 +++ .../src/mesa/drivers/dri/unichrome/via_context.h | 412 ++ .../src/mesa/drivers/dri/unichrome/via_drmclient.h | 29 + .../Mesa/src/mesa/drivers/dri/unichrome/via_fb.c | 243 + .../Mesa/src/mesa/drivers/dri/unichrome/via_fb.h | 42 + .../src/mesa/drivers/dri/unichrome/via_ioctl.c | 970 +++ .../src/mesa/drivers/dri/unichrome/via_ioctl.h | 135 + .../src/mesa/drivers/dri/unichrome/via_memcpy.c | 138 + .../src/mesa/drivers/dri/unichrome/via_render.c | 131 + .../src/mesa/drivers/dri/unichrome/via_screen.c | 491 ++ .../src/mesa/drivers/dri/unichrome/via_screen.h | 95 + .../Mesa/src/mesa/drivers/dri/unichrome/via_span.c | 289 + .../Mesa/src/mesa/drivers/dri/unichrome/via_span.h | 37 + .../src/mesa/drivers/dri/unichrome/via_state.c | 1550 +++++ .../src/mesa/drivers/dri/unichrome/via_state.h | 39 + .../Mesa/src/mesa/drivers/dri/unichrome/via_tex.c | 970 +++ .../Mesa/src/mesa/drivers/dri/unichrome/via_tex.h | 41 + .../mesa/drivers/dri/unichrome/via_texcombine.c | 424 ++ .../Mesa/src/mesa/drivers/dri/unichrome/via_tris.c | 1190 ++++ .../Mesa/src/mesa/drivers/dri/unichrome/via_tris.h | 35 + .../extras/Mesa/src/mesa/drivers/dri/x11/Makefile | 89 + .../extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.c | 487 ++ .../extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.h | 12 + 568 files changed, 235649 insertions(+) create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile.template create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/depthtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/extension_helper.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmio.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmx.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp2.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/stenciltmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/de.po create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/es.po create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/fr.po create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/nl.po create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/options.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/t_options.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Doxyfile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_egl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fifo.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_linetmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_pointtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_rendertmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tritmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vbtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_dac.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_drishare.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_regs.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_client.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_inithw.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_macros.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_regs.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_xmesa.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810_3d_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_metaops.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texblend.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_vtbl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_debug.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_metaops.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_pixel.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vbtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/server/mach64_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Doxyfile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/README create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texcombine.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgacontext.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaregs.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgarender.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatexmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_bios.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_macros.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texobj.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/pci_ids.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_macros.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_version.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Doxyfile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_cmdbuf.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos_arrays.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state_init.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_c.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_sse.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_x86.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/pixel_shader.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_sanity.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tcl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_emit.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fixed_pipelines.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog_swz.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_program.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_shader.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_vertexprog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/vertex_shader.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_compat.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lighting.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_verts.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state_init.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_egl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_macros.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_inithw.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_macros.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_regs.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texmem.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tritmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_xmesa.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3virgetri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_3d_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_bci.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_init.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_xmesa.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagecontext.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagerender.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/server/savage_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_common.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_clear.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_common2.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_fog.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tritmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/BUGS create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/dri_glide.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_glide.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dd.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_lock.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_vb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_driver.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_priv.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_regs.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_3d_reg.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_drmclient.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_memcpy.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_render.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_texcombine.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.h create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/Makefile create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.c create mode 100644 nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.h (limited to 'nx-X11/extras/Mesa/src/mesa/drivers/dri') diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile new file mode 100644 index 000000000..8db675431 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile @@ -0,0 +1,34 @@ +# src/mesa/drivers/dri/Makefile + +TOP = ../../../.. + +include $(TOP)/configs/current + + + +default: $(LIB_DIR) subdirs + + +$(LIB_DIR): + -mkdir $(LIB_DIR) + + +subdirs: + echo $(DRI_DIRS) + @for dir in $(DRI_DIRS) ; do \ + echo $$dir ; \ + (cd $$dir ; $(MAKE)) || exit 1; \ + done + + +install: + @for dir in $(DRI_DIRS) ; do \ + (cd $$dir ; $(MAKE) install) || exit 1; \ + done + + +clean: + @for dir in $(DRI_DIRS) ; do \ + (cd $$dir ; $(MAKE) clean) ; \ + done + -rm -f common/*.o diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile.template b/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile.template new file mode 100644 index 000000000..c8fef8aac --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile.template @@ -0,0 +1,109 @@ +# -*-makefile-*- + +MESA_MODULES = $(TOP)/src/mesa/mesa.a + +COMMON_SOURCES = \ + ../../common/driverfuncs.c \ + ../common/utils.c \ + ../common/texmem.c \ + ../common/vblank.c \ + ../common/dri_util.c \ + ../common/xmlconfig.c \ + ../common/drirenderbuffer.c + +ifeq ($(WINDOW_SYSTEM),dri) +WINOBJ= +WINLIB= +INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) \ + `pkg-config --cflags libdrm` + +OBJECTS = $(C_SOURCES:.c=.o) \ + $(ASM_SOURCES:.S=.o) + +else +WINOBJ= +WINLIB=-L$(MESA)/src/glx/mini +MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini +INCLUDES = $(MINIGLX_INCLUDES) \ + -I$(DRM_SOURCE_PATH)/shared-core \ + -I$(DRM_SOURCE_PATH)/libdrm \ + $(SHARED_INCLUDES) + +OBJECTS = $(C_SOURCES:.c=.o) \ + $(MINIGLX_SOURCES:.c=.o) \ + $(ASM_SOURCES:.S=.o) +endif + + +### Include directories +SHARED_INCLUDES = \ + -I. \ + -I$(TOP)/src/mesa/drivers/dri/common \ + -Iserver \ + -I$(DRM_SOURCE_PATH)/shared-core \ + -I$(TOP)/include \ + -I$(TOP)/include/GL/internal \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/math \ + -I$(TOP)/src/mesa/transform \ + -I$(TOP)/src/mesa/shader \ + -I$(TOP)/src/mesa/swrast \ + -I$(TOP)/src/mesa/swrast_setup \ + -I$(TOP)/src/egl/main \ + -I$(TOP)/src/egl/drivers/dri + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +default: depend symlinks $(LIBNAME) $(LIB_DIR)/$(LIBNAME) + + +#$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile +# @echo BUILDING FOR: $(WINDOW_SYSTEM) +# $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ +# $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) + +# XXX we should use the mklib script here +$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template + rm -f $@ + $(CC) $(ARCH_FLAGS) -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS) + + +$(LIB_DIR)/$(LIBNAME): $(LIBNAME) + install $(LIBNAME) $(LIB_DIR) + + + +# Run 'make depend' to update the dependencies if you change +# what's included by any source file. +.PHONY: depend +depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \ + > /dev/null + + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# Remove .o and backup files +clean: + -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS) + -rm -f depend depend.bak + +install: $(LIBNAME) + install $(LIBNAME) /usr/X11R6/lib/modules/dri/$(LIBNAME) + +include depend diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/depthtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/depthtmp.h new file mode 100644 index 000000000..1875d157b --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/depthtmp.h @@ -0,0 +1,253 @@ + +/* + * Notes: + * 1. These functions plug into the gl_renderbuffer structure. + * 2. The 'values' parameter always points to GLuint values, regardless of + * the actual Z buffer depth. + */ + + +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HAVE_HW_DEPTH_SPANS +#define HAVE_HW_DEPTH_SPANS 0 +#endif + +#ifndef HAVE_HW_DEPTH_PIXELS +#define HAVE_HW_DEPTH_PIXELS 0 +#endif + +static void TAG(WriteDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLuint *depth = (const GLuint *) values; + GLint x1; + GLint n1; + LOCAL_DEPTH_VARS; + + y = Y_FLIP( y ); + +#if HAVE_HW_DEPTH_SPANS + (void) x1; (void) n1; + + if ( DBG ) fprintf( stderr, "WriteDepthSpan 0..%d (x1 %d)\n", + (int)n, (int)x ); + + WRITE_DEPTH_SPAN(); +#else + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN( x, y, n, x1, n1, i ); + + if ( DBG ) fprintf( stderr, "WriteDepthSpan %d..%d (x1 %d) (mask %p)\n", + (int)i, (int)n1, (int)x1, mask ); + + if ( mask ) { + for ( ; n1>0 ; i++, x1++, n1-- ) { + if ( mask[i] ) WRITE_DEPTH( x1, y, depth[i] ); + } + } else { + for ( ; n1>0 ; i++, x1++, n1-- ) { + WRITE_DEPTH( x1, y, depth[i] ); + } + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_WRITE_UNLOCK(); +} + + +#if HAVE_HW_DEPTH_SPANS +/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */ +static void +TAG(WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[] ) +{ + const GLuint depthVal = *((GLuint *) value); + GLuint depths[MAX_WIDTH]; + GLuint i; + for (i = 0; i < n; i++) + depths[i] = depthVal; + TAG(WriteDepthSpan)(ctx, rb, n, x, y, depths, mask); +} +#else +static void TAG(WriteMonoDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLuint depth = *((GLuint *) value); + GLint x1; + GLint n1; + LOCAL_DEPTH_VARS; + + y = Y_FLIP( y ); + + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN( x, y, n, x1, n1, i ); + + if ( DBG ) fprintf( stderr, "%s %d..%d (x1 %d) = %u\n", + __FUNCTION__, (int)i, (int)n1, (int)x1, (GLuint)depth ); + + if ( mask ) { + for ( ; n1>0 ; i++, x1++, n1-- ) { + if ( mask[i] ) WRITE_DEPTH( x1, y, depth ); + } + } else { + for ( ; n1>0 ; x1++, n1-- ) { + WRITE_DEPTH( x1, y, depth ); + } + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} +#endif + + +static void TAG(WriteDepthPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], + const GLint y[], + const void *values, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLuint *depth = (const GLuint *) values; + GLuint i; + LOCAL_DEPTH_VARS; + + if ( DBG ) fprintf( stderr, "WriteDepthPixels\n" ); + +#if HAVE_HW_DEPTH_PIXELS + (void) i; + + WRITE_DEPTH_PIXELS(); +#else + HW_CLIPLOOP() + { + if ( mask ) { + for ( i = 0 ; i < n ; i++ ) { + if ( mask[i] ) { + const int fy = Y_FLIP( y[i] ); + if ( CLIPPIXEL( x[i], fy ) ) + WRITE_DEPTH( x[i], fy, depth[i] ); + } + } + } + else { + for ( i = 0 ; i < n ; i++ ) { + const int fy = Y_FLIP( y[i] ); + if ( CLIPPIXEL( x[i], fy ) ) + WRITE_DEPTH( x[i], fy, depth[i] ); + } + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_WRITE_UNLOCK(); +} + + +/* Read depth spans and pixels + */ +static void TAG(ReadDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values ) +{ + HW_READ_LOCK() + { + GLuint *depth = (GLuint *) values; + GLint x1, n1; + LOCAL_DEPTH_VARS; + + y = Y_FLIP( y ); + + if ( DBG ) fprintf( stderr, "ReadDepthSpan\n" ); + +#if HAVE_HW_DEPTH_SPANS + (void) x1; (void) n1; + + READ_DEPTH_SPAN(); +#else + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN( x, y, n, x1, n1, i ); + for ( ; n1>0 ; i++, n1-- ) { + READ_DEPTH( depth[i], x+i, y ); + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_READ_UNLOCK(); +} + +static void TAG(ReadDepthPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLuint *depth = (GLuint *) values; + GLuint i; + LOCAL_DEPTH_VARS; + + if ( DBG ) fprintf( stderr, "ReadDepthPixels\n" ); + +#if HAVE_HW_DEPTH_PIXELS + (void) i; + + READ_DEPTH_PIXELS(); +#else + HW_CLIPLOOP() + { + for ( i = 0 ; i < n ;i++ ) { + int fy = Y_FLIP( y[i] ); + if ( CLIPPIXEL( x[i], fy ) ) + READ_DEPTH( depth[i], x[i], fy ); + } + } + HW_ENDCLIPLOOP(); +#endif + } + HW_READ_UNLOCK(); +} + + +#if HAVE_HW_DEPTH_SPANS +#undef WRITE_DEPTH_SPAN +#undef WRITE_DEPTH_PIXELS +#undef READ_DEPTH_SPAN +#undef READ_DEPTH_PIXELS +#else +#undef WRITE_DEPTH +#undef READ_DEPTH +#endif +#undef TAG diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.c new file mode 100644 index 000000000..3edeb03f9 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.c @@ -0,0 +1,1073 @@ +/* $XFree86: xc/lib/GL/dri/dri_util.c,v 1.7 2003/04/28 17:01:25 dawes Exp $ */ +/** + * \file dri_util.c + * DRI utility functions. + * + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. + * + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. + */ + + +#include +#include +#include +#include +#include + +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + +#include "imports.h" +#define None 0 + +#include "dri_util.h" +#include "drm_sarea.h" + +#ifndef GLX_OML_sync_control +typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator); +#endif + +/* This pointer *must* be set by the driver's __driCreateNewScreen funciton! + */ +const __DRIinterfaceMethods * dri_interface = NULL; + +/** + * This is used in a couple of places that call \c driCreateNewDrawable. + */ +static const int empty_attribute_list[1] = { None }; + + +/** + * Cached copy of the internal API version used by libGL and the client-side + * DRI driver. + */ +static int api_ver = 0; + +/* forward declarations */ +static int driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv, + int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, + float * usage ); + +static void *driCreateNewDrawable(__DRInativeDisplay *dpy, const __GLcontextModes *modes, + __DRIid draw, __DRIdrawable *pdraw, int renderType, const int *attrs); + +static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate); + + +/** + * Print message to \c stderr if the \c LIBGL_DEBUG environment variable + * is set. + * + * Is called from the drivers. + * + * \param f \c printf like format string. + */ +void +__driUtilMessage(const char *f, ...) +{ + va_list args; + + if (getenv("LIBGL_DEBUG")) { + fprintf(stderr, "libGL error: \n"); + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + fprintf(stderr, "\n"); + } +} + + +/*****************************************************************/ +/** \name Drawable list management */ +/*****************************************************************/ +/*@{*/ + +static GLboolean __driAddDrawable(void *drawHash, __DRIdrawable *pdraw) +{ + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; + + if (drmHashInsert(drawHash, pdp->draw, pdraw)) + return GL_FALSE; + + return GL_TRUE; +} + +static __DRIdrawable *__driFindDrawable(void *drawHash, __DRIid draw) +{ + int retcode; + __DRIdrawable *pdraw; + + retcode = drmHashLookup(drawHash, draw, (void *)&pdraw); + if (retcode) + return NULL; + + return pdraw; +} + + +/** + * Find drawables in the local hash that have been destroyed on the + * server. + * + * \param drawHash Hash-table containing all know drawables. + */ +static void __driGarbageCollectDrawables(void *drawHash) +{ + __DRIid draw; + __DRInativeDisplay *dpy; + __DRIdrawable *pdraw; + + if (drmHashFirst(drawHash, &draw, (void *)&pdraw) == 1) { + do { + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; + dpy = pdp->driScreenPriv->display; + if (! (*dri_interface->windowExists)(dpy, draw)) { + /* Destroy the local drawable data, if the drawable no + longer exists in the Xserver */ + (*pdraw->destroyDrawable)(dpy, pdraw->private); + _mesa_free(pdraw); + } + } while (drmHashNext(drawHash, &draw, (void *)&pdraw) == 1); + } +} + +/*@}*/ + + +/*****************************************************************/ +/** \name Context (un)binding functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Unbind context. + * + * \param dpy the display handle. + * \param scrn the screen number. + * \param draw drawable. + * \param read Current reading drawable. + * \param gc context. + * + * \return \c GL_TRUE on success, or \c GL_FALSE on failure. + * + * \internal + * This function calls __DriverAPIRec::UnbindContext, and then decrements + * __DRIdrawablePrivateRec::refcount which must be non-zero for a successful + * return. + * + * While casting the opaque private pointers associated with the parameters + * into their respective real types it also assures they are not \c NULL. + */ +static GLboolean driUnbindContext(__DRInativeDisplay *dpy, int scrn, + __DRIid draw, __DRIid read, + __DRIcontext *ctx) +{ + __DRIscreen *pDRIScreen; + __DRIdrawable *pdraw; + __DRIdrawable *pread; + __DRIcontextPrivate *pcp; + __DRIscreenPrivate *psp; + __DRIdrawablePrivate *pdp; + __DRIdrawablePrivate *prp; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driUnbindContext. + */ + + if (ctx == NULL || draw == None || read == None) { + /* ERROR!!! */ + return GL_FALSE; + } + + pDRIScreen = (*dri_interface->getScreen)(dpy, scrn); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + /* ERROR!!! */ + return GL_FALSE; + } + + psp = (__DRIscreenPrivate *)pDRIScreen->private; + pcp = (__DRIcontextPrivate *)ctx->private; + + pdraw = __driFindDrawable(psp->drawHash, draw); + if (!pdraw) { + /* ERROR!!! */ + return GL_FALSE; + } + pdp = (__DRIdrawablePrivate *)pdraw->private; + + pread = __driFindDrawable(psp->drawHash, read); + if (!pread) { + /* ERROR!!! */ + return GL_FALSE; + } + prp = (__DRIdrawablePrivate *)pread->private; + + + /* Let driver unbind drawable from context */ + (*psp->DriverAPI.UnbindContext)(pcp); + + + if (pdp->refcount == 0) { + /* ERROR!!! */ + return GL_FALSE; + } + + pdp->refcount--; + + if (prp != pdp) { + if (prp->refcount == 0) { + /* ERROR!!! */ + return GL_FALSE; + } + + prp->refcount--; + } + + + /* XXX this is disabled so that if we call SwapBuffers on an unbound + * window we can determine the last context bound to the window and + * use that context's lock. (BrianP, 2-Dec-2000) + */ +#if 0 + /* Unbind the drawable */ + pcp->driDrawablePriv = NULL; + pdp->driContextPriv = &psp->dummyContextPriv; +#endif + + return GL_TRUE; +} + + +/** + * This function takes both a read buffer and a draw buffer. This is needed + * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent + * function. + * + * \bug This function calls \c driCreateNewDrawable in two places with the + * \c renderType hard-coded to \c GLX_WINDOW_BIT. Some checking might + * be needed in those places when support for pbuffers and / or pixmaps + * is added. Is it safe to assume that the drawable is a window? + */ +static GLboolean DoBindContext(__DRInativeDisplay *dpy, + __DRIid draw, __DRIid read, + __DRIcontext *ctx, const __GLcontextModes * modes, + __DRIscreenPrivate *psp) +{ + __DRIdrawable *pdraw; + __DRIdrawablePrivate *pdp; + __DRIdrawable *pread; + __DRIdrawablePrivate *prp; + __DRIcontextPrivate * const pcp = ctx->private; + + + /* Find the _DRIdrawable which corresponds to the writing drawable. */ + pdraw = __driFindDrawable(psp->drawHash, draw); + if (!pdraw) { + /* Allocate a new drawable */ + pdraw = (__DRIdrawable *)_mesa_malloc(sizeof(__DRIdrawable)); + if (!pdraw) { + /* ERROR!!! */ + return GL_FALSE; + } + + /* Create a new drawable */ + driCreateNewDrawable(dpy, modes, draw, pdraw, GLX_WINDOW_BIT, + empty_attribute_list); + if (!pdraw->private) { + /* ERROR!!! */ + _mesa_free(pdraw); + return GL_FALSE; + } + + } + pdp = (__DRIdrawablePrivate *) pdraw->private; + + /* Find the _DRIdrawable which corresponds to the reading drawable. */ + if (read == draw) { + /* read buffer == draw buffer */ + prp = pdp; + } + else { + pread = __driFindDrawable(psp->drawHash, read); + if (!pread) { + /* Allocate a new drawable */ + pread = (__DRIdrawable *)_mesa_malloc(sizeof(__DRIdrawable)); + if (!pread) { + /* ERROR!!! */ + return GL_FALSE; + } + + /* Create a new drawable */ + driCreateNewDrawable(dpy, modes, read, pread, GLX_WINDOW_BIT, + empty_attribute_list); + if (!pread->private) { + /* ERROR!!! */ + _mesa_free(pread); + return GL_FALSE; + } + } + prp = (__DRIdrawablePrivate *) pread->private; + } + + /* Bind the drawable to the context */ + pcp->driDrawablePriv = pdp; + pdp->driContextPriv = pcp; + pdp->refcount++; + if ( pdp != prp ) { + prp->refcount++; + } + + /* + ** Now that we have a context associated with this drawable, we can + ** initialize the drawable information if has not been done before. + */ + if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) { + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + __driUtilUpdateDrawableInfo(pdp); + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + } + + /* Call device-specific MakeCurrent */ + (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp); + + return GL_TRUE; +} + + +/** + * This function takes both a read buffer and a draw buffer. This is needed + * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent + * function. + */ +static GLboolean driBindContext(__DRInativeDisplay *dpy, int scrn, + __DRIid draw, __DRIid read, + __DRIcontext * ctx) +{ + __DRIscreen *pDRIScreen; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driBindContext. + */ + + if (ctx == NULL || draw == None || read == None) { + /* ERROR!!! */ + return GL_FALSE; + } + + pDRIScreen = (*dri_interface->getScreen)(dpy, scrn); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + /* ERROR!!! */ + return GL_FALSE; + } + + return DoBindContext( dpy, draw, read, ctx, ctx->mode, + (__DRIscreenPrivate *)pDRIScreen->private ); +} +/*@}*/ + + +/*****************************************************************/ +/** \name Drawable handling functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Update private drawable information. + * + * \param pdp pointer to the private drawable information to update. + * + * This function basically updates the __DRIdrawablePrivate struct's + * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo. + * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which + * compares the __DRIdrwablePrivate pStamp and lastStamp values. If + * the values are different that means we have to update the clipping + * info. + */ +void +__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) +{ + __DRIscreenPrivate *psp; + __DRIcontextPrivate *pcp = pdp->driContextPriv; + + if (!pcp || (pdp != pcp->driDrawablePriv)) { + /* ERROR!!! */ + return; + } + + psp = pdp->driScreenPriv; + if (!psp) { + /* ERROR!!! */ + return; + } + + if (pdp->pClipRects) { + _mesa_free(pdp->pClipRects); + } + + if (pdp->pBackClipRects) { + _mesa_free(pdp->pBackClipRects); + } + + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + + if (!__driFindDrawable(psp->drawHash, pdp->draw) || + ! (*dri_interface->getDrawableInfo)(pdp->display, pdp->screen, pdp->draw, + &pdp->index, &pdp->lastStamp, + &pdp->x, &pdp->y, &pdp->w, &pdp->h, + &pdp->numClipRects, &pdp->pClipRects, + &pdp->backX, + &pdp->backY, + &pdp->numBackClipRects, + &pdp->pBackClipRects )) { + /* Error -- eg the window may have been destroyed. Keep going + * with no cliprects. + */ + pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */ + pdp->numClipRects = 0; + pdp->pClipRects = NULL; + pdp->numBackClipRects = 0; + pdp->pBackClipRects = NULL; + } + else + pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp); + + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + +} + +/*@}*/ + +/*****************************************************************/ +/** \name GLX callbacks */ +/*****************************************************************/ +/*@{*/ + +/** + * Swap buffers. + * + * \param dpy the display handle. + * \param drawablePrivate opaque pointer to the per-drawable private info. + * + * \internal + * This function calls __DRIdrawablePrivate::swapBuffers. + * + * Is called directly from glXSwapBuffers(). + */ +static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; + dPriv->swapBuffers(dPriv); + (void) dpy; +} + +/** + * Called directly from a number of higher-level GLX functions. + */ +static int driGetMSC( void *screenPrivate, int64_t *msc ) +{ + __DRIscreenPrivate *sPriv = (__DRIscreenPrivate *) screenPrivate; + + return sPriv->DriverAPI.GetMSC( sPriv, msc ); +} + +/** + * Called directly from a number of higher-level GLX functions. + */ +static int driGetSBC( __DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; + __DRIswapInfo sInfo; + int status; + + + status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo ); + *sbc = sInfo.swap_count; + + return status; +} + +static int driWaitForSBC( __DRInativeDisplay * dpy, void *drawablePriv, + int64_t target_sbc, + int64_t * msc, int64_t * sbc ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv; + + return dPriv->driScreenPriv->DriverAPI.WaitForSBC( dPriv, target_sbc, + msc, sbc ); +} + +static int driWaitForMSC( __DRInativeDisplay * dpy, void *drawablePriv, + int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv; + __DRIswapInfo sInfo; + int status; + + + status = dPriv->driScreenPriv->DriverAPI.WaitForMSC( dPriv, target_msc, + divisor, remainder, + msc ); + + /* GetSwapInfo() may not be provided by the driver if GLX_SGI_video_sync + * is supported but GLX_OML_sync_control is not. Therefore, don't return + * an error value if GetSwapInfo() is not implemented. + */ + if ( status == 0 + && dPriv->driScreenPriv->DriverAPI.GetSwapInfo ) { + status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo ); + *sbc = sInfo.swap_count; + } + + return status; +} + +static int64_t driSwapBuffersMSC( __DRInativeDisplay * dpy, void *drawablePriv, + int64_t target_msc, + int64_t divisor, int64_t remainder ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv; + + return dPriv->driScreenPriv->DriverAPI.SwapBuffersMSC( dPriv, target_msc, + divisor, + remainder ); +} + + +/** + * This is called via __DRIscreenRec's createNewDrawable pointer. + */ +static void *driCreateNewDrawable(__DRInativeDisplay *dpy, + const __GLcontextModes *modes, + __DRIid draw, + __DRIdrawable *pdraw, + int renderType, + const int *attrs) +{ + __DRIscreen * const pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen); + __DRIscreenPrivate *psp; + __DRIdrawablePrivate *pdp; + + + pdraw->private = NULL; + + /* Since pbuffers are not yet supported, no drawable attributes are + * supported either. + */ + (void) attrs; + + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return NULL; + } + + pdp = (__DRIdrawablePrivate *)_mesa_malloc(sizeof(__DRIdrawablePrivate)); + if (!pdp) { + return NULL; + } + + if (!(*dri_interface->createDrawable)(dpy, modes->screen, draw, &pdp->hHWDrawable)) { + _mesa_free(pdp); + return NULL; + } + + pdp->draw = draw; + pdp->pdraw = pdraw; + pdp->refcount = 0; + pdp->pStamp = NULL; + pdp->lastStamp = 0; + pdp->index = 0; + pdp->x = 0; + pdp->y = 0; + pdp->w = 0; + pdp->h = 0; + pdp->numClipRects = 0; + pdp->numBackClipRects = 0; + pdp->pClipRects = NULL; + pdp->pBackClipRects = NULL; + pdp->display = dpy; + pdp->screen = modes->screen; + + psp = (__DRIscreenPrivate *)pDRIScreen->private; + pdp->driScreenPriv = psp; + pdp->driContextPriv = &psp->dummyContextPriv; + + if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, modes, + renderType == GLX_PIXMAP_BIT)) { + (void)(*dri_interface->destroyDrawable)(dpy, modes->screen, pdp->draw); + _mesa_free(pdp); + return NULL; + } + + pdraw->private = pdp; + pdraw->destroyDrawable = driDestroyDrawable; + pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */ + + pdraw->getSBC = driGetSBC; + pdraw->waitForSBC = driWaitForSBC; + pdraw->waitForMSC = driWaitForMSC; + pdraw->swapBuffersMSC = driSwapBuffersMSC; + pdraw->frameTracking = NULL; + pdraw->queryFrameTracking = driQueryFrameTracking; + + /* This special default value is replaced with the configured + * default value when the drawable is first bound to a direct + * rendering context. + */ + pdraw->swap_interval = (unsigned)-1; + + pdp->swapBuffers = psp->DriverAPI.SwapBuffers; + + /* Add pdraw to drawable list */ + if (!__driAddDrawable(psp->drawHash, pdraw)) { + /* ERROR!!! */ + (*pdraw->destroyDrawable)(dpy, pdp); + _mesa_free(pdp); + pdp = NULL; + pdraw->private = NULL; + } + + return (void *) pdp; +} + +static __DRIdrawable *driGetDrawable(__DRInativeDisplay *dpy, __DRIid draw, + void *screenPrivate) +{ + __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; + + /* + ** Make sure this routine returns NULL if the drawable is not bound + ** to a direct rendering context! + */ + return __driFindDrawable(psp->drawHash, draw); +} + +static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate) +{ + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawablePrivate; + __DRIscreenPrivate *psp = pdp->driScreenPriv; + int scrn = psp->myNum; + + if (pdp) { + (*psp->DriverAPI.DestroyBuffer)(pdp); + if ((*dri_interface->windowExists)(dpy, pdp->draw)) + (void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw); + drmHashDelete(psp->drawHash, pdp->draw); + if (pdp->pClipRects) { + _mesa_free(pdp->pClipRects); + pdp->pClipRects = NULL; + } + if (pdp->pBackClipRects) { + _mesa_free(pdp->pBackClipRects); + pdp->pBackClipRects = NULL; + } + _mesa_free(pdp); + } +} + +/*@}*/ + + +/*****************************************************************/ +/** \name Context handling functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Destroy the per-context private information. + * + * \param dpy the display handle. + * \param scrn the screen number. + * \param contextPrivate opaque pointer to the per-drawable private info. + * + * \internal + * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls + * drmDestroyContext(), and finally frees \p contextPrivate. + */ +static void driDestroyContext(__DRInativeDisplay *dpy, int scrn, void *contextPrivate) +{ + __DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate; + + if (pcp) { + (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); + __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash); + (void) (*dri_interface->destroyContext)(dpy, scrn, pcp->contextID); + _mesa_free(pcp); + } +} + + +/** + * Create the per-drawable private driver information. + * + * \param dpy The display handle. + * \param modes Mode used to create the new context. + * \param render_type Type of rendering target. \c GLX_RGBA is the only + * type likely to ever be supported for direct-rendering. + * \param sharedPrivate The shared context dependent methods or \c NULL if + * non-existent. + * \param pctx DRI context to receive the context dependent methods. + * + * \returns An opaque pointer to the per-context private information on + * success, or \c NULL on failure. + * + * \internal + * This function allocates and fills a __DRIcontextPrivateRec structure. It + * performs some device independent initialization and passes all the + * relevent information to __DriverAPIRec::CreateContext to create the + * context. + * + */ +static void * +driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, + int render_type, void *sharedPrivate, __DRIcontext *pctx) +{ + __DRIscreen *pDRIScreen; + __DRIcontextPrivate *pcp; + __DRIcontextPrivate *pshare = (__DRIcontextPrivate *) sharedPrivate; + __DRIscreenPrivate *psp; + void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL; + + pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + /* ERROR!!! */ + return NULL; + } + + psp = (__DRIscreenPrivate *)pDRIScreen->private; + + pcp = (__DRIcontextPrivate *)_mesa_malloc(sizeof(__DRIcontextPrivate)); + if (!pcp) { + return NULL; + } + + if (! (*dri_interface->createContext)(dpy, modes->screen, modes->fbconfigID, + &pcp->contextID, &pcp->hHWContext)) { + _mesa_free(pcp); + return NULL; + } + + pcp->display = dpy; + pcp->driScreenPriv = psp; + pcp->driDrawablePriv = NULL; + + /* When the first context is created for a screen, initialize a "dummy" + * context. + */ + + if (!psp->dummyContextPriv.driScreenPriv) { + psp->dummyContextPriv.contextID = 0; + psp->dummyContextPriv.hHWContext = psp->pSAREA->dummy_context; + psp->dummyContextPriv.driScreenPriv = psp; + psp->dummyContextPriv.driDrawablePriv = NULL; + psp->dummyContextPriv.driverPrivate = NULL; + /* No other fields should be used! */ + } + + pctx->destroyContext = driDestroyContext; + pctx->bindContext = driBindContext; + pctx->unbindContext = driUnbindContext; + + if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) { + (void) (*dri_interface->destroyContext)(dpy, modes->screen, + pcp->contextID); + _mesa_free(pcp); + return NULL; + } + + __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash); + + return pcp; +} +/*@}*/ + + +/*****************************************************************/ +/** \name Screen handling functions */ +/*****************************************************************/ +/*@{*/ + +/** + * Destroy the per-screen private information. + * + * \param dpy the display handle. + * \param scrn the screen number. + * \param screenPrivate opaque pointer to the per-screen private information. + * + * \internal + * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls + * drmClose(), and finally frees \p screenPrivate. + */ +static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPrivate) +{ + __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; + + if (psp) { + /* No interaction with the X-server is possible at this point. This + * routine is called after XCloseDisplay, so there is no protocol + * stream open to the X-server anymore. + */ + + if (psp->DriverAPI.DestroyScreen) + (*psp->DriverAPI.DestroyScreen)(psp); + + (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX); + (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize); + _mesa_free(psp->pDevPriv); + (void)drmClose(psp->fd); + if ( psp->modes != NULL ) { + (*dri_interface->destroyContextModes)( psp->modes ); + } + _mesa_free(psp); + } +} + + +/** + * Utility function used to create a new driver-private screen structure. + * + * \param dpy Display pointer + * \param scrn Index of the screen + * \param psc DRI screen data (not driver private) + * \param modes Linked list of known display modes. This list is, at a + * minimum, a list of modes based on the current display mode. + * These roughly match the set of available X11 visuals, but it + * need not be limited to X11! The calling libGL should create + * a list that will inform the driver of the current display + * mode (i.e., color buffer depth, depth buffer depth, etc.). + * \param ddx_version Version of the 2D DDX. This may not be meaningful for + * all drivers. + * \param dri_version Version of the "server-side" DRI. + * \param drm_version Version of the kernel DRM. + * \param frame_buffer Data describing the location and layout of the + * framebuffer. + * \param pSAREA Pointer the the SAREA. + * \param fd Device handle for the DRM. + * \param internal_api_version Version of the internal interface between the + * driver and libGL. + * \param driverAPI Driver API functions used by other routines in dri_util.c. + * + * \note + * There is no need to check the minimum API version in this function. Since + * the \c __driCreateNewScreen function is versioned, it is impossible for a + * loader that is too old to even load this driver. + */ +__DRIscreenPrivate * +__driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, + __GLcontextModes * modes, + const __DRIversion * ddx_version, + const __DRIversion * dri_version, + const __DRIversion * drm_version, + const __DRIframebuffer * frame_buffer, + drm_sarea_t *pSAREA, + int fd, + int internal_api_version, + const struct __DriverAPIRec *driverAPI) +{ + __DRIscreenPrivate *psp; + + + api_ver = internal_api_version; + + psp = (__DRIscreenPrivate *)_mesa_malloc(sizeof(__DRIscreenPrivate)); + if (!psp) { + return NULL; + } + + /* Create the hash table */ + psp->drawHash = drmHashCreate(); + if ( psp->drawHash == NULL ) { + _mesa_free( psp ); + return NULL; + } + + psp->display = dpy; + psp->myNum = scrn; + psp->psc = psc; + psp->modes = modes; + + /* + ** NOT_DONE: This is used by the X server to detect when the client + ** has died while holding the drawable lock. The client sets the + ** drawable lock to this value. + */ + psp->drawLockID = 1; + + psp->drmMajor = drm_version->major; + psp->drmMinor = drm_version->minor; + psp->drmPatch = drm_version->patch; + psp->ddxMajor = ddx_version->major; + psp->ddxMinor = ddx_version->minor; + psp->ddxPatch = ddx_version->patch; + psp->driMajor = dri_version->major; + psp->driMinor = dri_version->minor; + psp->driPatch = dri_version->patch; + + /* install driver's callback functions */ + memcpy( &psp->DriverAPI, driverAPI, sizeof(struct __DriverAPIRec) ); + + psp->pSAREA = pSAREA; + + psp->pFB = frame_buffer->base; + psp->fbSize = frame_buffer->size; + psp->fbStride = frame_buffer->stride; + psp->fbWidth = frame_buffer->width; + psp->fbHeight = frame_buffer->height; + psp->devPrivSize = frame_buffer->dev_priv_size; + psp->pDevPriv = frame_buffer->dev_priv; + psp->fbBPP = psp->fbStride * 8 / frame_buffer->width; + + psp->fd = fd; + + /* + ** Do not init dummy context here; actual initialization will be + ** done when the first DRI context is created. Init screen priv ptr + ** to NULL to let CreateContext routine that it needs to be inited. + */ + psp->dummyContextPriv.driScreenPriv = NULL; + + psc->destroyScreen = driDestroyScreen; + psc->createNewDrawable = driCreateNewDrawable; + psc->getDrawable = driGetDrawable; + psc->getMSC = driGetMSC; + psc->createNewContext = driCreateNewContext; + + if ( (psp->DriverAPI.InitDriver != NULL) + && !(*psp->DriverAPI.InitDriver)(psp) ) { + _mesa_free( psp ); + return NULL; + } + + + return psp; +} + + +/** + * Compare the current GLX API version with a driver supplied required version. + * + * The minimum required version is compared with the API version exported by + * the \c __glXGetInternalVersion function (in libGL.so). + * + * \param required_version Minimum required internal GLX API version. + * \return A tri-value return, as from strcmp is returned. A value less + * than, equal to, or greater than zero will be returned if the + * internal GLX API version is less than, equal to, or greater + * than \c required_version. + * + * \sa __glXGetInternalVersion(). + */ +int driCompareGLXAPIVersion( GLint required_version ) +{ + if ( api_ver > required_version ) { + return 1; + } + else if ( api_ver == required_version ) { + return 0; + } + + return -1; +} + + +static int +driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv, + int64_t * sbc, int64_t * missedFrames, + float * lastMissedUsage, float * usage ) +{ + __DRIswapInfo sInfo; + int status; + int64_t ust; + __DRIdrawablePrivate * dpriv = (__DRIdrawablePrivate *) priv; + + + status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo ); + if ( status == 0 ) { + *sbc = sInfo.swap_count; + *missedFrames = sInfo.swap_missed_count; + *lastMissedUsage = sInfo.swap_missed_usage; + + (*dri_interface->getUST)( & ust ); + *usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust ); + } + + return status; +} + + +/** + * Calculate amount of swap interval used between GLX buffer swaps. + * + * The usage value, on the range [0,max], is the fraction of total swap + * interval time used between GLX buffer swaps is calculated. + * + * \f$p = t_d / (i * t_r)\f$ + * + * Where \f$t_d\f$ is the time since the last GLX buffer swap, \f$i\f$ is the + * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time + * required for a single vertical refresh period (as returned by \c + * glXGetMscRateOML). + * + * See the documentation for the GLX_MESA_swap_frame_usage extension for more + * details. + * + * \param dPriv Pointer to the private drawable structure. + * \return If less than a single swap interval time period was required + * between GLX buffer swaps, a number greater than 0 and less than + * 1.0 is returned. If exactly one swap interval time period is + * required, 1.0 is returned, and if more than one is required then + * a number greater than 1.0 will be returned. + * + * \sa glXSwapIntervalSGI glXGetMscRateOML + * + * \todo Instead of caching the \c glXGetMscRateOML function pointer, would it + * be possible to cache the sync rate? + */ +float +driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, + int64_t current_ust ) +{ + int32_t n; + int32_t d; + int interval; + float usage = 1.0; + + + if ( (*dri_interface->getMSCRate)( dPriv->display, dPriv->draw, &n, &d ) ) { + interval = (dPriv->pdraw->swap_interval != 0) + ? dPriv->pdraw->swap_interval : 1; + + + /* We want to calculate + * (current_UST - last_swap_UST) / (interval * us_per_refresh). We get + * current_UST by calling __glXGetUST. last_swap_UST is stored in + * dPriv->swap_ust. interval has already been calculated. + * + * The only tricky part is us_per_refresh. us_per_refresh is + * 1000000 / MSC_rate. We know the MSC_rate is n / d. We can flip it + * around and say us_per_refresh = 1000000 * d / n. Since this goes in + * the denominator of the final calculation, we calculate + * (interval * 1000000 * d) and move n into the numerator. + */ + + usage = (current_ust - last_swap_ust); + usage *= n; + usage /= (interval * d); + usage /= 1000000.0; + } + + return usage; +} + +/*@}*/ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.h new file mode 100644 index 000000000..b9b38f39c --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.h @@ -0,0 +1,555 @@ +/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.1 2002/02/22 21:32:52 dawes Exp $ */ +/** + * \file dri_util.h + * DRI utility functions definitions. + * + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. + * + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. + * + * \sa dri_util.c. + * + * \author Kevin E. Martin + * \author Brian Paul + */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef _DRI_UTIL_H_ +#define _DRI_UTIL_H_ + +#define CAPI /* XXX this should be globally defined somewhere */ + +#include +#include "drm.h" +#include "drm_sarea.h" +#include "xf86drm.h" +#include "GL/internal/glcore.h" +#include "GL/internal/dri_interface.h" + +#define GLX_BAD_CONTEXT 5 + +typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate; +typedef struct __DRIscreenPrivateRec __DRIscreenPrivate; +typedef struct __DRIcontextPrivateRec __DRIcontextPrivate; +typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate; +typedef struct __DRIswapInfoRec __DRIswapInfo; +typedef struct __DRIutilversionRec2 __DRIutilversion2; + + +/** + * Used by DRI_VALIDATE_DRAWABLE_INFO + */ +#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \ + do { \ + if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \ + __driUtilUpdateDrawableInfo(pDrawPriv); \ + } \ + } while (0) + + +/** + * Utility macro to validate the drawable information. + * + * See __DRIdrawablePrivate::pStamp and __DRIdrawablePrivate::lastStamp. + */ +#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \ +do { \ + while (*(pdp->pStamp) != pdp->lastStamp) { \ + DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, \ + pdp->driContextPriv->hHWContext); \ + \ + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ + DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ + \ + DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, \ + pdp->driContextPriv->hHWContext); \ + } \ +} while (0) + + +/** + * Driver callback functions. + * + * Each DRI driver must have one of these structures with all the pointers set + * to appropriate functions within the driver. + * + * When glXCreateContext() is called, for example, it'll call a helper function + * dri_util.c which in turn will jump through the \a CreateContext pointer in + * this structure. + */ +struct __DriverAPIRec { + /** + * Driver initialization callback + */ + GLboolean (*InitDriver)(__DRIscreenPrivate *driScrnPriv); + + /** + * Screen destruction callback + */ + void (*DestroyScreen)(__DRIscreenPrivate *driScrnPriv); + + /** + * Context creation callback + */ + GLboolean (*CreateContext)(const __GLcontextModes *glVis, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate); + + /** + * Context destruction callback + */ + void (*DestroyContext)(__DRIcontextPrivate *driContextPriv); + + /** + * Buffer (drawable) creation callback + */ + GLboolean (*CreateBuffer)(__DRIscreenPrivate *driScrnPriv, + __DRIdrawablePrivate *driDrawPriv, + const __GLcontextModes *glVis, + GLboolean pixmapBuffer); + + /** + * Buffer (drawable) destruction callback + */ + void (*DestroyBuffer)(__DRIdrawablePrivate *driDrawPriv); + + /** + * Buffer swapping callback + */ + void (*SwapBuffers)(__DRIdrawablePrivate *driDrawPriv); + + /** + * Context activation callback + */ + GLboolean (*MakeCurrent)(__DRIcontextPrivate *driContextPriv, + __DRIdrawablePrivate *driDrawPriv, + __DRIdrawablePrivate *driReadPriv); + + /** + * Context unbinding callback + */ + GLboolean (*UnbindContext)(__DRIcontextPrivate *driContextPriv); + + /** + * Retrieves statistics about buffer swap operations. Required if + * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported. + */ + int (*GetSwapInfo)( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); + + + /** + * Required if GLX_SGI_video_sync or GLX_OML_sync_control is + * supported. + */ + int (*GetMSC)( __DRIscreenPrivate * priv, int64_t * count ); + + /** + * These are required if GLX_OML_sync_control is supported. + */ + /*@{*/ + int (*WaitForMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t * msc ); + int (*WaitForSBC)( __DRIdrawablePrivate *priv, int64_t target_sbc, + int64_t * msc, int64_t * sbc ); + + int64_t (*SwapBuffersMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, + int64_t divisor, int64_t remainder ); + /*@}*/ +}; + + +struct __DRIswapInfoRec { + /** + * Number of swapBuffers operations that have been *completed*. + */ + u_int64_t swap_count; + + /** + * Unadjusted system time of the last buffer swap. This is the time + * when the swap completed, not the time when swapBuffers was called. + */ + int64_t swap_ust; + + /** + * Number of swap operations that occurred after the swap deadline. That + * is if a swap happens more than swap_interval frames after the previous + * swap, it has missed its deadline. If swap_interval is 0, then the + * swap deadline is 1 frame after the previous swap. + */ + u_int64_t swap_missed_count; + + /** + * Amount of time used by the last swap that missed its deadline. This + * is calculated as (__glXGetUST() - swap_ust) / (swap_interval * + * time_for_single_vrefresh)). If the actual value of swap_interval is + * 0, then 1 is used instead. If swap_missed_count is non-zero, this + * should be greater-than 1.0. + */ + float swap_missed_usage; +}; + + +/** + * Per-drawable private DRI driver information. + */ +struct __DRIdrawablePrivateRec { + /** + * Kernel drawable handle + */ + drm_drawable_t hHWDrawable; + + /** + * Driver's private drawable information. + * + * This structure is opaque. + */ + void *driverPrivate; + + /** + * X's drawable ID associated with this private drawable. + */ + __DRIid draw; + __DRIdrawable *pdraw; + + /** + * Reference count for number of context's currently bound to this + * drawable. + * + * Once it reaches zero, the drawable can be destroyed. + * + * \note This behavior will change with GLX 1.3. + */ + int refcount; + + /** + * Index of this drawable information in the SAREA. + */ + unsigned int index; + + /** + * Pointer to the "drawable has changed ID" stamp in the SAREA. + */ + unsigned int *pStamp; + + /** + * Last value of the stamp. + * + * If this differs from the value stored at __DRIdrawablePrivate::pStamp, + * then the drawable information has been modified by the X server, and the + * drawable information (below) should be retrieved from the X server. + */ + unsigned int lastStamp; + + /** + * \name Drawable + * + * Drawable information used in software fallbacks. + */ + /*@{*/ + int x; + int y; + int w; + int h; + int numClipRects; + drm_clip_rect_t *pClipRects; + /*@}*/ + + /** + * \name Back and depthbuffer + * + * Information about the back and depthbuffer where different from above. + */ + /*@{*/ + int backX; + int backY; + int backClipRectType; + int numBackClipRects; + drm_clip_rect_t *pBackClipRects; + /*@}*/ + + /** + * Pointer to context to which this drawable is currently bound. + */ + __DRIcontextPrivate *driContextPriv; + + /** + * Pointer to screen on which this drawable was created. + */ + __DRIscreenPrivate *driScreenPriv; + + /** + * \name Display and screen information. + * + * Basically just need these for when the locking code needs to call + * \c __driUtilUpdateDrawableInfo. + */ + /*@{*/ + __DRInativeDisplay *display; + int screen; + /*@}*/ + + /** + * Called via glXSwapBuffers(). + */ + void (*swapBuffers)( __DRIdrawablePrivate *dPriv ); +}; + +/** + * Per-context private driver information. + */ +struct __DRIcontextPrivateRec { + /** + * Kernel context handle used to access the device lock. + */ + __DRIid contextID; + + /** + * Kernel context handle used to access the device lock. + */ + drm_context_t hHWContext; + + /** + * Device driver's private context data. This structure is opaque. + */ + void *driverPrivate; + + /** + * This context's display pointer. + */ + __DRInativeDisplay *display; + + /** + * Pointer to drawable currently bound to this context. + */ + __DRIdrawablePrivate *driDrawablePriv; + + /** + * Pointer to screen on which this context was created. + */ + __DRIscreenPrivate *driScreenPriv; +}; + +/** + * Per-screen private driver information. + */ +struct __DRIscreenPrivateRec { + /** + * Display for this screen + */ + __DRInativeDisplay *display; + + /** + * Current screen's number + */ + int myNum; + + /** + * Callback functions into the hardware-specific DRI driver code. + */ + struct __DriverAPIRec DriverAPI; + + /** + * \name DDX version + * DDX / 2D driver version information. + * \todo Replace these fields with a \c __DRIversionRec. + */ + /*@{*/ + int ddxMajor; + int ddxMinor; + int ddxPatch; + /*@}*/ + + /** + * \name DRI version + * DRI X extension version information. + * \todo Replace these fields with a \c __DRIversionRec. + */ + /*@{*/ + int driMajor; + int driMinor; + int driPatch; + /*@}*/ + + /** + * \name DRM version + * DRM (kernel module) version information. + * \todo Replace these fields with a \c __DRIversionRec. + */ + /*@{*/ + int drmMajor; + int drmMinor; + int drmPatch; + /*@}*/ + + /** + * ID used when the client sets the drawable lock. + * + * The X server uses this value to detect if the client has died while + * holding the drawable lock. + */ + int drawLockID; + + /** + * File descriptor returned when the kernel device driver is opened. + * + * Used to: + * - authenticate client to kernel + * - map the frame buffer, SAREA, etc. + * - close the kernel device driver + */ + int fd; + + /** + * SAREA pointer + * + * Used to access: + * - the device lock + * - the device-independent per-drawable and per-context(?) information + */ + drm_sarea_t *pSAREA; + + /** + * \name Direct frame buffer access information + * Used for software fallbacks. + */ + /*@{*/ + unsigned char *pFB; + int fbSize; + int fbOrigin; + int fbStride; + int fbWidth; + int fbHeight; + int fbBPP; + /*@}*/ + + /** + * \name Device-dependent private information (stored in the SAREA). + * + * This data is accessed by the client driver only. + */ + /*@{*/ + void *pDevPriv; + int devPrivSize; + /*@}*/ + + /** + * Dummy context to which drawables are bound when not bound to any + * other context. + * + * A dummy hHWContext is created for this context, and is used by the GL + * core when a hardware lock is required but the drawable is not currently + * bound (e.g., potentially during a SwapBuffers request). The dummy + * context is created when the first "real" context is created on this + * screen. + */ + __DRIcontextPrivate dummyContextPriv; + + /** + * Hash table to hold the drawable information for this screen. + */ + void *drawHash; + + /** + * Device-dependent private information (not stored in the SAREA). + * + * This pointer is never touched by the DRI layer. + */ + void *private; + + /** + * GLX visuals / FBConfigs for this screen. These are stored as a + * linked list. + * + * \note + * This field is \b only used in conjunction with the old interfaces. If + * the new interfaces are used, this field will be set to \c NULL and will + * not be dereferenced. + */ + __GLcontextModes *modes; + + /** + * Pointer back to the \c __DRIscreen that contains this structure. + */ + + __DRIscreen *psc; +}; + + +/** + * Used to store a version which includes a major range instead of a single + * major version number. + */ +struct __DRIutilversionRec2 { + int major_min; /** min allowed Major version number. */ + int major_max; /** max allowed Major version number. */ + int minor; /**< Minor version number. */ + int patch; /**< Patch-level. */ +}; + + +extern void +__driUtilMessage(const char *f, ...); + + +extern void +__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp); + + +extern __DRIscreenPrivate * __driUtilCreateNewScreen( __DRInativeDisplay *dpy, + int scrn, __DRIscreen *psc, __GLcontextModes * modes, + const __DRIversion * ddx_version, const __DRIversion * dri_version, + const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, + drm_sarea_t *pSAREA, int fd, int internal_api_version, + const struct __DriverAPIRec *driverAPI ); + +/* Test the version of the internal GLX API. Returns a value like strcmp. */ +extern int +driCompareGLXAPIVersion( GLint required_version ); + +extern float +driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, + int64_t last_swap_ust, int64_t current_ust ); + +/** + * Pointer to the \c __DRIinterfaceMethods passed to the driver by the loader. + * + * This pointer is set in the driver's \c __driCreateNewScreen function and + * is defined in dri_util.c. + */ +extern const __DRIinterfaceMethods * dri_interface; + +#endif /* _DRI_UTIL_H_ */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.c new file mode 100644 index 000000000..44826958d --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -0,0 +1,98 @@ + +#include "mtypes.h" +#include "drirenderbuffer.h" +#include "renderbuffer.h" +#include "imports.h" + + +/** + * This will get called when a window is resized. + * Just update width, height and internal format fields for now. + * There's usually no memory allocation above because the present + * DRI drivers use statically-allocated full-screen buffers. + */ +static GLboolean +driRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + rb->Width = width; + rb->Height = height; + rb->InternalFormat = internalFormat; + return GL_TRUE; +} + + +/** + * Allocate a new driRenderbuffer object. + * Individual drivers are free to implement different versions of + * this function. + * \param format Either GL_RGBA, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, + * GL_DEPTH_COMPONENT32, or GL_STENCIL_INDEX8_EXT (for now). + * \param cpp chars or bytes per pixel + * \param offset start of buffer with respect to framebuffer address + * \param pitch pixels per row + */ +driRenderbuffer * +driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch) +{ + driRenderbuffer *drb; + + assert(format == GL_RGBA || + format == GL_DEPTH_COMPONENT16 || + format == GL_DEPTH_COMPONENT24 || + format == GL_DEPTH_COMPONENT32 || + format == GL_STENCIL_INDEX8_EXT); + + assert(cpp > 0); + assert(pitch > 0); + + drb = _mesa_calloc(sizeof(driRenderbuffer)); + if (drb) { + const GLuint name = 0; + + _mesa_init_renderbuffer(&drb->Base, name); + + /* 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) { + /* Color */ + drb->Base._BaseFormat = GL_RGBA; + drb->Base.DataType = GL_UNSIGNED_BYTE; + } + 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; + } + else if (format == GL_DEPTH_COMPONENT24) { + /* Depth */ + drb->Base._BaseFormat = GL_DEPTH_COMPONENT; + /* we always Get/Put 32-bit Z values */ + drb->Base.DataType = GL_UNSIGNED_INT; + } + else { + /* Stencil */ + ASSERT(format == GL_STENCIL_INDEX8); + drb->Base._BaseFormat = GL_STENCIL_INDEX; + drb->Base.DataType = GL_UNSIGNED_BYTE; + } + + /* XXX if we were allocating a user-created renderbuffer, we'd have + * to fill in the ComponentSizes[] array too. + */ + + drb->Base.AllocStorage = driRenderbufferStorage; + /* using default Delete function */ + + + /* DRI renderbuffer-specific fields: */ + drb->offset = offset; + drb->pitch = pitch; + drb->cpp = cpp; + } + return drb; +} diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.h new file mode 100644 index 000000000..627f1d41d --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -0,0 +1,39 @@ + +/** + * A driRenderbuffer is dervied from gl_renderbuffer. + * It describes a color buffer (front or back), a depth buffer, or stencil + * buffer etc. + * Specific to DRI drivers are the offset and pitch fields. + */ + + +#ifndef DRIRENDERBUFFER_H +#define DRIRENDERBUFFER_H + +#include "mtypes.h" + +typedef struct { + struct gl_renderbuffer Base; + + /* Chars or bytes per pixel. If Z and Stencil are stored together this + * will typically be 32 whether this a depth or stencil renderbuffer. + */ + GLint cpp; + + /* Buffer position and pitch (row stride). Recall that for today's DRI + * drivers, we have statically allocated color/depth/stencil buffers. + * So this information describes the whole screen, not just a window. + * To address pixels in a window, we need to know the window's position + * and size with respect to the screen. + */ + GLint offset; /* in bytes */ + GLint pitch; /* in pixels */ + +} driRenderbuffer; + + +driRenderbuffer * +driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch); + + +#endif /* DRIRENDERBUFFER_H */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/extension_helper.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/extension_helper.h new file mode 100644 index 000000000..4a6606819 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/extension_helper.h @@ -0,0 +1,5887 @@ +/* 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 "dispatch.h" + +#ifndef NULL +# define NULL 0 +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char UniformMatrix3fvARB_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix3fvARB\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char ProgramParameter4fNV_names[] = + "iiffff\0" /* Parameter signature */ + "glProgramParameter4fNV\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_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_NV_vertex_program) +static const char VertexAttrib4ubvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4ubvNV\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) +static const char GetColorTableParameterfvSGI_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameterfvSGI\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_EXT_paletted_texture) +static const char GetColorTableParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_blend_equation_separate) || defined(need_GL_ATI_blend_equation_separate) +static const char BlendEquationSeparateEXT_names[] = + "ii\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char ProgramEnvParameter4dvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramEnvParameter4dvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2fARB_names[] = + "iff\0" /* Parameter signature */ + "glVertexAttrib2fARB\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetHistogramParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetHistogramParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3fARB_names[] = + "ifff\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char Uniform2fARB_names[] = + "iff\0" /* Parameter signature */ + "glUniform2fARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1svARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char Uniform2ivARB_names[] = + "iip\0" /* Parameter signature */ + "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_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_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_ARB_shader_objects) +static const char UniformMatrix4fvARB_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix4fvARB\0" + ""; +#endif + +#if defined(need_GL_SGIX_instruments) +static const char ReadInstrumentsSGIX_names[] = + "i\0" /* Parameter signature */ + "glReadInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char Color4ubVertex3fvSUN_names[] = + "pp\0" /* Parameter signature */ + "glColor4ubVertex3fvSUN\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_ARB_vertex_program) +static const char VertexAttrib4NusvARB_names[] = + "ip\0" /* Parameter signature */ + "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_ATI_fragment_shader) +static const char ColorFragmentOp3ATI_names[] = + "iiiiiiiiiiiii\0" /* Parameter signature */ + "glColorFragmentOp3ATI\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_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_NV_vertex_program) +static const char ProgramParameter4dvNV_names[] = + "iip\0" /* Parameter signature */ + "glProgramParameter4dvNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char DisableVertexAttribArrayARB_names[] = + "i\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib1fARB_names[] = + "if\0" /* Parameter signature */ + "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_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_ARB_vertex_program) +static const char VertexAttrib4NbvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4NbvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_shader) +static const char GetActiveAttribARB_names[] = + "iiipppp\0" /* Parameter signature */ + "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_SUN_vertex) +static const char TexCoord2fColor4fNormal3fVertex3fSUN_names[] = + "ffffffffffff\0" /* Parameter signature */ + "glTexCoord2fColor4fNormal3fVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxEXT_names[] = + "iiiip\0" /* Parameter signature */ + "glGetMinmaxEXT\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_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_ARB_shader_objects) +static const char Uniform3iARB_names[] = + "iiii\0" /* Parameter signature */ + "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_EXT_coordinate_frame) +static const char Binormal3fEXT_names[] = + "fff\0" /* Parameter signature */ + "glBinormal3fEXT\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_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_EXT_framebuffer_object) +static const char GenerateMipmapEXT_names[] = + "i\0" /* Parameter signature */ + "glGenerateMipmapEXT\0" + ""; +#endif + +#if defined(need_GL_NV_vertex_program) +static const char ProgramParameter4dNV_names[] = + "iidddd\0" /* Parameter signature */ + "glProgramParameter4dNV\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_ARB_vertex_program) +static const char VertexAttrib1sARB_names[] = + "ii\0" /* Parameter signature */ + "glVertexAttrib1sARB\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_EXT_histogram) +static const char GetHistogramParameterfvEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetHistogramParameterfvEXT\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_ARB_draw_buffers) || defined(need_GL_ATI_draw_buffers) +static const char DrawBuffersARB_names[] = + "ip\0" /* Parameter signature */ + "glDrawBuffersARB\0" + "glDrawBuffersATI\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char IsRenderbufferEXT_names[] = + "i\0" /* Parameter signature */ + "glIsRenderbufferEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) +static const char StencilOpSeparate_names[] = + "iiii\0" /* Parameter signature */ + "glStencilOpSeparate\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_EXT_histogram) +static const char GetHistogramEXT_names[] = + "iiiip\0" /* Parameter signature */ + "glGetHistogramEXT\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_EXT_paletted_texture) +static const char GetColorTableEXT_names[] = + "iiip\0" /* Parameter signature */ + "glGetColorTableEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char RenderbufferStorageEXT_names[] = + "iiii\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char UniformMatrix2fvARB_names[] = + "iiip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib3dvARB_names[] = + "ip\0" /* Parameter signature */ + "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) +static const char ProgramEnvParameter4fvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramEnvParameter4fvARB\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_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_ARB_shader_objects) +static const char Uniform3fvARB_names[] = + "iip\0" /* Parameter signature */ + "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_EXT_framebuffer_object) +static const char CheckFramebufferStatusEXT_names[] = + "i\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char GetVertexAttribivARB_names[] = + "iip\0" /* Parameter signature */ + "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_SUN_vertex) +static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glReplacementCodeuiNormal3fVertex3fvSUN\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_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_ARB_vertex_program) +static const char VertexAttrib4ivARB_names[] = + "ip\0" /* Parameter signature */ + "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_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_EXT_framebuffer_object) +static const char DeleteRenderbuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "glDeleteRenderbuffersEXT\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_ARB_vertex_program) +static const char VertexAttrib4bvARB_names[] = + "ip\0" /* Parameter signature */ + "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_EXT_convolution) +static const char GetSeparableFilterEXT_names[] = + "iiippp\0" /* Parameter signature */ + "glGetSeparableFilterEXT\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_EXT_framebuffer_object) +static const char FramebufferTexture3DEXT_names[] = + "iiiiii\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib3dARB_names[] = + "iddd\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib4fARB_names[] = + "iffff\0" /* Parameter signature */ + "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_SGIX_list_priority) +static const char GetListParameterfvSGIX_names[] = + "iip\0" /* Parameter signature */ + "glGetListParameterfvSGIX\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_ARB_vertex_program) +static const char VertexAttrib4fvARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char GetActiveUniformARB_names[] = + "iiipppp\0" /* Parameter signature */ + "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_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_ARB_shader_objects) +static const char GetUniformivARB_names[] = + "iip\0" /* Parameter signature */ + "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_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_EXT_convolution) +static const char GetConvolutionFilterEXT_names[] = + "iiip\0" /* Parameter signature */ + "glGetConvolutionFilterEXT\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_EXT_framebuffer_object) +static const char FramebufferRenderbufferEXT_names[] = + "iiii\0" /* Parameter signature */ + "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_NV_fence) +static const char SetFenceNV_names[] = + "ii\0" /* Parameter signature */ + "glSetFenceNV\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char FramebufferTexture1DEXT_names[] = + "iiiii\0" /* Parameter signature */ + "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_NV_vertex_program) +static const char ProgramParameter4fvNV_names[] = + "iip\0" /* Parameter signature */ + "glProgramParameter4fvNV\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_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_ARB_shader_objects) +static const char Uniform2fvARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform2fvARB\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_shader_objects) +static const char UseProgramObjectARB_names[] = + "i\0" /* Parameter signature */ + "glUseProgramObjectARB\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_EXT_framebuffer_object) +static const char BindFramebufferEXT_names[] = + "ii\0" /* Parameter signature */ + "glBindFramebufferEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4usvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4usvARB\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_ARB_vertex_program) +static const char VertexAttrib2dARB_names[] = + "idd\0" /* Parameter signature */ + "glVertexAttrib2dARB\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) +static const char CopyColorTable_names[] = + "iiiii\0" /* Parameter signature */ + "glCopyColorTable\0" + "glCopyColorTableSGI\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_ARB_vertex_program) +static const char VertexAttrib1dvARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char GetVertexAttribfvARB_names[] = + "iip\0" /* Parameter signature */ + "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_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_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_ARB_vertex_shader) +static const char GetAttribLocationARB_names[] = + "ip\0" /* Parameter signature */ + "glGetAttribLocationARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4ubvARB_names[] = + "ip\0" /* Parameter signature */ + "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) +static const char ProgramEnvParameter4fARB_names[] = + "iiffff\0" /* Parameter signature */ + "glProgramEnvParameter4fARB\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char Uniform3ivARB_names[] = + "iip\0" /* Parameter signature */ + "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_NV_evaluators) +static const char GetMapAttribParameterfvNV_names[] = + "iiip\0" /* Parameter signature */ + "glGetMapAttribParameterfvNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4sARB_names[] = + "iiiii\0" /* Parameter signature */ + "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_EXT_framebuffer_object) +static const char GenRenderbuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "glGenRenderbuffersEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionParameterfvEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetConvolutionParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxParameterfvEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetMinmaxParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib2dvARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib2fvARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib4NivARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4NivARB\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_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_SUN_vertex) +static const char TexCoord2fNormal3fVertex3fSUN_names[] = + "ffffffff\0" /* Parameter signature */ + "glTexCoord2fNormal3fVertex3fSUN\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_ARB_shader_objects) +static const char CompileShaderARB_names[] = + "i\0" /* Parameter signature */ + "glCompileShaderARB\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_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_ARB_vertex_program) +static const char VertexAttrib4NuivARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char Uniform4fARB_names[] = + "iffff\0" /* Parameter signature */ + "glUniform4fARB\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_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_SUN_triangle_list) +static const char ReplacementCodePointerSUN_names[] = + "iip\0" /* Parameter signature */ + "glReplacementCodePointerSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramEnvParameter4dARB_names[] = + "iidddd\0" /* Parameter signature */ + "glProgramEnvParameter4dARB\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_vertex_weighting) +static const char VertexWeightfvEXT_names[] = + "p\0" /* Parameter signature */ + "glVertexWeightfvEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib1dARB_names[] = + "id\0" /* Parameter signature */ + "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_NV_vertex_program) +static const char VertexAttrib4sNV_names[] = + "iiiii\0" /* Parameter signature */ + "glVertexAttrib4sNV\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_ARB_shader_objects) +static const char LinkProgramARB_names[] = + "i\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char ShaderSourceARB_names[] = + "iipp\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib3svARB_names[] = + "ip\0" /* Parameter signature */ + "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_EXT_framebuffer_object) +static const char IsFramebufferEXT_names[] = + "i\0" /* Parameter signature */ + "glIsFramebufferEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char Uniform4ivARB_names[] = + "iip\0" /* Parameter signature */ + "glUniform4ivARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char GetVertexAttribdvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribdvARB\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_ARB_shader_objects) +static const char Uniform1ivARB_names[] = + "iip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib4dvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4dvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_shader) +static const char BindAttribLocationARB_names[] = + "iip\0" /* Parameter signature */ + "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_SGI_color_table) +static const char GetColorTableParameterivSGI_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameterivSGI\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_EXT_framebuffer_object) +static const char FramebufferTexture2DEXT_names[] = + "iiiii\0" /* Parameter signature */ + "glFramebufferTexture2DEXT\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_EXT_framebuffer_object) +static const char GetFramebufferAttachmentParameterivEXT_names[] = + "iiip\0" /* Parameter signature */ + "glGetFramebufferAttachmentParameterivEXT\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_ARB_shader_objects) +static const char ValidateProgramARB_names[] = + "i\0" /* Parameter signature */ + "glValidateProgramARB\0" + ""; +#endif + +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor4ubVertex3fSUN_names[] = + "ffiiiifff\0" /* Parameter signature */ + "glTexCoord2fColor4ubVertex3fSUN\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char Uniform1iARB_names[] = + "ii\0" /* Parameter signature */ + "glUniform1iARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttribPointerARB_names[] = + "iiiiip\0" /* Parameter signature */ + "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_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_ARB_vertex_program) +static const char VertexAttrib4NsvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4NsvARB\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib3fvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib3fvARB\0" + ""; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +static const char DeleteFramebuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "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_SUN_vertex) +static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] = + "pppp\0" /* Parameter signature */ + "glTexCoord2fColor4fNormal3fVertex3fvSUN\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_EXT_framebuffer_object) +static const char GenFramebuffersEXT_names[] = + "ip\0" /* Parameter signature */ + "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_EXT_pixel_transform) +static const char PixelTransformParameterfEXT_names[] = + "iif\0" /* Parameter signature */ + "glPixelTransformParameterfEXT\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_NV_vertex_program) +static const char VertexAttrib3sNV_names[] = + "iiii\0" /* Parameter signature */ + "glVertexAttrib3sNV\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NubARB_names[] = + "iiiii\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char Uniform4fvARB_names[] = + "iip\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char GetUniformfvARB_names[] = + "iip\0" /* Parameter signature */ + "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_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_ARB_shader_objects) +static const char Uniform4iARB_names[] = + "iiiii\0" /* Parameter signature */ + "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_NV_vertex_program) +static const char VertexAttribs2fvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs2fvNV\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_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_NV_vertex_program) +static const char VertexAttrib1fvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1fvNV\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_EXT_framebuffer_object) +static const char BindRenderbufferEXT_names[] = + "ii\0" /* Parameter signature */ + "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_SGI_color_table) +static const char GetColorTableSGI_names[] = + "iiip\0" /* Parameter signature */ + "glGetColorTableSGI\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_ARB_vertex_program) || defined(need_GL_NV_vertex_program) +static const char GetVertexAttribPointervNV_names[] = + "iip\0" /* Parameter signature */ + "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_ARB_shader_objects) +static const char Uniform2iARB_names[] = + "iii\0" /* Parameter signature */ + "glUniform2iARB\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetConvolutionParameterivEXT\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_EXT_texture_object) +static const char GenTexturesEXT_names[] = + "ip\0" /* Parameter signature */ + "glGenTexturesEXT\0" + ""; +#endif + +#if defined(need_GL_SGIX_sprite) +static const char SpriteParameterfSGIX_names[] = + "if\0" /* Parameter signature */ + "glSpriteParameterfSGIX\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetMinmaxParameterivEXT\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_ARB_vertex_program) +static const char VertexAttrib4dARB_names[] = + "idddd\0" /* Parameter signature */ + "glVertexAttrib4dARB\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_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_ARB_vertex_program) +static const char GetProgramLocalParameterdvARB_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramLocalParameterdvARB\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_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_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_EXT_texture_object) +static const char AreTexturesResidentEXT_names[] = + "ipp\0" /* Parameter signature */ + "glAreTexturesResidentEXT\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_ARB_shader_objects) +static const char GetUniformLocationARB_names[] = + "ip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib3sARB_names[] = + "iiii\0" /* Parameter signature */ + "glVertexAttrib3sARB\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 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_stencil_two_side) +static const char ActiveStencilFaceEXT_names[] = + "i\0" /* Parameter signature */ + "glActiveStencilFaceEXT\0" + ""; +#endif + +#if defined(need_GL_EXT_paletted_texture) +static const char GetColorTableParameterfvEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char GetShaderSourceARB_names[] = + "iipp\0" /* Parameter signature */ + "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_NV_evaluators) +static const char GetMapControlPointsNV_names[] = + "iiiiiip\0" /* Parameter signature */ + "glGetMapControlPointsNV\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char Uniform1fARB_names[] = + "if\0" /* Parameter signature */ + "glUniform1fARB\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_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_ARB_shader_objects) +static const char Uniform1fvARB_names[] = + "iip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char EnableVertexAttribArrayARB_names[] = + "i\0" /* Parameter signature */ + "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_NV_fence) +static const char FinishFenceNV_names[] = + "i\0" /* Parameter signature */ + "glFinishFenceNV\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_ARB_vertex_program) +static const char VertexAttrib4uivARB_names[] = + "ip\0" /* Parameter signature */ + "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_SGIX_reference_plane) +static const char ReferencePlaneSGIX_names[] = + "p\0" /* Parameter signature */ + "glReferencePlaneSGIX\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_EXT_texture_object) +static const char IsTextureEXT_names[] = + "i\0" /* Parameter signature */ + "glIsTextureEXT\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_ARB_vertex_program) +static const char VertexAttrib4svARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4svARB\0" + ""; +#endif + +#if defined(need_GL_ARB_shader_objects) +static const char Uniform3fARB_names[] = + "ifff\0" /* Parameter signature */ + "glUniform3fARB\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_ARB_vertex_program) +static const char VertexAttrib2svARB_names[] = + "ip\0" /* Parameter signature */ + "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_SGIX_instruments) +static const char PollInstrumentsSGIX_names[] = + "p\0" /* Parameter signature */ + "glPollInstrumentsSGIX\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4NubvARB_names[] = + "ip\0" /* Parameter signature */ + "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_EXT_framebuffer_object) +static const char GetRenderbufferParameterivEXT_names[] = + "iip\0" /* Parameter signature */ + "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_ARB_vertex_program) +static const char VertexAttrib2sARB_names[] = + "iii\0" /* Parameter signature */ + "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_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_ARB_vertex_program) +static const char VertexAttrib1fvARB_names[] = + "ip\0" /* Parameter signature */ + "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_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_NV_vertex_array_range) +static const char VertexArrayRangeNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexArrayRangeNV\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, 553 }, + { 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, 413 }, + { 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 }, + { CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 }, + { MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 }, + { MatrixIndexPointerARB_names, MatrixIndexPointerARB_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, 412 }, + { 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, 703 }, + { GetQueryivARB_names, GetQueryivARB_remap_index, 705 }, + { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, 706 }, + { EndQueryARB_names, EndQueryARB_remap_index, 704 }, + { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, 707 }, + { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, 701 }, + { IsQueryARB_names, IsQueryARB_remap_index, 702 }, + { GenQueriesARB_names, GenQueriesARB_remap_index, 700 }, + { 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, 458 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { 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, 739 }, + { Uniform2fARB_names, Uniform2fARB_remap_index, 723 }, + { Uniform2ivARB_names, Uniform2ivARB_remap_index, 735 }, + { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, 740 }, + { CreateProgramObjectARB_names, CreateProgramObjectARB_remap_index, 717 }, + { Uniform3iARB_names, Uniform3iARB_remap_index, 728 }, + { CreateShaderObjectARB_names, CreateShaderObjectARB_remap_index, 714 }, + { AttachObjectARB_names, AttachObjectARB_remap_index, 718 }, + { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, 738 }, + { GetAttachedObjectsARB_names, GetAttachedObjectsARB_remap_index, 744 }, + { Uniform3fvARB_names, Uniform3fvARB_remap_index, 732 }, + { GetHandleARB_names, GetHandleARB_remap_index, 712 }, + { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, 746 }, + { GetUniformivARB_names, GetUniformivARB_remap_index, 748 }, + { Uniform2fvARB_names, Uniform2fvARB_remap_index, 731 }, + { DeleteObjectARB_names, DeleteObjectARB_remap_index, 711 }, + { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, 720 }, + { Uniform3ivARB_names, Uniform3ivARB_remap_index, 736 }, + { CompileShaderARB_names, CompileShaderARB_remap_index, 716 }, + { Uniform4fARB_names, Uniform4fARB_remap_index, 725 }, + { LinkProgramARB_names, LinkProgramARB_remap_index, 719 }, + { ShaderSourceARB_names, ShaderSourceARB_remap_index, 715 }, + { Uniform4ivARB_names, Uniform4ivARB_remap_index, 737 }, + { Uniform1ivARB_names, Uniform1ivARB_remap_index, 734 }, + { ValidateProgramARB_names, ValidateProgramARB_remap_index, 721 }, + { Uniform1iARB_names, Uniform1iARB_remap_index, 726 }, + { Uniform4fvARB_names, Uniform4fvARB_remap_index, 733 }, + { GetUniformfvARB_names, GetUniformfvARB_remap_index, 747 }, + { DetachObjectARB_names, DetachObjectARB_remap_index, 713 }, + { Uniform4iARB_names, Uniform4iARB_remap_index, 729 }, + { Uniform2iARB_names, Uniform2iARB_remap_index, 727 }, + { GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, 742 }, + { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, 745 }, + { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, 749 }, + { Uniform1fARB_names, Uniform1fARB_remap_index, 722 }, + { Uniform1fvARB_names, Uniform1fvARB_remap_index, 730 }, + { Uniform3fARB_names, Uniform3fARB_remap_index, 724 }, + { GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, 741 }, + { GetInfoLogARB_names, GetInfoLogARB_remap_index, 743 }, + { 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, 558 }, + { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, 554 }, + { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, 556 }, + { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, 559 }, + { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, 557 }, + { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, 555 }, + { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, 560 }, + { 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, 411 }, + { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, 409 }, + { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, 410 }, + { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, 408 }, + { 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, 695 }, + { BufferSubDataARB_names, BufferSubDataARB_remap_index, 690 }, + { BufferDataARB_names, BufferDataARB_remap_index, 689 }, + { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, 694 }, + { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, 693 }, + { MapBufferARB_names, MapBufferARB_remap_index, 697 }, + { IsBufferARB_names, IsBufferARB_remap_index, 696 }, + { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, 691 }, + { UnmapBufferARB_names, UnmapBufferARB_remap_index, 698 }, + { BindBufferARB_names, BindBufferARB_remap_index, 688 }, + { GenBuffersARB_names, GenBuffersARB_remap_index, 692 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { + { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, 669 }, + { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, 611 }, + { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, 617 }, + { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, 608 }, + { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, 662 }, + { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, 666 }, + { ProgramLocalParameter4dARB_names, ProgramLocalParameter4dARB_remap_index, 672 }, + { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, 605 }, + { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, 659 }, + { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, 607 }, + { GetProgramLocalParameterfvARB_names, GetProgramLocalParameterfvARB_remap_index, 679 }, + { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, 616 }, + { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, 671 }, + { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, 590 }, + { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, 655 }, + { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, 654 }, + { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, 615 }, + { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, 623 }, + { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, 624 }, + { ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, 673 }, + { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, 657 }, + { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, 609 }, + { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, 604 }, + { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, 589 }, + { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, 656 }, + { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, 670 }, + { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, 625 }, + { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, 610 }, + { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, 612 }, + { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, 661 }, + { GetProgramStringARB_names, GetProgramStringARB_remap_index, 681 }, + { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, 663 }, + { IsProgramNV_names, IsProgramNV_remap_index, 592 }, + { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, 668 }, + { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, 603 }, + { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, 620 }, + { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, 588 }, + { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, 622 }, + { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, 664 }, + { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, 660 }, + { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, 618 }, + { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, 627 }, + { GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, 677 }, + { ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, 675 }, + { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, 580 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, 591 }, + { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, 621 }, + { GetProgramLocalParameterdvARB_names, GetProgramLocalParameterdvARB_remap_index, 678 }, + { GetProgramivARB_names, GetProgramivARB_remap_index, 680 }, + { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, 619 }, + { ProgramStringARB_names, ProgramStringARB_remap_index, 667 }, + { ProgramLocalParameter4fARB_names, ProgramLocalParameter4fARB_remap_index, 674 }, + { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, 665 }, + { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, 658 }, + { BindProgramNV_names, BindProgramNV_remap_index, 579 }, + { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, 626 }, + { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, 614 }, + { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, 628 }, + { GetProgramEnvParameterdvARB_names, GetProgramEnvParameterdvARB_remap_index, 676 }, + { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, 613 }, + { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, 606 }, + { GenProgramsNV_names, GenProgramsNV_remap_index, 582 }, + { 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, 751 }, + { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, 752 }, + { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, 750 }, + { 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, 523 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, 514 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, 520 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, 521 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, 516 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, 513 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, 522 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, 524 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, 517 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, 527 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, 518 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, 519 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, 525 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, 526 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, 528 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, 515 }, + { 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, 710 }, + { 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, 413 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_ATI_fragment_shader) +static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { + { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, 791 }, + { ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, 790 }, + { DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, 784 }, + { SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, 795 }, + { SampleMapATI_names, SampleMapATI_remap_index, 788 }, + { AlphaFragmentOp2ATI_names, AlphaFragmentOp2ATI_remap_index, 793 }, + { AlphaFragmentOp1ATI_names, AlphaFragmentOp1ATI_remap_index, 792 }, + { ColorFragmentOp1ATI_names, ColorFragmentOp1ATI_remap_index, 789 }, + { AlphaFragmentOp3ATI_names, AlphaFragmentOp3ATI_remap_index, 794 }, + { PassTexCoordATI_names, PassTexCoordATI_remap_index, 787 }, + { BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, 785 }, + { BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, 783 }, + { GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, 782 }, + { EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, 786 }, + { 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, 710 }, + { 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, 537 }, + { 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, 541 }, + { LockArraysEXT_names, LockArraysEXT_remap_index, 540 }, + { 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 }, + { ConvolutionFilter2D_names, -1, 349 }, + { ConvolutionParameteriv_names, -1, 353 }, + { ConvolutionParameterfv_names, -1, 351 }, + { GetSeparableFilterEXT_names, GetSeparableFilterEXT_remap_index, 426 }, + { GetConvolutionFilterEXT_names, GetConvolutionFilterEXT_remap_index, 423 }, + { GetConvolutionParameterfvEXT_names, GetConvolutionParameterfvEXT_remap_index, 424 }, + { SeparableFilter2D_names, -1, 360 }, + { ConvolutionParameteri_names, -1, 352 }, + { ConvolutionParameterf_names, -1, 350 }, + { GetConvolutionParameterivEXT_names, GetConvolutionParameterivEXT_remap_index, 425 }, + { 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[] = { + { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, + { 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 }, + { 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, 542 }, + { CullParameterfvEXT_names, CullParameterfvEXT_remap_index, 543 }, + { 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, 699 }, + { 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, 547 }, + { FogCoordfEXT_names, FogCoordfEXT_remap_index, 545 }, + { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, 549 }, + { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, 546 }, + { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, 548 }, + { 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, 812 }, + { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, 796 }, + { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, 800 }, + { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, 806 }, + { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, 798 }, + { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, 809 }, + { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, 810 }, + { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, 807 }, + { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, 803 }, + { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, 799 }, + { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, 802 }, + { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, 808 }, + { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, 811 }, + { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, 804 }, + { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, 805 }, + { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, 797 }, + { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, 801 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_histogram) +static const struct dri_extension_function GL_EXT_histogram_functions[] = { + { Histogram_names, -1, 367 }, + { GetHistogramParameterivEXT_names, GetHistogramParameterivEXT_remap_index, 419 }, + { ResetHistogram_names, -1, 369 }, + { GetMinmaxEXT_names, GetMinmaxEXT_remap_index, 420 }, + { GetHistogramParameterfvEXT_names, GetHistogramParameterfvEXT_remap_index, 418 }, + { GetHistogramEXT_names, GetHistogramEXT_remap_index, 417 }, + { GetMinmaxParameterfvEXT_names, GetMinmaxParameterfvEXT_remap_index, 421 }, + { ResetMinmax_names, -1, 370 }, + { GetMinmaxParameterivEXT_names, GetMinmaxParameterivEXT_remap_index, 422 }, + { Minmax_names, -1, 368 }, + { 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, 539 }, + { 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, 538 }, + { 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, 645 }, + { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, 644 }, + { 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, 446 }, + { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, 447 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_EXT_paletted_texture) +static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = { + { GetColorTableParameterivEXT_names, GetColorTableParameterivEXT_remap_index, 551 }, + { GetColorTableEXT_names, GetColorTableEXT_remap_index, 550 }, + { ColorTable_names, -1, 339 }, + { GetColorTableParameterfvEXT_names, GetColorTableParameterfvEXT_remap_index, 552 }, + { 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 }, + { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, + { PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_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, 458 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { 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, 414 }, + { 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, 567 }, + { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, 561 }, + { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, 562 }, + { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, 569 }, + { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, 563 }, + { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, 577 }, + { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, 573 }, + { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, 576 }, + { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, 568 }, + { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, 566 }, + { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, 572 }, + { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, 574 }, + { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, 564 }, + { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, 575 }, + { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, 571 }, + { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, 565 }, + { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, 570 }, + { 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, 646 }, + { 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_object) +static const struct dri_extension_function GL_EXT_texture_object_functions[] = { + { PrioritizeTextures_names, -1, 331 }, + { DeleteTextures_names, -1, 327 }, + { GenTexturesEXT_names, GenTexturesEXT_remap_index, 440 }, + { AreTexturesResidentEXT_names, AreTexturesResidentEXT_remap_index, 439 }, + { BindTexture_names, -1, 307 }, + { IsTextureEXT_names, IsTextureEXT_remap_index, 441 }, + { 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_vertex_array) +static const struct dri_extension_function GL_EXT_vertex_array_functions[] = { + { IndexPointerEXT_names, IndexPointerEXT_remap_index, 450 }, + { NormalPointerEXT_names, NormalPointerEXT_remap_index, 451 }, + { VertexPointerEXT_names, VertexPointerEXT_remap_index, 453 }, + { TexCoordPointerEXT_names, TexCoordPointerEXT_remap_index, 452 }, + { EdgeFlagPointerEXT_names, EdgeFlagPointerEXT_remap_index, 449 }, + { ArrayElement_names, -1, 306 }, + { ColorPointerEXT_names, ColorPointerEXT_remap_index, 448 }, + { 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, 495 }, + { VertexWeightfEXT_names, VertexWeightfEXT_remap_index, 494 }, + { VertexWeightPointerEXT_names, VertexWeightPointerEXT_remap_index, 496 }, + { 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, 708 }, + { MultiModeDrawElementsIBM_names, MultiModeDrawElementsIBM_remap_index, 709 }, + { 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, 537 }, + { 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, 512 }, + { 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, 523 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, 514 }, + { WindowPos4svMESA_names, WindowPos4svMESA_remap_index, 536 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, 520 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, 521 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, 516 }, + { WindowPos4dMESA_names, WindowPos4dMESA_remap_index, 529 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, 513 }, + { WindowPos4ivMESA_names, WindowPos4ivMESA_remap_index, 534 }, + { WindowPos4fMESA_names, WindowPos4fMESA_remap_index, 531 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, 522 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, 524 }, + { WindowPos4dvMESA_names, WindowPos4dvMESA_remap_index, 530 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, 517 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, 527 }, + { WindowPos4sMESA_names, WindowPos4sMESA_remap_index, 535 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, 518 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, 519 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, 525 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, 526 }, + { WindowPos4iMESA_names, WindowPos4iMESA_remap_index, 533 }, + { WindowPos4fvMESA_names, WindowPos4fvMESA_remap_index, 532 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, 528 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, 515 }, + { 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, 648 }, + { TestFenceNV_names, TestFenceNV_remap_index, 650 }, + { IsFenceNV_names, IsFenceNV_remap_index, 649 }, + { DeleteFencesNV_names, DeleteFencesNV_remap_index, 647 }, + { SetFenceNV_names, SetFenceNV_remap_index, 653 }, + { GetFenceivNV_names, GetFenceivNV_remap_index, 651 }, + { FinishFenceNV_names, FinishFenceNV_remap_index, 652 }, + { 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, 687 }, + { GetProgramNamedParameterfvNV_names, GetProgramNamedParameterfvNV_remap_index, 686 }, + { ProgramNamedParameter4fNV_names, ProgramNamedParameter4fNV_remap_index, 682 }, + { ProgramNamedParameter4fvNV_names, ProgramNamedParameter4fvNV_remap_index, 684 }, + { ProgramNamedParameter4dvNV_names, ProgramNamedParameter4dvNV_remap_index, 685 }, + { ProgramNamedParameter4dNV_names, ProgramNamedParameter4dNV_remap_index, 683 }, + { 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, 642 }, + { PointParameterivNV_names, PointParameterivNV_remap_index, 643 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_register_combiners) +static const struct dri_extension_function GL_NV_register_combiners_functions[] = { + { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, 499 }, + { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, 508 }, + { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, 505 }, + { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, 506 }, + { GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, 509 }, + { CombinerOutputNV_names, CombinerOutputNV_remap_index, 504 }, + { CombinerParameteriNV_names, CombinerParameteriNV_remap_index, 502 }, + { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, 511 }, + { CombinerInputNV_names, CombinerInputNV_remap_index, 503 }, + { CombinerParameterfNV_names, CombinerParameterfNV_remap_index, 500 }, + { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, 510 }, + { GetCombinerInputParameterivNV_names, GetCombinerInputParameterivNV_remap_index, 507 }, + { CombinerParameterivNV_names, CombinerParameterivNV_remap_index, 501 }, + { 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[] = { + { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, 497 }, + { VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, 498 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_NV_vertex_program) +static const struct dri_extension_function GL_NV_vertex_program_functions[] = { + { ProgramParameter4fNV_names, ProgramParameter4fNV_remap_index, 596 }, + { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, 781 }, + { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, 779 }, + { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, 629 }, + { ProgramParameter4dvNV_names, ProgramParameter4dvNV_remap_index, 595 }, + { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, 776 }, + { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, 762 }, + { VertexAttrib4ubNV_names, VertexAttrib4ubNV_remap_index, 780 }, + { VertexAttribs3dvNV_names, VertexAttribs3dvNV_remap_index, 635 }, + { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, 639 }, + { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, 766 }, + { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, 636 }, + { ProgramParameter4dNV_names, ProgramParameter4dNV_remap_index, 594 }, + { LoadProgramNV_names, LoadProgramNV_remap_index, 593 }, + { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, 777 }, + { VertexAttrib3fNV_names, VertexAttrib3fNV_remap_index, 770 }, + { VertexAttribs2dvNV_names, VertexAttribs2dvNV_remap_index, 632 }, + { GetProgramParameterfvNV_names, GetProgramParameterfvNV_remap_index, 584 }, + { VertexAttrib3dNV_names, VertexAttrib3dNV_remap_index, 768 }, + { VertexAttrib2fvNV_names, VertexAttrib2fvNV_remap_index, 765 }, + { VertexAttrib2dvNV_names, VertexAttrib2dvNV_remap_index, 763 }, + { VertexAttrib1dvNV_names, VertexAttrib1dvNV_remap_index, 757 }, + { ProgramParameter4fvNV_names, ProgramParameter4fvNV_remap_index, 597 }, + { VertexAttrib1svNV_names, VertexAttrib1svNV_remap_index, 761 }, + { VertexAttribs2svNV_names, VertexAttribs2svNV_remap_index, 634 }, + { GetVertexAttribivNV_names, GetVertexAttribivNV_remap_index, 755 }, + { GetVertexAttribfvNV_names, GetVertexAttribfvNV_remap_index, 754 }, + { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, 767 }, + { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, 630 }, + { IsProgramNV_names, IsProgramNV_remap_index, 592 }, + { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, 778 }, + { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, 764 }, + { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, 600 }, + { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, 581 }, + { VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, 602 }, + { TrackMatrixNV_names, TrackMatrixNV_remap_index, 601 }, + { GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, 583 }, + { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, 772 }, + { GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, 587 }, + { VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, 773 }, + { ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, 599 }, + { GetProgramivNV_names, GetProgramivNV_remap_index, 585 }, + { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, 753 }, + { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, 771 }, + { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, 633 }, + { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, 759 }, + { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, 580 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, 591 }, + { GetProgramStringNV_names, GetProgramStringNV_remap_index, 586 }, + { VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, 638 }, + { ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, 598 }, + { VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, 758 }, + { VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, 774 }, + { VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, 641 }, + { VertexAttribs3svNV_names, VertexAttribs3svNV_remap_index, 637 }, + { VertexAttrib1sNV_names, VertexAttrib1sNV_remap_index, 760 }, + { BindProgramNV_names, BindProgramNV_remap_index, 579 }, + { AreProgramsResidentNV_names, AreProgramsResidentNV_remap_index, 578 }, + { VertexAttrib3dvNV_names, VertexAttrib3dvNV_remap_index, 769 }, + { VertexAttrib1dNV_names, VertexAttrib1dNV_remap_index, 756 }, + { VertexAttribs4svNV_names, VertexAttribs4svNV_remap_index, 640 }, + { VertexAttribs1svNV_names, VertexAttribs1svNV_remap_index, 631 }, + { GenProgramsNV_names, GenProgramsNV_remap_index, 582 }, + { VertexAttrib4dvNV_names, VertexAttrib4dvNV_remap_index, 775 }, + { 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, 544 }, + { 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, 443 }, + { DetailTexFuncSGIS_names, DetailTexFuncSGIS_remap_index, 442 }, + { 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, 446 }, + { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, 447 }, + { 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, 434 }, + { GetPixelTexGenParameterivSGIS_names, GetPixelTexGenParameterivSGIS_remap_index, 435 }, + { PixelTexGenParameteriSGIS_names, PixelTexGenParameteriSGIS_remap_index, 431 }, + { PixelTexGenParameterivSGIS_names, PixelTexGenParameterivSGIS_remap_index, 432 }, + { PixelTexGenParameterfSGIS_names, PixelTexGenParameterfSGIS_remap_index, 433 }, + { GetPixelTexGenParameterfvSGIS_names, GetPixelTexGenParameterfvSGIS_remap_index, 436 }, + { 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, 458 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { 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, 445 }, + { SharpenTexFuncSGIS_names, SharpenTexFuncSGIS_remap_index, 444 }, + { 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, 437 }, + { TexSubImage4DSGIS_names, TexSubImage4DSGIS_remap_index, 438 }, + { 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, 415 }, + { TexFilterFuncSGIS_names, TexFilterFuncSGIS_remap_index, 416 }, + { 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, 469 }, + { 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, 486 }, + { FragmentLightModelivSGIX_names, FragmentLightModelivSGIX_remap_index, 484 }, + { FragmentLightiSGIX_names, FragmentLightiSGIX_remap_index, 479 }, + { GetFragmentMaterialfvSGIX_names, GetFragmentMaterialfvSGIX_remap_index, 491 }, + { FragmentMaterialfSGIX_names, FragmentMaterialfSGIX_remap_index, 485 }, + { GetFragmentLightivSGIX_names, GetFragmentLightivSGIX_remap_index, 490 }, + { FragmentLightModeliSGIX_names, FragmentLightModeliSGIX_remap_index, 483 }, + { FragmentLightivSGIX_names, FragmentLightivSGIX_remap_index, 480 }, + { GetFragmentMaterialivSGIX_names, GetFragmentMaterialivSGIX_remap_index, 492 }, + { FragmentLightModelfSGIX_names, FragmentLightModelfSGIX_remap_index, 481 }, + { FragmentColorMaterialSGIX_names, FragmentColorMaterialSGIX_remap_index, 476 }, + { FragmentMaterialiSGIX_names, FragmentMaterialiSGIX_remap_index, 487 }, + { LightEnviSGIX_names, LightEnviSGIX_remap_index, 493 }, + { FragmentLightModelfvSGIX_names, FragmentLightModelfvSGIX_remap_index, 482 }, + { FragmentLightfvSGIX_names, FragmentLightfvSGIX_remap_index, 478 }, + { FragmentLightfSGIX_names, FragmentLightfSGIX_remap_index, 477 }, + { GetFragmentLightfvSGIX_names, GetFragmentLightfvSGIX_remap_index, 489 }, + { FragmentMaterialivSGIX_names, FragmentMaterialivSGIX_remap_index, 488 }, + { 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, 466 }, + { 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, 463 }, + { GetInstrumentsSGIX_names, GetInstrumentsSGIX_remap_index, 460 }, + { StartInstrumentsSGIX_names, StartInstrumentsSGIX_remap_index, 464 }, + { StopInstrumentsSGIX_names, StopInstrumentsSGIX_remap_index, 465 }, + { InstrumentsBufferSGIX_names, InstrumentsBufferSGIX_remap_index, 461 }, + { PollInstrumentsSGIX_names, PollInstrumentsSGIX_remap_index, 462 }, + { 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, 472 }, + { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, 471 }, + { GetListParameterfvSGIX_names, GetListParameterfvSGIX_remap_index, 470 }, + { ListParameteriSGIX_names, ListParameteriSGIX_remap_index, 474 }, + { ListParameterfvSGIX_names, ListParameterfvSGIX_remap_index, 473 }, + { ListParameterivSGIX_names, ListParameterivSGIX_remap_index, 475 }, + { 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, 430 }, + { 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, 468 }, + { 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, 455 }, + { SpriteParameteriSGIX_names, SpriteParameteriSGIX_remap_index, 456 }, + { SpriteParameterfSGIX_names, SpriteParameterfSGIX_remap_index, 454 }, + { SpriteParameterivSGIX_names, SpriteParameterivSGIX_remap_index, 457 }, + { 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, 467 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_SGI_color_table) +static const struct dri_extension_function GL_SGI_color_table_functions[] = { + { GetColorTableParameterfvSGI_names, GetColorTableParameterfvSGI_remap_index, 428 }, + { ColorTableParameteriv_names, -1, 341 }, + { ColorTable_names, -1, 339 }, + { CopyColorTable_names, -1, 342 }, + { ColorTableParameterfv_names, -1, 340 }, + { GetColorTableParameterivSGI_names, GetColorTableParameterivSGI_remap_index, 429 }, + { GetColorTableSGI_names, GetColorTableSGI_remap_index, 427 }, + { 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 }, + { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_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 }, + { 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 }, + { Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_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 }, + { TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_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 }, + { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_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 }, + { 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, 412 }, + { MultiTexCoord3sARB_names, -1, 398 }, + { ActiveTextureARB_names, -1, 374 }, + { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, 558 }, + { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, 554 }, + { MultiTexCoord1fvARB_names, -1, 379 }, + { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, 411 }, + { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, 556 }, + { MultiTexCoord3dARB_names, -1, 392 }, + { MultiTexCoord2iARB_names, -1, 388 }, + { MultiTexCoord2svARB_names, -1, 391 }, + { MultiTexCoord2fARB_names, -1, 386 }, + { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, 409 }, + { 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, 559 }, + { ClientActiveTextureARB_names, -1, 375 }, + { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, 557 }, + { MultiTexCoord2dARB_names, -1, 384 }, + { MultiTexCoord4dvARB_names, -1, 401 }, + { MultiTexCoord4fvARB_names, -1, 403 }, + { MultiTexCoord3fARB_names, -1, 394 }, + { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, 410 }, + { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, 555 }, + { 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, 560 }, + { MultiTexCoord4svARB_names, -1, 407 }, + { MultiTexCoord1fARB_names, -1, 378 }, + { MultiTexCoord4fARB_names, -1, 402 }, + { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, 408 }, + { 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, 642 }, + { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, 567 }, + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, 523 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, 514 }, + { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, 561 }, + { PointParameterfEXT_names, PointParameterfEXT_remap_index, 458 }, + { FogCoorddEXT_names, FogCoorddEXT_remap_index, 547 }, + { FogCoordfEXT_names, FogCoordfEXT_remap_index, 545 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, 520 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, 521 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, 516 }, + { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, 562 }, + { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, 569 }, + { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, 563 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, 513 }, + { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, 577 }, + { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, 573 }, + { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, 576 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, 522 }, + { PointParameterivNV_names, PointParameterivNV_remap_index, 643 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, 524 }, + { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, 568 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, 517 }, + { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, 566 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, 527 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, 518 }, + { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, 645 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, 519 }, + { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, 549 }, + { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, 572 }, + { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, 574 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, 525 }, + { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, 564 }, + { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, 644 }, + { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, 575 }, + { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, 546 }, + { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, 571 }, + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, 537 }, + { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, 565 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, 526 }, + { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, 570 }, + { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, 548 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, 528 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, 515 }, + { 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, 703 }, + { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, 695 }, + { BufferSubDataARB_names, BufferSubDataARB_remap_index, 690 }, + { GetQueryivARB_names, GetQueryivARB_remap_index, 705 }, + { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, 706 }, + { BufferDataARB_names, BufferDataARB_remap_index, 689 }, + { EndQueryARB_names, EndQueryARB_remap_index, 704 }, + { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, 694 }, + { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, 707 }, + { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, 693 }, + { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, 701 }, + { IsQueryARB_names, IsQueryARB_remap_index, 702 }, + { MapBufferARB_names, MapBufferARB_remap_index, 697 }, + { GenQueriesARB_names, GenQueriesARB_remap_index, 700 }, + { IsBufferARB_names, IsBufferARB_remap_index, 696 }, + { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, 691 }, + { UnmapBufferARB_names, UnmapBufferARB_remap_index, 698 }, + { BindBufferARB_names, BindBufferARB_remap_index, 688 }, + { GenBuffersARB_names, GenBuffersARB_remap_index, 692 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_2_0) +static const struct dri_extension_function GL_VERSION_2_0_functions[] = { + { StencilMaskSeparate_names, StencilMaskSeparate_remap_index, 815 }, + { StencilOpSeparate_names, StencilOpSeparate_remap_index, 814 }, + { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, 813 }, + { NULL, 0, 0 } +}; +#endif + diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c new file mode 100644 index 000000000..5e9e352f2 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c @@ -0,0 +1,496 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glcontextmodes.c + * Utility routines for working with \c __GLcontextModes structures. At + * some point most or all of these functions will be moved to the Mesa + * code base. + * + * \author Ian Romanick + */ + +#if defined(IN_MINI_GLX) +# include +# include +# include +# include "GL/internal/dri_interface.h" +# include "imports.h" +# define __glXMemset memset +#else +# include +# include +# include "GL/glxint.h" + +# ifdef XFree86Server +# include "GL/glx_ansic.h" +extern void * __glXMalloc( size_t size ); +extern void __glXFree( void * ptr ); +# define _mesa_malloc(b) __glXMalloc(b) +# define _mesa_free(m) __glXFree(m) +# else +# include +# define __glXMemset memset +# define _mesa_malloc(b) Xmalloc(b) +# define _mesa_free(m) Xfree(m) +# endif /* XFree86Server */ +#endif /* !defined(IN_MINI_GLX) */ + +#include "glcontextmodes.h" + +#if !defined(IN_MINI_GLX) +#define NUM_VISUAL_TYPES 6 + +/** + * Convert an X visual type to a GLX visual type. + * + * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.) + * to be converted. + * \return If \c visualType is a valid X visual type, a GLX visual type will + * be returned. Otherwise \c GLX_NONE will be returned. + */ +GLint +_gl_convert_from_x_visual_type( int visualType ) +{ + static const int glx_visual_types[ NUM_VISUAL_TYPES ] = { + GLX_STATIC_GRAY, GLX_GRAY_SCALE, + GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, + GLX_TRUE_COLOR, GLX_DIRECT_COLOR + }; + + return ( (unsigned) visualType < NUM_VISUAL_TYPES ) + ? glx_visual_types[ visualType ] : GLX_NONE; +} + + +/** + * Convert a GLX visual type to an X visual type. + * + * \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR, + * \c GLX_STATIC_GRAY, etc.) to be converted. + * \return If \c visualType is a valid GLX visual type, an X visual type will + * be returned. Otherwise -1 will be returned. + */ +GLint +_gl_convert_to_x_visual_type( int visualType ) +{ + static const int x_visual_types[ NUM_VISUAL_TYPES ] = { + TrueColor, DirectColor, + PseudoColor, StaticColor, + GrayScale, StaticGray + }; + + return ( (unsigned) (visualType - GLX_TRUE_COLOR) <= NUM_VISUAL_TYPES ) + ? x_visual_types[ visualType - GLX_TRUE_COLOR ] : -1; +} + + +/** + * Copy a GLX visual config structure to a GL context mode structure. All + * of the fields in \c config are copied to \c mode. Additional fields in + * \c mode that can be derrived from the fields of \c config (i.e., + * \c haveDepthBuffer) are also filled in. The remaining fields in \c mode + * that cannot be derrived are set to default values. + * + * \param mode Destination GL context mode. + * \param config Source GLX visual config. + * + * \note + * The \c fbconfigID and \c visualID fields of the \c __GLcontextModes + * structure will be set to the \c vid of the \c __GLXvisualConfig structure. + */ +void +_gl_copy_visual_to_context_mode( __GLcontextModes * mode, + const __GLXvisualConfig * config ) +{ + __GLcontextModes * const next = mode->next; + + (void) __glXMemset( mode, 0, sizeof( __GLcontextModes ) ); + mode->next = next; + + mode->visualID = config->vid; + mode->visualType = _gl_convert_from_x_visual_type( config->class ); + mode->xRenderable = GL_TRUE; + mode->fbconfigID = config->vid; + mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + + mode->rgbMode = (config->rgba != 0); + mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + + mode->colorIndexMode = !(mode->rgbMode); + mode->doubleBufferMode = (config->doubleBuffer != 0); + mode->stereoMode = (config->stereo != 0); + + mode->haveAccumBuffer = ((config->accumRedSize + + config->accumGreenSize + + config->accumBlueSize + + config->accumAlphaSize) > 0); + mode->haveDepthBuffer = (config->depthSize > 0); + mode->haveStencilBuffer = (config->stencilSize > 0); + + mode->redBits = config->redSize; + mode->greenBits = config->greenSize; + mode->blueBits = config->blueSize; + mode->alphaBits = config->alphaSize; + mode->redMask = config->redMask; + mode->greenMask = config->greenMask; + mode->blueMask = config->blueMask; + mode->alphaMask = config->alphaMask; + mode->rgbBits = mode->rgbMode ? config->bufferSize : 0; + mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0; + + mode->accumRedBits = config->accumRedSize; + mode->accumGreenBits = config->accumGreenSize; + mode->accumBlueBits = config->accumBlueSize; + mode->accumAlphaBits = config->accumAlphaSize; + mode->depthBits = config->depthSize; + mode->stencilBits = config->stencilSize; + + mode->numAuxBuffers = config->auxBuffers; + mode->level = config->level; + + mode->visualRating = config->visualRating; + mode->transparentPixel = config->transparentPixel; + mode->transparentRed = config->transparentRed; + mode->transparentGreen = config->transparentGreen; + mode->transparentBlue = config->transparentBlue; + mode->transparentAlpha = config->transparentAlpha; + mode->transparentIndex = config->transparentIndex; + + mode->swapMethod = GLX_SWAP_UNDEFINED_OML; +} + + +/** + * Get data from a GL context mode. + * + * \param mode GL context mode whose data is to be returned. + * \param attribute Attribute of \c mode that is to be returned. + * \param value_return Location to store the data member of \c mode. + * \return If \c attribute is a valid attribute of \c mode, zero is + * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. + */ +int +_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, + int *value_return) +{ + switch (attribute) { + case GLX_USE_GL: + *value_return = GL_TRUE; + return 0; + case GLX_BUFFER_SIZE: + *value_return = mode->rgbBits; + return 0; + case GLX_RGBA: + *value_return = mode->rgbMode; + return 0; + case GLX_RED_SIZE: + *value_return = mode->redBits; + return 0; + case GLX_GREEN_SIZE: + *value_return = mode->greenBits; + return 0; + case GLX_BLUE_SIZE: + *value_return = mode->blueBits; + return 0; + case GLX_ALPHA_SIZE: + *value_return = mode->alphaBits; + return 0; + case GLX_DOUBLEBUFFER: + *value_return = mode->doubleBufferMode; + return 0; + case GLX_STEREO: + *value_return = mode->stereoMode; + return 0; + case GLX_AUX_BUFFERS: + *value_return = mode->numAuxBuffers; + return 0; + case GLX_DEPTH_SIZE: + *value_return = mode->depthBits; + return 0; + case GLX_STENCIL_SIZE: + *value_return = mode->stencilBits; + return 0; + case GLX_ACCUM_RED_SIZE: + *value_return = mode->accumRedBits; + return 0; + case GLX_ACCUM_GREEN_SIZE: + *value_return = mode->accumGreenBits; + return 0; + case GLX_ACCUM_BLUE_SIZE: + *value_return = mode->accumBlueBits; + return 0; + case GLX_ACCUM_ALPHA_SIZE: + *value_return = mode->accumAlphaBits; + return 0; + case GLX_LEVEL: + *value_return = mode->level; + return 0; + case GLX_TRANSPARENT_TYPE_EXT: + *value_return = mode->transparentPixel; + return 0; + case GLX_TRANSPARENT_RED_VALUE: + *value_return = mode->transparentRed; + return 0; + case GLX_TRANSPARENT_GREEN_VALUE: + *value_return = mode->transparentGreen; + return 0; + case GLX_TRANSPARENT_BLUE_VALUE: + *value_return = mode->transparentBlue; + return 0; + case GLX_TRANSPARENT_ALPHA_VALUE: + *value_return = mode->transparentAlpha; + return 0; + case GLX_TRANSPARENT_INDEX_VALUE: + *value_return = mode->transparentIndex; + return 0; + case GLX_X_VISUAL_TYPE: + *value_return = mode->visualType; + return 0; + case GLX_CONFIG_CAVEAT: + *value_return = mode->visualRating; + return 0; + case GLX_VISUAL_ID: + *value_return = mode->visualID; + return 0; + case GLX_DRAWABLE_TYPE: + *value_return = mode->drawableType; + return 0; + case GLX_RENDER_TYPE: + *value_return = mode->renderType; + return 0; + case GLX_X_RENDERABLE: + *value_return = mode->xRenderable; + return 0; + case GLX_FBCONFIG_ID: + *value_return = mode->fbconfigID; + return 0; + case GLX_MAX_PBUFFER_WIDTH: + *value_return = mode->maxPbufferWidth; + return 0; + case GLX_MAX_PBUFFER_HEIGHT: + *value_return = mode->maxPbufferHeight; + return 0; + case GLX_MAX_PBUFFER_PIXELS: + *value_return = mode->maxPbufferPixels; + return 0; + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + *value_return = mode->optimalPbufferWidth; + return 0; + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + *value_return = mode->optimalPbufferHeight; + return 0; + case GLX_SWAP_METHOD_OML: + *value_return = mode->swapMethod; + return 0; + case GLX_SAMPLE_BUFFERS_SGIS: + *value_return = mode->sampleBuffers; + return 0; + case GLX_SAMPLES_SGIS: + *value_return = mode->samples; + return 0; + + /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. + * It is ONLY for communication between the GLX client and the GLX + * server. + */ + case GLX_VISUAL_SELECT_GROUP_SGIX: + default: + return GLX_BAD_ATTRIBUTE; + } +} +#endif /* !defined(IN_MINI_GLX) */ + + +/** + * Allocate a linked list of \c __GLcontextModes structures. The fields of + * each structure will be initialized to "reasonable" default values. In + * most cases this is the default value defined by table 3.4 of the GLX + * 1.3 specification. This means that most values are either initialized to + * zero or \c GLX_DONT_CARE (which is -1). As support for additional + * extensions is added, the new values will be initialized to appropriate + * values from the extension specification. + * + * \param count Number of structures to allocate. + * \param minimum_size Minimum size of a structure to allocate. This allows + * for differences in the version of the + * \c __GLcontextModes stucture used in libGL and in a + * DRI-based driver. + * \returns A pointer to the first element in a linked list of \c count + * stuctures on success, or \c NULL on failure. + * + * \warning Use of \c minimum_size does \b not guarantee binary compatibility. + * The fundamental assumption is that if the \c minimum_size + * specified by the driver and the size of the \c __GLcontextModes + * structure in libGL is the same, then the meaning of each byte in + * the structure is the same in both places. \b Be \b careful! + * Basically this means that fields have to be added in libGL and + * then propagated to drivers. Drivers should \b never arbitrarilly + * extend the \c __GLcontextModes data-structure. + */ +__GLcontextModes * +_gl_context_modes_create( unsigned count, size_t minimum_size ) +{ + const size_t size = (minimum_size > sizeof( __GLcontextModes )) + ? minimum_size : sizeof( __GLcontextModes ); + __GLcontextModes * base = NULL; + __GLcontextModes ** next; + unsigned i; + + next = & base; + for ( i = 0 ; i < count ; i++ ) { + *next = (__GLcontextModes *) _mesa_malloc( size ); + if ( *next == NULL ) { + _gl_context_modes_destroy( base ); + base = NULL; + break; + } + + (void) __glXMemset( *next, 0, size ); + (*next)->visualID = GLX_DONT_CARE; + (*next)->visualType = GLX_DONT_CARE; + (*next)->visualRating = GLX_NONE; + (*next)->transparentPixel = GLX_NONE; + (*next)->transparentRed = GLX_DONT_CARE; + (*next)->transparentGreen = GLX_DONT_CARE; + (*next)->transparentBlue = GLX_DONT_CARE; + (*next)->transparentAlpha = GLX_DONT_CARE; + (*next)->transparentIndex = GLX_DONT_CARE; + (*next)->xRenderable = GLX_DONT_CARE; + (*next)->fbconfigID = GLX_DONT_CARE; + (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; + + next = & ((*next)->next); + } + + return base; +} + + +/** + * Destroy a linked list of \c __GLcontextModes structures created by + * \c _gl_context_modes_create. + * + * \param modes Linked list of structures to be destroyed. All structres + * in the list will be freed. + */ +void +_gl_context_modes_destroy( __GLcontextModes * modes ) +{ + while ( modes != NULL ) { + __GLcontextModes * const next = modes->next; + + _mesa_free( modes ); + modes = next; + } +} + + +/** + * Find a context mode matching a Visual ID. + * + * \param modes List list of context-mode structures to be searched. + * \param vid Visual ID to be found. + * \returns A pointer to a context-mode in \c modes if \c vid was found in + * the list, or \c NULL if it was not. + */ + +__GLcontextModes * +_gl_context_modes_find_visual( __GLcontextModes * modes, int vid ) +{ + while ( modes != NULL ) { + if ( modes->visualID == vid ) { + break; + } + + modes = modes->next; + } + + return modes; +} + + +/** + * Determine if two context-modes are the same. This is intended to be used + * by libGL implementations to compare to sets of driver generated FBconfigs. + * + * \param a Context-mode to be compared. + * \param b Context-mode to be compared. + * \returns \c GL_TRUE if the two context-modes are the same. \c GL_FALSE is + * returned otherwise. + */ +GLboolean +_gl_context_modes_are_same( const __GLcontextModes * a, + const __GLcontextModes * b ) +{ + return( (a->rgbMode == b->rgbMode) && + (a->floatMode == b->floatMode) && + (a->colorIndexMode == b->colorIndexMode) && + (a->doubleBufferMode == b->doubleBufferMode) && + (a->stereoMode == b->stereoMode) && + (a->redBits == b->redBits) && + (a->greenBits == b->greenBits) && + (a->blueBits == b->blueBits) && + (a->alphaBits == b->alphaBits) && +#if 0 /* For some reason these don't get set on the client-side in libGL. */ + (a->redMask == b->redMask) && + (a->greenMask == b->greenMask) && + (a->blueMask == b->blueMask) && + (a->alphaMask == b->alphaMask) && +#endif + (a->rgbBits == b->rgbBits) && + (a->indexBits == b->indexBits) && + (a->accumRedBits == b->accumRedBits) && + (a->accumGreenBits == b->accumGreenBits) && + (a->accumBlueBits == b->accumBlueBits) && + (a->accumAlphaBits == b->accumAlphaBits) && + (a->depthBits == b->depthBits) && + (a->stencilBits == b->stencilBits) && + (a->numAuxBuffers == b->numAuxBuffers) && + (a->level == b->level) && + (a->pixmapMode == b->pixmapMode) && + (a->visualRating == b->visualRating) && + + (a->transparentPixel == b->transparentPixel) && + + ((a->transparentPixel != GLX_TRANSPARENT_RGB) || + ((a->transparentRed == b->transparentRed) && + (a->transparentGreen == b->transparentGreen) && + (a->transparentBlue == b->transparentBlue) && + (a->transparentAlpha == b->transparentAlpha))) && + + ((a->transparentPixel != GLX_TRANSPARENT_INDEX) || + (a->transparentIndex == b->transparentIndex)) && + + (a->sampleBuffers == b->sampleBuffers) && + (a->samples == b->samples) && + ((a->drawableType & b->drawableType) != 0) && + (a->renderType == b->renderType) && + (a->maxPbufferWidth == b->maxPbufferWidth) && + (a->maxPbufferHeight == b->maxPbufferHeight) && + (a->maxPbufferPixels == b->maxPbufferPixels) && + (a->optimalPbufferWidth == b->optimalPbufferWidth) && + (a->optimalPbufferHeight == b->optimalPbufferHeight) && + (a->swapMethod == b->swapMethod) ); +} diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h new file mode 100644 index 000000000..4b5c6f68b --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h @@ -0,0 +1,52 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glcontextmodes.h + * \author Ian Romanick + */ + +#ifndef GLCONTEXTMODES_H +#define GLCONTEXTMODES_H + +#include "GL/internal/glcore.h" + +#if !defined(IN_MINI_GLX) +extern GLint _gl_convert_from_x_visual_type( int visualType ); +extern GLint _gl_convert_to_x_visual_type( int visualType ); +extern void _gl_copy_visual_to_context_mode( __GLcontextModes * mode, + const __GLXvisualConfig * config ); +extern int _gl_get_context_mode_data( const __GLcontextModes *mode, + int attribute, int *value_return ); +#endif /* !defined(IN_MINI_GLX) */ + +extern __GLcontextModes * _gl_context_modes_create( unsigned count, + size_t minimum_size ); +extern void _gl_context_modes_destroy( __GLcontextModes * modes ); +extern __GLcontextModes * _gl_context_modes_find_visual( + __GLcontextModes * modes, int vid ); +extern GLboolean _gl_context_modes_are_same( const __GLcontextModes * a, + const __GLcontextModes * b ); + +#endif /* GLCONTEXTMODES_H */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h new file mode 100644 index 000000000..4952d788e --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h @@ -0,0 +1,17 @@ +#ifndef DRIMEMSETIO_H +#define DRIMEMSETIO_H +/* +* memset an area in I/O space +* We need to be careful about this on some archs +*/ +static __inline__ void drimemsetio(void* address, int c, int size) +{ +#if defined(__powerpc__) || defined(__ia64__) + int i; + for(i=0;i + */ + + +#ifndef MMIO_H +#define MMIO_H + +#include "glheader.h" + +#if defined( __powerpc__ ) + +static __inline__ u_int32_t +read_MMIO_LE32( volatile void * base, unsigned long offset ) +{ + u_int32_t val; + + __asm__ __volatile__( "lwbrx %0, %1, %2 ; eieio" + : "=r" (val) + : "b" (base), "r" (offset) ); + return val; +} + +#else + +static __inline__ u_int32_t +read_MMIO_LE32( volatile void * base, unsigned long offset ) +{ + volatile u_int32_t * p = (volatile u_int32_t *) (((volatile char *) base) + offset); + return LE32_TO_CPU( p[0] ); +} + +#endif + +#endif /* MMIO_H */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmx.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmx.h new file mode 100644 index 000000000..49ce7e3e3 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmx.h @@ -0,0 +1,560 @@ +/* mmx.h + + MultiMedia eXtensions GCC interface library for IA32. + + To use this library, simply include this header file + and compile with GCC. You MUST have inlining enabled + in order for mmx_ok() to work; this can be done by + simply using -O on the GCC command line. + + Compiling with -DMMX_TRACE will cause detailed trace + output to be sent to stderr for each mmx operation. + This adds lots of code, and obviously slows execution to + a crawl, but can be very useful for debugging. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR ANY PARTICULAR PURPOSE. + + 1997-98 by H. Dietz and R. Fisher + + History: + 97-98* R.Fisher Early versions + 980501 R.Fisher Original Release + 980611* H.Dietz Rewrite, correctly implementing inlines, and + R.Fisher including direct register accesses. + 980616 R.Fisher Release of 980611 as 980616. + 980714 R.Fisher Minor corrections to Makefile, etc. + 980715 R.Fisher mmx_ok() now prevents optimizer from using + clobbered values. + mmx_ok() now checks if cpuid instruction is + available before trying to use it. + 980726* R.Fisher mm_support() searches for AMD 3DNow, Cyrix + Extended MMX, and standard MMX. It returns a + value which is positive if any of these are + supported, and can be masked with constants to + see which. mmx_ok() is now a call to this + 980726* R.Fisher Added i2r support for shift functions + 980919 R.Fisher Fixed AMD extended feature recognition bug. + 980921 R.Fisher Added definition/check for _MMX_H. + Added "float s[2]" to mmx_t for use with + 3DNow and EMMX. So same mmx_t can be used. + 981013 R.Fisher Fixed cpuid function 1 bug (looked at wrong reg) + Fixed psllq_i2r error in mmxtest.c + + * Unreleased (internal or interim) versions + + Notes: + It appears that the latest gas has the pand problem fixed, therefore + I'll undefine BROKEN_PAND by default. + String compares may be quicker than the multiple test/jumps in vendor + test sequence in mmx_ok(), but I'm not concerned with that right now. + + Acknowledgments: + Jussi Laako for pointing out the errors ultimately found to be + connected to the failure to notify the optimizer of clobbered values. + Roger Hardiman for reminding us that CPUID isn't everywhere, and that + someone may actually try to use this on a machine without CPUID. + Also for suggesting code for checking this. + Robert Dale for pointing out the AMD recognition bug. + Jimmy Mayfield and Carl Witty for pointing out the Intel recognition + bug. + Carl Witty for pointing out the psllq_i2r test bug. +*/ + +#ifndef _MMX_H +#define _MMX_H + +//#define MMX_TRACE + +/* Warning: at this writing, the version of GAS packaged + with most Linux distributions does not handle the + parallel AND operation mnemonic correctly. If the + symbol BROKEN_PAND is defined, a slower alternative + coding will be used. If execution of mmxtest results + in an illegal instruction fault, define this symbol. +*/ +#undef BROKEN_PAND + + +/* The type of an value that fits in an MMX register + (note that long long constant values MUST be suffixed + by LL and unsigned long long values by ULL, lest + they be truncated by the compiler) +*/ +typedef union { + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} mmx_t; + +/* Helper functions for the instruction macros that follow... + (note that memory-to-register, m2r, instructions are nearly + as efficient as register-to-register, r2r, instructions; + however, memory-to-memory instructions are really simulated + as a convenience, and are only 1/3 as efficient) +*/ +#ifdef MMX_TRACE + +/* Include the stuff for printing a trace to stderr... +*/ + +#include + +#define mmx_i2r(op, imm, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (imm); \ + fprintf(stderr, #op "_i2r(" #imm "=0x%016llx, ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (imm)); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_m2r(op, mem, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mem); \ + fprintf(stderr, #op "_m2r(" #mem "=0x%016llx, ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem)); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #reg "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_r2m(op, reg, mem) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #op "_r2m(" #reg "=0x%016llx, ", mmx_trace.q); \ + mmx_trace = (mem); \ + fprintf(stderr, #mem "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=X" (mem) \ + : /* nothing */ ); \ + mmx_trace = (mem); \ + fprintf(stderr, #mem "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_r2r(op, regs, regd) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__ ("movq %%" #regs ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #op "_r2r(" #regs "=0x%016llx, ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %%" #regd ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #regd "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd); \ + __asm__ __volatile__ ("movq %%" #regd ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + fprintf(stderr, #regd "=0x%016llx\n", mmx_trace.q); \ + } + +#define mmx_m2m(op, mems, memd) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mems); \ + fprintf(stderr, #op "_m2m(" #mems "=0x%016llx, ", mmx_trace.q); \ + mmx_trace = (memd); \ + fprintf(stderr, #memd "=0x%016llx) => ", mmx_trace.q); \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)); \ + mmx_trace = (memd); \ + fprintf(stderr, #memd "=0x%016llx\n", mmx_trace.q); \ + } + +#else + +/* These macros are a lot simpler without the tracing... +*/ + +#define mmx_i2r(op, imm, reg) \ + __asm__ __volatile__ (#op " $" #imm ", %%" #reg \ + : /* nothing */ \ + : /* nothing */); + +#define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem)) + +#define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=X" (mem) \ + : /* nothing */ ) + +#define mmx_r2r(op, regs, regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + +#define mmx_m2m(op, mems, memd) \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)) + +#endif + + +/* 1x64 MOVe Quadword + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) +#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) +#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) +#define movq(vars, vard) \ + __asm__ __volatile__ ("movq %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 1x32 MOVe Doubleword + (like movq, this is both load and store... + but is most useful for moving things between + mmx registers and ordinary registers) +*/ +#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) +#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) +#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) +#define movd(vars, vard) \ + __asm__ __volatile__ ("movd %1, %%mm0\n\t" \ + "movd %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 2x32, 4x16, and 8x8 Parallel ADDs +*/ +#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) +#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) +#define paddd(vars, vard) mmx_m2m(paddd, vars, vard) + +#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) +#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) +#define paddw(vars, vard) mmx_m2m(paddw, vars, vard) + +#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) +#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) +#define paddb(vars, vard) mmx_m2m(paddb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic +*/ +#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) +#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) +#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard) + +#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) +#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) +#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic +*/ +#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) +#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) +#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard) + +#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) +#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) +#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel SUBs +*/ +#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) +#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) +#define psubd(vars, vard) mmx_m2m(psubd, vars, vard) + +#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) +#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) +#define psubw(vars, vard) mmx_m2m(psubw, vars, vard) + +#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) +#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) +#define psubb(vars, vard) mmx_m2m(psubb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic +*/ +#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) +#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) +#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard) + +#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) +#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) +#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic +*/ +#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) +#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) +#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard) + +#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) +#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) +#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard) + + +/* 4x16 Parallel MULs giving Low 4x16 portions of results +*/ +#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) +#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) +#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard) + + +/* 4x16 Parallel MULs giving High 4x16 portions of results +*/ +#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) +#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) +#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard) + + +/* 4x16->2x32 Parallel Mul-ADD + (muls like pmullw, then adds adjacent 16-bit fields + in the multiply result to make the final 2x32 result) +*/ +#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) +#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) +#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard) + + +/* 1x64 bitwise AND +*/ +#ifdef BROKEN_PAND +#define pand_m2r(var, reg) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, reg); \ + mmx_m2r(pandn, var, reg); \ + } +#define pand_r2r(regs, regd) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, regd); \ + mmx_r2r(pandn, regs, regd) \ + } +#define pand(vars, vard) \ + { \ + movq_m2r(vard, mm0); \ + mmx_m2r(pandn, (mmx_t) -1LL, mm0); \ + mmx_m2r(pandn, vars, mm0); \ + movq_r2m(mm0, vard); \ + } +#else +#define pand_m2r(var, reg) mmx_m2r(pand, var, reg) +#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) +#define pand(vars, vard) mmx_m2m(pand, vars, vard) +#endif + + +/* 1x64 bitwise AND with Not the destination +*/ +#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) +#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) +#define pandn(vars, vard) mmx_m2m(pandn, vars, vard) + + +/* 1x64 bitwise OR +*/ +#define por_m2r(var, reg) mmx_m2r(por, var, reg) +#define por_r2r(regs, regd) mmx_r2r(por, regs, regd) +#define por(vars, vard) mmx_m2m(por, vars, vard) + + +/* 1x64 bitwise eXclusive OR +*/ +#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) +#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) +#define pxor(vars, vard) mmx_m2m(pxor, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality + (resulting fields are either 0 or -1) +*/ +#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) +#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard) + +#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) +#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard) + +#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) +#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than + (resulting fields are either 0 or -1) +*/ +#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) +#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard) + +#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) +#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard) + +#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) +#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical +*/ +#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) +#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) +#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) +#define psllq(vars, vard) mmx_m2m(psllq, vars, vard) + +#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) +#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) +#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) +#define pslld(vars, vard) mmx_m2m(pslld, vars, vard) + +#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) +#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) +#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) +#define psllw(vars, vard) mmx_m2m(psllw, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical +*/ +#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) +#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) +#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) +#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard) + +#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) +#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) +#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) +#define psrld(vars, vard) mmx_m2m(psrld, vars, vard) + +#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) +#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) +#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) +#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard) + + +/* 2x32 and 4x16 Parallel Shift Right Arithmetic +*/ +#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) +#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) +#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) +#define psrad(vars, vard) mmx_m2m(psrad, vars, vard) + +#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) +#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) +#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) +#define psraw(vars, vard) mmx_m2m(psraw, vars, vard) + + +/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate + (packs source and dest fields into dest in that order) +*/ +#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) +#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) +#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard) + +#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) +#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) +#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard) + + +/* 4x16->8x8 PACK and Unsigned Saturate + (packs source and dest fields into dest in that order) +*/ +#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) +#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) +#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low + (interleaves low half of dest with low half of source + as padding in each result field) +*/ +#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) +#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) +#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard) + +#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) +#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) +#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard) + +#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) +#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) +#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High + (interleaves high half of dest with high half of source + as padding in each result field) +*/ +#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) +#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) +#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard) + +#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) +#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) +#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard) + +#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) +#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) +#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard) + + +/* Empty MMx State + (used to clean-up when going from mmx to float use + of the registers that are shared by both; note that + there is no float-to-mmx operation needed, because + only the float tag word info is corruptible) +*/ +#ifdef MMX_TRACE + +#define emms() \ + { \ + fprintf(stderr, "emms()\n"); \ + __asm__ __volatile__ ("emms"); \ + } + +#else + +#define emms() __asm__ __volatile__ ("emms") + +#endif + +#endif + diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp.h new file mode 100644 index 000000000..f726e8305 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp.h @@ -0,0 +1,328 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2002, 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Keith Whitwell + * Gareth Hughes + */ + +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HW_READ_CLIPLOOP +#define HW_READ_CLIPLOOP() HW_CLIPLOOP() +#endif + +#ifndef HW_WRITE_CLIPLOOP +#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() +#endif + + +static void TAG(WriteRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLuint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "WriteRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + if (mask[i]) + WRITE_PIXEL( x1, y, p ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_PIXEL( x1, y, p ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + +static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *color = (const GLubyte *) value; + GLuint i; + LOCAL_VARS; + INIT_MONO_PIXEL(p, color); + + if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + READ_RGBA( rgba[i], x1, y ); + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} + + +static void TAG(ReadRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + const GLubyte *mask = NULL; /* remove someday */ + GLuint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "ReadRGBAPixels\n"); + + HW_READ_CLIPLOOP() + { + if (mask) + { + for (i=0;i + * \author Gareth Hughes + * \author Ian Romanick + */ + +#include "colormac.h" +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +#ifndef HW_READ_CLIPLOOP +#define HW_READ_CLIPLOOP() HW_CLIPLOOP() +#endif + +#ifndef HW_WRITE_CLIPLOOP +#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() +#endif + +#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) + +#ifndef GET_SRC_PTR +#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 2 + (_y) * pitch) +#endif + +#ifndef GET_DST_PTR +#define GET_DST_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch) +#endif + +#define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_565( color[0], color[1], color[2] ) + +#define WRITE_RGBA( _x, _y, r, g, b, a ) \ + do { \ + GLshort * _p = (GLshort *) GET_DST_PTR(_x, _y); \ + _p[0] = ((((int)r & 0xf8) << 8) | (((int)g & 0xfc) << 3) | \ + (((int)b & 0xf8) >> 3)); \ + } while(0) + +#define WRITE_PIXEL( _x, _y, p ) \ + do { \ + GLushort * _p = (GLushort *) GET_DST_PTR(_x, _y); \ + _p[0] = p; \ + } while(0) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = *(volatile GLshort *) GET_SRC_PTR(_x, _y); \ + rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ + rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ + rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + rgba[3] = 0xff; \ + } while (0) + +#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + +#ifndef GET_SRC_PTR +#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 4 + (_y) * pitch) +#endif + +#ifndef GET_DST_PTR +#define GET_DST_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) +#endif + +# define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_8888(color[3], color[0], color[1], color[2]) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + do { \ + GLuint * _p = (GLuint *) GET_DST_PTR(_x, _y); \ + _p[0] = ((r << 16) | (g << 8) | (b << 0) | (a << 24)); \ + } while(0) + +#define WRITE_PIXEL(_x, _y, p) \ + do { \ + GLuint * _p = (GLuint *) GET_DST_PTR(_x, _y); \ + _p[0] = p; \ + } while(0) + +# if defined( USE_X86_ASM ) +# define READ_RGBA(rgba, _x, _y) \ + do { \ + GLuint p = *(volatile GLuint *) GET_SRC_PTR(_x, _y); \ + __asm__ __volatile__( "bswap %0; rorl $8, %0" \ + : "=r" (p) : "r" (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 = *(volatile GLuint *) GET_SRC_PTR(_x, _y); \ + GLuint t = p; \ + *((uint32_t *) rgba) = (t >> 24) | (p << 8); \ + } while (0) +# else +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = *(volatile GLuint *) GET_SRC_PTR(_x, _y); \ + rgba[0] = (p >> 16) & 0xff; \ + rgba[1] = (p >> 8) & 0xff; \ + rgba[2] = (p >> 0) & 0xff; \ + rgba[3] = (p >> 24) & 0xff; \ + } while (0) +# endif + +#else +#error SPANTMP_PIXEL_FMT must be set to a valid value! +#endif + +#if defined( USE_MMX_ASM ) || defined( USE_SSE_ASM ) +#include "x86/read_rgba_span_x86.h" +#include "x86/common_x86_asm.h" +#endif + +static void TAG(WriteRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; + GLint x1; + GLint n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + HW_WRITE_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + +static void TAG(WriteRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; + GLint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "WriteRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + if (mask[i]) + WRITE_PIXEL( x1, y, p ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_PIXEL( x1, y, p ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + +static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *color = (const GLubyte *) value; + GLint i; + LOCAL_VARS; + INIT_MONO_PIXEL(p, color); + + if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n"); + + HW_WRITE_CLIPLOOP() + { + if (mask) + { + for (i=0;i0;i++,x1++,n1--) + READ_RGBA( rgba[i], x1, y ); + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} + + +#if defined(USE_MMX_ASM) && \ + (((SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \ + ((SPANTMP_PIXEL_FMT == GL_RGB) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5))) +static void TAG2(ReadRGBASpan,_MMX)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, void *values) +{ +#ifndef USE_INNER_EMMS + /* The EMMS instruction is directly in-lined here because using GCC's + * built-in _mm_empty function was found to utterly destroy performance. + */ + __asm__ __volatile__( "emms" ); +#endif + + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLint x1,n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + if (DBG) fprintf(stderr, "ReadRGBASpan\n"); + + HW_READ_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + { + const char * src = GET_SRC_PTR( x1, y ); +#if (SPANTMP_PIXEL_FMT == GL_RGB) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) + _generic_read_RGBA_span_RGB565_MMX( src, rgba[i], n1 ); +#else + _generic_read_RGBA_span_BGRA8888_REV_MMX( src, rgba[i], n1 ); +#endif + } + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +#ifndef USE_INNER_EMMS + __asm__ __volatile__( "emms" ); +#endif +} +#endif + + +#if defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) +static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) +{ + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLint x1,n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + if (DBG) fprintf(stderr, "ReadRGBASpan\n"); + + HW_READ_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + { + const char * src = GET_SRC_PTR( x1, y ); + _generic_read_RGBA_span_BGRA8888_REV_SSE2( src, rgba[i], n1 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} +#endif + +#if defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) +static void TAG2(ReadRGBASpan,_SSE)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) +{ +#ifndef USE_INNER_EMMS + /* The EMMS instruction is directly in-lined here because using GCC's + * built-in _mm_empty function was found to utterly destroy performance. + */ + __asm__ __volatile__( "emms" ); +#endif + + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLint x1,n1; + LOCAL_VARS; + + y = Y_FLIP(y); + + if (DBG) fprintf(stderr, "ReadRGBASpan\n"); + + HW_READ_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + { + const char * src = GET_SRC_PTR( x1, y ); + _generic_read_RGBA_span_BGRA8888_REV_SSE( src, rgba[i], n1 ); + } + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +#ifndef USE_INNER_EMMS + __asm__ __volatile__( "emms" ); +#endif +} +#endif + + +static void TAG(ReadRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLubyte *mask = NULL; /* remove someday */ + GLint i; + LOCAL_VARS; + + if (DBG) fprintf(stderr, "ReadRGBAPixels\n"); + + HW_READ_CLIPLOOP() + { + if (mask) + { + for (i=0;iPutRow = TAG(WriteRGBASpan); + rb->PutRowRGB = TAG(WriteRGBSpan); + rb->PutMonoRow = TAG(WriteMonoRGBASpan); + rb->PutValues = TAG(WriteRGBAPixels); + rb->PutMonoValues = TAG(WriteMonoRGBAPixels); + rb->GetValues = TAG(ReadRGBAPixels); + +#if defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + if ( cpu_has_xmm2 ) { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE2" ); + rb->GetRow = TAG2(ReadRGBASpan, _SSE2); + } + else +#endif +#if defined(USE_SSE_ASM) && \ + (SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + if ( cpu_has_xmm ) { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE" ); + rb->GetRow = TAG2(ReadRGBASpan, _SSE); + } + else +#endif +#if defined(USE_MMX_ASM) && \ + (((SPANTMP_PIXEL_FMT == GL_BGRA) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \ + ((SPANTMP_PIXEL_FMT == GL_RGB) && \ + (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5))) + if ( cpu_has_mmx ) { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "MMX" ); + rb->GetRow = TAG2(ReadRGBASpan, _MMX); + } + else +#endif + { + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" ); + rb->GetRow = TAG(ReadRGBASpan); + } + +} + + +#undef INIT_MONO_PIXEL +#undef WRITE_PIXEL +#undef WRITE_RGBA +#undef READ_RGBA +#undef TAG +#undef TAG2 +#undef GET_SRC_PTR +#undef GET_DST_PTR +#undef SPANTMP_PIXEL_FMT +#undef SPANTMP_PIXEL_TYPE diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp_common.h new file mode 100644 index 000000000..a4509a569 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp_common.h @@ -0,0 +1,81 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file spantmp_common.h + * + * common macros for span read / write functions to be used in the depth, + * stencil and pixel span templates. + */ + +#ifndef HW_WRITE_LOCK +#define HW_WRITE_LOCK() HW_LOCK() +#endif + +#ifndef HW_WRITE_UNLOCK +#define HW_WRITE_UNLOCK() HW_UNLOCK() +#endif + +#ifndef HW_READ_LOCK +#define HW_READ_LOCK() HW_LOCK() +#endif + +#ifndef HW_READ_UNLOCK +#define HW_READ_UNLOCK() HW_UNLOCK() +#endif + +#ifndef HW_CLIPLOOP +#define HW_CLIPLOOP() \ + do { \ + int _nc = dPriv->numClipRects; \ + while ( _nc-- ) { \ + int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \ + int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \ + int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \ + int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y; +#endif + +#ifndef HW_ENDCLIPLOOP +#define HW_ENDCLIPLOOP() \ + } \ + } while (0) +#endif + +#ifndef CLIPPIXEL +#define CLIPPIXEL( _x, _y ) \ + ((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy)) +#endif + +#ifndef CLIPSPAN +#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \ + if ( _y < miny || _y >= maxy /*|| _x + n < minx || _x >=maxx*/ ) { \ + _n1 = 0, _x1 = x; \ + } else { \ + _n1 = _n; \ + _x1 = _x; \ + if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx; \ + if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \ + } +#endif diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/stenciltmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/stenciltmp.h new file mode 100644 index 000000000..dccab0660 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/stenciltmp.h @@ -0,0 +1,182 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/stenciltmp.h,v 1.3 2001/03/21 16:14:20 dawes Exp $ */ + +#include "spantmp_common.h" + +#ifndef DBG +#define DBG 0 +#endif + +static void TAG(WriteStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *stencil = (const GLubyte *) values; + GLint x1; + GLint n1; + LOCAL_STENCIL_VARS; + + y = Y_FLIP(y); + + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_STENCIL( x1, y, stencil[i] ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_STENCIL( x1, y, stencil[i] ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + +static void TAG(WriteMonoStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte stencil = *((const GLubyte *) value); + GLint x1; + GLint n1; + LOCAL_STENCIL_VARS; + + y = Y_FLIP(y); + + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_STENCIL( x1, y, stencil ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_STENCIL( x1, y, stencil ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + + +static void TAG(WriteStencilPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte *stencil = (const GLubyte *) values; + GLuint i; + LOCAL_STENCIL_VARS; + + if (DBG) fprintf(stderr, "WriteStencilPixels\n"); + + HW_CLIPLOOP() + { + for (i=0;i0;i++,n1--) + READ_STENCIL( stencil[i], (x+i), y ); + } + HW_ENDCLIPLOOP(); + } + HW_READ_UNLOCK(); +} + +static void TAG(ReadStencilPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) +{ + HW_READ_LOCK() + { + GLubyte *stencil = (GLubyte *) values; + GLuint i; + LOCAL_STENCIL_VARS; + + if (DBG) fprintf(stderr, "ReadStencilPixels\n"); + + HW_CLIPLOOP() + { + for (i=0;i + * Keith Whitwell + * Kevin E. Martin + * Gareth Hughes + */ +/* $XFree86:$ */ + +/** \file texmem.c + * Implements all of the device-independent texture memory management. + * + * Currently, only a simple LRU texture memory management policy is + * implemented. In the (hopefully very near) future, better policies will be + * implemented. The idea is that the DRI should be able to run in one of two + * modes. In the default mode the DRI will dynamically attempt to discover + * the best texture management policy for the running application. In the + * other mode, the user (via some sort of as yet TBD mechanism) will select + * a texture management policy that is known to work well with the + * application. + */ + +#include "texmem.h" +#include "simple_list.h" +#include "imports.h" +#include "macros.h" +#include "texformat.h" + +#include + + + +static unsigned dummy_swap_counter; + + +/** + * Calculate \f$\log_2\f$ of a value. This is a particularly poor + * implementation of this function. However, since system performance is in + * no way dependent on this function, the slowness of the implementation is + * irrelevent. + * + * \param n Value whose \f$\log_2\f$ is to be calculated + */ + +static GLuint +driLog2( GLuint n ) +{ + GLuint log2; + + for ( log2 = 1 ; n > 1 ; log2++ ) { + n >>= 1; + } + + return log2; +} + + + + +/** + * Determine if a texture is resident in textureable memory. Depending on + * the driver, this may or may not be on-card memory. It could be AGP memory + * or anyother type of memory from which the hardware can directly read + * texels. + * + * This function is intended to be used as the \c IsTextureResident function + * in the device's \c dd_function_table. + * + * \param ctx GL context pointer (currently unused) + * \param texObj Texture object to be tested + */ + +GLboolean +driIsTextureResident( GLcontext * ctx, + struct gl_texture_object * texObj ) +{ + driTextureObject * t; + + + t = (driTextureObject *) texObj->DriverData; + return( (t != NULL) && (t->memBlock != NULL) ); +} + + + + +/** + * (Re)initialize the global circular LRU list. The last element + * in the array (\a heap->nrRegions) is the sentinal. Keeping it + * at the end of the array allows the other elements of the array + * to be addressed rationally when looking up objects at a particular + * location in texture memory. + * + * \param heap Texture heap to be reset + */ + +static void resetGlobalLRU( driTexHeap * heap ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned sz = 1U << heap->logGranularity; + unsigned i; + + for (i = 0 ; (i+1) * sz <= heap->size ; i++) { + list[i].prev = i-1; + list[i].next = i+1; + list[i].age = 0; + } + + i--; + list[0].prev = heap->nrRegions; + list[i].prev = i-1; + list[i].next = heap->nrRegions; + list[heap->nrRegions].prev = i; + list[heap->nrRegions].next = 0; + heap->global_age[0] = 0; +} + +/** + * Print out debugging information about the local texture LRU. + * + * \param heap Texture heap to be printed + * \param callername Name of calling function + */ +static void printLocalLRU( driTexHeap * heap, const char *callername ) +{ + driTextureObject *t; + unsigned sz = 1U << heap->logGranularity; + + fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n", + __FUNCTION__, callername, heap->heapId ); + + foreach ( t, &heap->texture_objects ) { + if (!t->memBlock) + continue; + if (!t->tObj) { + fprintf( stderr, "Placeholder (%p) %d at 0x%x sz 0x%x\n", + (void *)t, + t->memBlock->ofs / sz, + t->memBlock->ofs, + t->memBlock->size ); + } else { + fprintf( stderr, "Texture (%p) at 0x%x sz 0x%x\n", + (void *)t, + t->memBlock->ofs, + t->memBlock->size ); + } + } + foreach ( t, heap->swapped_objects ) { + if (!t->tObj) { + fprintf( stderr, "Swapped Placeholder (%p)\n", (void *)t ); + } else { + fprintf( stderr, "Swapped Texture (%p)\n", (void *)t ); + } + } + + fprintf( stderr, "\n" ); +} + +/** + * Print out debugging information about the global texture LRU. + * + * \param heap Texture heap to be printed + * \param callername Name of calling function + */ +static void printGlobalLRU( driTexHeap * heap, const char *callername ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned int i, j; + + fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n", + __FUNCTION__, callername, heap->heapId, (void *)list ); + + for ( i = 0, j = heap->nrRegions ; i < heap->nrRegions ; i++ ) { + fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n", + j, list[j].age, list[j].next, list[j].prev, list[j].in_use ); + j = list[j].next; + if ( j == heap->nrRegions ) break; + } + + if ( j != heap->nrRegions ) { + fprintf( stderr, "Loop detected in global LRU\n" ); + for ( i = 0 ; i < heap->nrRegions ; i++ ) { + fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n", + i, list[i].age, list[i].next, list[i].prev, list[i].in_use ); + } + } + + fprintf( stderr, "\n" ); +} + + +/** + * Called by the client whenever it touches a local texture. + * + * \param t Texture object that the client has accessed + */ + +void driUpdateTextureLRU( driTextureObject * t ) +{ + driTexHeap * heap; + drmTextureRegionPtr list; + unsigned shift; + unsigned start; + unsigned end; + unsigned i; + + + heap = t->heap; + if ( heap != NULL ) { + shift = heap->logGranularity; + start = t->memBlock->ofs >> shift; + end = (t->memBlock->ofs + t->memBlock->size - 1) >> shift; + + + heap->local_age = ++heap->global_age[0]; + list = heap->global_regions; + + + /* Update the context's local LRU + */ + + move_to_head( & heap->texture_objects, t ); + + + for (i = start ; i <= end ; i++) { + list[i].age = heap->local_age; + + /* remove_from_list(i) + */ + list[(unsigned)list[i].next].prev = list[i].prev; + list[(unsigned)list[i].prev].next = list[i].next; + + /* insert_at_head(list, i) + */ + list[i].prev = heap->nrRegions; + list[i].next = list[heap->nrRegions].next; + list[(unsigned)list[heap->nrRegions].next].prev = i; + list[heap->nrRegions].next = i; + } + + if ( 0 ) { + printGlobalLRU( heap, __FUNCTION__ ); + printLocalLRU( heap, __FUNCTION__ ); + } + } +} + + + + +/** + * Keep track of swapped out texture objects. + * + * \param t Texture object to be "swapped" out of its texture heap + */ + +void driSwapOutTextureObject( driTextureObject * t ) +{ + unsigned face; + + + if ( t->memBlock != NULL ) { + assert( t->heap != NULL ); + mmFreeMem( t->memBlock ); + t->memBlock = NULL; + + if (t->timestamp > t->heap->timestamp) + t->heap->timestamp = t->timestamp; + + t->heap->texture_swaps[0]++; + move_to_tail( t->heap->swapped_objects, t ); + t->heap = NULL; + } + else { + assert( t->heap == NULL ); + } + + + for ( face = 0 ; face < 6 ; face++ ) { + t->dirty_images[face] = ~0; + } +} + + + + +/** + * Destroy hardware state associated with texture \a t. Calls the + * \a destroy_texture_object method associated with the heap from which + * \a t was allocated. + * + * \param t Texture object to be destroyed + */ + +void driDestroyTextureObject( driTextureObject * t ) +{ + driTexHeap * heap; + + + if ( 0 ) { + fprintf( stderr, "[%s:%d] freeing %p (tObj = %p, DriverData = %p)\n", + __FILE__, __LINE__, + (void *)t, + (void *)((t != NULL) ? t->tObj : NULL), + (void *)((t != NULL && t->tObj != NULL) ? t->tObj->DriverData : NULL )); + } + + if ( t != NULL ) { + if ( t->memBlock ) { + heap = t->heap; + assert( heap != NULL ); + + heap->texture_swaps[0]++; + + mmFreeMem( t->memBlock ); + t->memBlock = NULL; + + if (t->timestamp > t->heap->timestamp) + t->heap->timestamp = t->timestamp; + + heap->destroy_texture_object( heap->driverContext, t ); + t->heap = NULL; + } + + if ( t->tObj != NULL ) { + assert( t->tObj->DriverData == t ); + t->tObj->DriverData = NULL; + } + + remove_from_list( t ); + FREE( t ); + } + + if ( 0 ) { + fprintf( stderr, "[%s:%d] done freeing %p\n", __FILE__, __LINE__, (void *)t ); + } +} + + + + +/** + * Update the local heap's representation of texture memory based on + * data in the SAREA. This is done each time it is detected that some other + * direct rendering client has held the lock. This pertains to both our local + * textures and the textures belonging to other clients. Keep track of other + * client's textures by pushing a placeholder texture onto the LRU list -- + * these are denoted by \a tObj being \a NULL. + * + * \param heap Heap whose state is to be updated + * \param offset Byte offset in the heap that has been stolen + * \param size Size, in bytes, of the stolen block + * \param in_use Non-zero if the block is pinned/reserved by the kernel + */ + +static void driTexturesGone( driTexHeap * heap, int offset, int size, + int in_use ) +{ + driTextureObject * t; + driTextureObject * tmp; + + + foreach_s ( t, tmp, & heap->texture_objects ) { + if ( (t->memBlock->ofs < (offset + size)) + && ((t->memBlock->ofs + t->memBlock->size) > offset) ) { + /* It overlaps - kick it out. If the texture object is just a + * place holder, then destroy it all together. Otherwise, mark + * it as being swapped out. + */ + + if ( t->tObj != NULL ) { + driSwapOutTextureObject( t ); + } + else { + driDestroyTextureObject( t ); + } + } + } + + + { + t = (driTextureObject *) CALLOC( heap->texture_object_size ); + if ( t == NULL ) return; + + t->memBlock = mmAllocMem( heap->memory_heap, size, 0, offset ); + if ( t->memBlock == NULL ) { + fprintf( stderr, "Couldn't alloc placeholder: heap %u sz %x ofs %x\n", heap->heapId, + (int)size, (int)offset ); + mmDumpMemInfo( heap->memory_heap ); + return; + } + t->heap = heap; + if (in_use) + t->bound = 99; + insert_at_head( & heap->texture_objects, t ); + } +} + + + + +/** + * Called by the client on lock contention to determine whether textures have + * been stolen. If another client has modified a region in which we have + * textures, then we need to figure out which of our textures have been + * removed and update our global LRU. + * + * \param heap Texture heap to be updated + */ + +void driAgeTextures( driTexHeap * heap ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned sz = 1U << (heap->logGranularity); + unsigned i, nr = 0; + + + /* Have to go right round from the back to ensure stuff ends up + * LRU in the local list... Fix with a cursor pointer. + */ + + for (i = list[heap->nrRegions].prev ; + i != heap->nrRegions && nr < heap->nrRegions ; + i = list[i].prev, nr++) { + /* If switching texturing schemes, then the SAREA might not have been + * properly cleared, so we need to reset the global texture LRU. + */ + + if ( (i * sz) > heap->size ) { + nr = heap->nrRegions; + break; + } + + if (list[i].age > heap->local_age) + driTexturesGone( heap, i * sz, sz, list[i].in_use); + } + + /* Loop or uninitialized heap detected. Reset. + */ + + if (nr == heap->nrRegions) { + driTexturesGone( heap, 0, heap->size, 0); + resetGlobalLRU( heap ); + } + + if ( 0 ) { + printGlobalLRU( heap, __FUNCTION__ ); + printLocalLRU( heap, __FUNCTION__ ); + } + + heap->local_age = heap->global_age[0]; +} + + + + +#define INDEX_ARRAY_SIZE 6 /* I'm not aware of driver with more than 2 heaps */ + +/** + * Allocate memory from a texture heap to hold a texture object. This + * routine will attempt to allocate memory for the texture from the heaps + * specified by \c heap_array in order. That is, first it will try to + * allocate from \c heap_array[0], then \c heap_array[1], and so on. + * + * \param heap_array Array of pointers to texture heaps to use + * \param nr_heaps Number of heap pointer in \a heap_array + * \param t Texture object for which space is needed + * \return The ID of the heap from which memory was allocated, or -1 if + * memory could not be allocated. + * + * \bug The replacement policy implemented by this function is horrible. + */ + + +int +driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, + driTextureObject * t ) +{ + driTexHeap * heap; + driTextureObject * temp; + driTextureObject * cursor; + unsigned id; + + + /* In case it already has texture space, initialize heap. This also + * prevents GCC from issuing a warning that heap might be used + * uninitialized. + */ + + heap = t->heap; + + + /* Run through each of the existing heaps and try to allocate a buffer + * to hold the texture. + */ + + for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) { + heap = heap_array[ id ]; + if ( heap != NULL ) { + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + heap->alignmentShift, 0 ); + } + } + + + /* Kick textures out until the requested texture fits. + */ + + if ( t->memBlock == NULL ) { + unsigned index[INDEX_ARRAY_SIZE]; + unsigned nrGoodHeaps = 0; + + /* Trying to avoid dynamic memory allocation. If you have more + * heaps, increase INDEX_ARRAY_SIZE. I'm not aware of any + * drivers with more than 2 tex heaps. */ + assert( nr_heaps < INDEX_ARRAY_SIZE ); + + /* Sort large enough heaps by duty. Insertion sort should be + * fast enough for such a short array. */ + for ( id = 0 ; id < nr_heaps ; id++ ) { + heap = heap_array[ id ]; + + if ( heap != NULL && t->totalSize <= heap->size ) { + unsigned j; + + for ( j = 0 ; j < nrGoodHeaps; j++ ) { + if ( heap->duty > heap_array[ index[ j ] ]->duty ) + break; + } + + if ( j < nrGoodHeaps ) { + memmove( &index[ j+1 ], &index[ j ], + sizeof(index[ 0 ]) * (nrGoodHeaps - j) ); + } + + index[ j ] = id; + + nrGoodHeaps++; + } + } + + for ( id = 0 ; (t->memBlock == NULL) && (id < nrGoodHeaps) ; id++ ) { + heap = heap_array[ index[ id ] ]; + + for ( cursor = heap->texture_objects.prev, temp = cursor->prev; + cursor != &heap->texture_objects ; + cursor = temp, temp = cursor->prev ) { + + /* The the LRU element. If the texture is bound to one of + * the texture units, then we cannot kick it out. + */ + if ( cursor->bound /* || cursor->reserved */ ) { + continue; + } + + if ( cursor->memBlock ) + heap->duty -= cursor->memBlock->size; + + /* If this is a placeholder, there's no need to keep it */ + if (cursor->tObj) + driSwapOutTextureObject( cursor ); + else + driDestroyTextureObject( cursor ); + + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + heap->alignmentShift, 0 ); + + if (t->memBlock) + break; + } + } + + /* Rebalance duties. If a heap kicked more data than its duty, + * then all other heaps get that amount multiplied with their + * relative weight added to their duty. The negative duty is + * reset to 0. In the end all heaps have a duty >= 0. + * + * CAUTION: we must not change the heap pointer here, because it + * is used below to update the texture object. + */ + for ( id = 0 ; id < nr_heaps ; id++ ) + if ( heap_array[ id ] != NULL && heap_array[ id ]->duty < 0) { + int duty = -heap_array[ id ]->duty; + double weight = heap_array[ id ]->weight; + unsigned j; + + for ( j = 0 ; j < nr_heaps ; j++ ) + if ( j != id && heap_array[ j ] != NULL ) { + heap_array[ j ]->duty += (double) duty * + heap_array[ j ]->weight / weight; + } + + heap_array[ id ]->duty = 0; + } + } + + + if ( t->memBlock != NULL ) { + /* id and heap->heapId may or may not be the same value here. + */ + + assert( heap != NULL ); + assert( (t->heap == NULL) || (t->heap == heap) ); + + t->heap = heap; + return heap->heapId; + } + else { + assert( t->heap == NULL ); + + fprintf( stderr, "[%s:%d] unable to allocate texture\n", + __FUNCTION__, __LINE__ ); + return -1; + } +} + + + + + + +/** + * Set the location where the texture-swap counter is stored. + */ + +void +driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ) +{ + heap->texture_swaps = (counter == NULL) ? & dummy_swap_counter : counter; +} + + + + +/** + * Create a new heap for texture data. + * + * \param heap_id Device-dependent heap identifier. This value + * will returned by driAllocateTexture when memory + * is allocated from this heap. + * \param context Device-dependent driver context. This is + * supplied as the first parameter to the + * \c destroy_tex_obj function. + * \param size Size, in bytes, of the texture region + * \param alignmentShift Alignment requirement for textures. If textures + * must be allocated on a 4096 byte boundry, this + * would be 12. + * \param nr_regions Number of regions into which this texture space + * should be partitioned + * \param global_regions Array of \c drmTextureRegion structures in the SAREA + * \param global_age Pointer to the global texture age in the SAREA + * \param swapped_objects Pointer to the list of texture objects that are + * not in texture memory (i.e., have been swapped + * out). + * \param texture_object_size Size, in bytes, of a device-dependent texture + * object + * \param destroy_tex_obj Function used to destroy a device-dependent + * texture object + * + * \sa driDestroyTextureHeap + */ + +driTexHeap * +driCreateTextureHeap( unsigned heap_id, void * context, unsigned size, + unsigned alignmentShift, unsigned nr_regions, + drmTextureRegionPtr global_regions, unsigned * global_age, + driTextureObject * swapped_objects, + unsigned texture_object_size, + destroy_texture_object_t * destroy_tex_obj + ) +{ + driTexHeap * heap; + unsigned l; + + + if ( 0 ) + fprintf( stderr, "%s( %u, %p, %u, %u, %u )\n", + __FUNCTION__, + heap_id, (void *)context, size, alignmentShift, nr_regions ); + + heap = (driTexHeap *) CALLOC( sizeof( driTexHeap ) ); + if ( heap != NULL ) { + l = driLog2( (size - 1) / nr_regions ); + if ( l < alignmentShift ) + { + l = alignmentShift; + } + + heap->logGranularity = l; + heap->size = size & ~((1L << l) - 1); + + heap->memory_heap = mmInit( 0, heap->size ); + if ( heap->memory_heap != NULL ) { + heap->heapId = heap_id; + heap->driverContext = context; + + heap->alignmentShift = alignmentShift; + heap->nrRegions = nr_regions; + heap->global_regions = global_regions; + heap->global_age = global_age; + heap->swapped_objects = swapped_objects; + heap->texture_object_size = texture_object_size; + heap->destroy_texture_object = destroy_tex_obj; + + /* Force global heap init */ + if (heap->global_age[0] == 0) + heap->local_age = ~0; + else + heap->local_age = 0; + + make_empty_list( & heap->texture_objects ); + driSetTextureSwapCounterLocation( heap, NULL ); + + heap->weight = heap->size; + heap->duty = 0; + } + else { + FREE( heap ); + heap = NULL; + } + } + + + if ( 0 ) + fprintf( stderr, "%s returning %p\n", __FUNCTION__, (void *)heap ); + + return heap; +} + + + + +/** Destroys a texture heap + * + * \param heap Texture heap to be destroyed + */ + +void +driDestroyTextureHeap( driTexHeap * heap ) +{ + driTextureObject * t; + driTextureObject * temp; + + + if ( heap != NULL ) { + foreach_s( t, temp, & heap->texture_objects ) { + driDestroyTextureObject( t ); + } + foreach_s( t, temp, heap->swapped_objects ) { + driDestroyTextureObject( t ); + } + + mmDestroy( heap->memory_heap ); + FREE( heap ); + } +} + + + + +/****************************************************************************/ +/** + * Determine how many texels (including all mipmap levels) would be required + * for a texture map of size \f$2^^\c base_size_log2\f$ would require. + * + * \param base_size_log2 \f$log_2\f$ of the size of a side of the texture + * \param dimensions Number of dimensions of the texture. Either 2 or 3. + * \param faces Number of faces of the texture. Either 1 or 6 (for cube maps). + * \return Number of texels + */ + +static unsigned +texels_this_map_size( int base_size_log2, unsigned dimensions, unsigned faces ) +{ + unsigned texels; + + + assert( (faces == 1) || (faces == 6) ); + assert( (dimensions == 2) || (dimensions == 3) ); + + texels = 0; + if ( base_size_log2 >= 0 ) { + texels = (1U << (dimensions * base_size_log2)); + + /* See http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg03636.html + * for the complete explaination of why this formulation is used. + * Basically, the smaller mipmap levels sum to 0.333 the size of the + * level 0 map. The total size is therefore the size of the map + * multipled by 1.333. The +2 is there to round up. + */ + + texels = (texels * 4 * faces + 2) / 3; + } + + return texels; +} + + + + +struct maps_per_heap { + unsigned c[32]; +}; + +static void +fill_in_maximums( driTexHeap * const * heaps, unsigned nr_heaps, + unsigned max_bytes_per_texel, unsigned max_size, + unsigned mipmaps_at_once, unsigned dimensions, + unsigned faces, struct maps_per_heap * max_textures ) +{ + unsigned heap; + unsigned log2_size; + unsigned mask; + + + /* Determine how many textures of each size can be stored in each + * texture heap. + */ + + for ( heap = 0 ; heap < nr_heaps ; heap++ ) { + if ( heaps[ heap ] == NULL ) { + (void) memset( max_textures[ heap ].c, 0, + sizeof( max_textures[ heap ].c ) ); + continue; + } + + mask = (1U << heaps[ heap ]->logGranularity) - 1; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] heap[%u] = %u bytes, mask = 0x%08x\n", + __FILE__, __LINE__, + heap, heaps[ heap ]->size, mask ); + } + + for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) { + unsigned total; + + + /* Determine the total number of bytes required by a texture of + * size log2_size. + */ + + total = texels_this_map_size( log2_size, dimensions, faces ) + - texels_this_map_size( log2_size - mipmaps_at_once, + dimensions, faces ); + total *= max_bytes_per_texel; + total = (total + mask) & ~mask; + + /* The number of textures of a given size that will fit in a heap + * is equal to the size of the heap divided by the size of the + * texture. + */ + + max_textures[ heap ].c[ log2_size ] = heaps[ heap ]->size / total; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] " + "= 0x%08x / 0x%08x " + "= %u (%u)\n", + __FILE__, __LINE__, + heap, log2_size, + heaps[ heap ]->size, total, + heaps[ heap ]->size / total, + max_textures[ heap ].c[ log2_size ] ); + } + } + } +} + + +static unsigned +get_max_size( unsigned nr_heaps, + unsigned texture_units, + unsigned max_size, + int all_textures_one_heap, + struct maps_per_heap * max_textures ) +{ + unsigned heap; + unsigned log2_size; + + + /* Determine the largest texture size such that a texture of that size + * can be bound to each texture unit at the same time. Some hardware + * may require that all textures be in the same texture heap for + * multitexturing. + */ + + for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) { + unsigned total = 0; + + for ( heap = 0 ; heap < nr_heaps ; heap++ ) + { + total += max_textures[ heap ].c[ log2_size ]; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] = %u, " + "total = %u\n", __FILE__, __LINE__, heap, log2_size, + max_textures[ heap ].c[ log2_size ], total ); + } + + if ( (max_textures[ heap ].c[ log2_size ] >= texture_units) + || (!all_textures_one_heap && (total >= texture_units)) ) { + /* The number of mipmap levels is the log-base-2 of the + * maximum texture size plus 1. If the maximum texture size + * is 1x1, the log-base-2 is 0 and 1 mipmap level (the base + * level) is available. + */ + + return log2_size + 1; + } + } + } + + /* This should NEVER happen. It should always be possible to have at + * *least* a 1x1 texture in memory! + */ + assert( log2_size != 0 ); + return 0; +} + +#define SET_MAX(f,v) \ + do { if ( max_sizes[v] != 0 ) { limits-> f = max_sizes[v]; } } while( 0 ) + +#define SET_MAX_RECT(f,v) \ + do { if ( max_sizes[v] != 0 ) { limits-> f = 1 << max_sizes[v]; } } while( 0 ) + + +/** + * Given the amount of texture memory, the number of texture units, and the + * maximum size of a texel, calculate the maximum texture size the driver can + * advertise. + * + * \param heaps Texture heaps for this card + * \param nr_heap Number of texture heaps + * \param limits OpenGL contants. MaxTextureUnits must be set. + * \param max_bytes_per_texel Maximum size of a single texel, in bytes + * \param max_2D_size \f$\log_2\f$ of the maximum 2D texture size (i.e., + * 1024x1024 textures, this would be 10) + * \param max_3D_size \f$\log_2\f$ of the maximum 3D texture size (i.e., + * 1024x1024x1024 textures, this would be 10) + * \param max_cube_size \f$\log_2\f$ of the maximum cube texture size (i.e., + * 1024x1024 textures, this would be 10) + * \param max_rect_size \f$\log_2\f$ of the maximum texture rectangle size + * (i.e., 1024x1024 textures, this would be 10). This is a power-of-2 + * even though texture rectangles need not be a power-of-2. + * \param mipmaps_at_once Total number of mipmaps that can be used + * at one time. For most hardware this will be \f$\c max_size + 1\f$. + * For hardware that does not support mipmapping, this will be 1. + * \param all_textures_one_heap True if the hardware requires that all + * textures be in a single texture heap for multitexturing. + */ + +void +driCalculateMaxTextureLevels( driTexHeap * const * heaps, + unsigned nr_heaps, + struct gl_constants * limits, + unsigned max_bytes_per_texel, + unsigned max_2D_size, + unsigned max_3D_size, + unsigned max_cube_size, + unsigned max_rect_size, + unsigned mipmaps_at_once, + int all_textures_one_heap ) +{ + struct maps_per_heap max_textures[8]; + unsigned i; + const unsigned dimensions[4] = { 2, 3, 2, 2 }; + const unsigned faces[4] = { 1, 1, 6, 1 }; + unsigned max_sizes[4]; + unsigned mipmaps[4]; + + + max_sizes[0] = max_2D_size; + max_sizes[1] = max_3D_size; + max_sizes[2] = max_cube_size; + max_sizes[3] = max_rect_size; + + mipmaps[0] = mipmaps_at_once; + mipmaps[1] = mipmaps_at_once; + mipmaps[2] = 1; + mipmaps[3] = mipmaps_at_once; + + + /* Calculate the maximum number of texture levels in two passes. The + * first pass determines how many textures of each power-of-two size + * (including all mipmap levels for that size) can fit in each texture + * heap. The second pass finds the largest texture size that allows + * a texture of that size to be bound to every texture unit. + */ + + for ( i = 0 ; i < 4 ; i++ ) { + if ( max_sizes[ i ] != 0 ) { + fill_in_maximums( heaps, nr_heaps, max_bytes_per_texel, + max_sizes[ i ], mipmaps[ i ], + dimensions[ i ], faces[ i ], + max_textures ); + + max_sizes[ i ] = get_max_size( nr_heaps, + limits->MaxTextureUnits, + max_sizes[ i ], + all_textures_one_heap, + max_textures ); + } + } + + SET_MAX( MaxTextureLevels, 0 ); + SET_MAX( Max3DTextureLevels, 1 ); + SET_MAX( MaxCubeTextureLevels, 2 ); + SET_MAX_RECT( MaxTextureRectSize, 3 ); +} + + + + +/** + * Perform initial binding of default textures objects on a per unit, per + * texture target basis. + * + * \param ctx Current OpenGL context + * \param swapped List of swapped-out textures + * \param targets Bit-mask of value texture targets + */ + +void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, + GLuint targets ) +{ + struct gl_texture_object *texObj; + GLuint tmp = ctx->Texture.CurrentUnit; + unsigned i; + + + for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { + ctx->Texture.CurrentUnit = i; + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_1D) != 0 ) { + texObj = ctx->Texture.Unit[i].Current1D; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_1D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_2D) != 0 ) { + texObj = ctx->Texture.Unit[i].Current2D; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_2D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_3D) != 0 ) { + texObj = ctx->Texture.Unit[i].Current3D; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_3D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_CUBE) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentCubeMap; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_CUBE_MAP_ARB, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_RECT) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentRect; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_RECTANGLE_NV, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + } + + ctx->Texture.CurrentUnit = tmp; +} + + + + +/** + * Verify that the specified texture is in the specificed heap. + * + * \param tex Texture to be tested. + * \param heap Texture memory heap to be tested. + * \return True if the texture is in the heap, false otherwise. + */ + +static GLboolean +check_in_heap( const driTextureObject * tex, const driTexHeap * heap ) +{ +#if 1 + return tex->heap == heap; +#else + driTextureObject * curr; + + foreach( curr, & heap->texture_objects ) { + if ( curr == tex ) { + break; + } + } + + return curr == tex; +#endif +} + + + +/****************************************************************************/ +/** + * Validate the consistency of a set of texture heaps. + * Original version by Keith Whitwell in r200/r200_sanity.c. + */ + +GLboolean +driValidateTextureHeaps( driTexHeap * const * texture_heaps, + unsigned nr_heaps, const driTextureObject * swapped ) +{ + driTextureObject *t; + unsigned i; + + for ( i = 0 ; i < nr_heaps ; i++ ) { + int last_end = 0; + unsigned textures_in_heap = 0; + unsigned blocks_in_mempool = 0; + const driTexHeap * heap = texture_heaps[i]; + const memHeap_t * p = heap->memory_heap; + + /* Check each texture object has a MemBlock, and is linked into + * the correct heap. + * + * Check the texobj base address corresponds to the MemBlock + * range. Check the texobj size (recalculate?) fits within + * the MemBlock. + * + * Count the number of texobj's using this heap. + */ + + foreach ( t, &heap->texture_objects ) { + if ( !check_in_heap( t, heap ) ) { + fprintf( stderr, "%s memory block for texture object @ %p not " + "found in heap #%d\n", + __FUNCTION__, (void *)t, i ); + return GL_FALSE; + } + + + if ( t->totalSize > t->memBlock->size ) { + fprintf( stderr, "%s: Memory block for texture object @ %p is " + "only %u bytes, but %u are required\n", + __FUNCTION__, (void *)t, t->totalSize, t->memBlock->size ); + return GL_FALSE; + } + + textures_in_heap++; + } + + /* Validate the contents of the heap: + * - Ordering + * - Overlaps + * - Bounds + */ + + while ( p != NULL ) { + if (p->reserved) { + fprintf( stderr, "%s: Block (%08x,%x), is reserved?!\n", + __FUNCTION__, p->ofs, p->size ); + return GL_FALSE; + } + + if (p->ofs != last_end) { + fprintf( stderr, "%s: blocks_in_mempool = %d, last_end = %d, p->ofs = %d\n", + __FUNCTION__, blocks_in_mempool, last_end, p->ofs ); + return GL_FALSE; + } + + if (!p->reserved && !p->free) { + blocks_in_mempool++; + } + + last_end = p->ofs + p->size; + p = p->next; + } + + if (textures_in_heap != blocks_in_mempool) { + fprintf( stderr, "%s: Different number of textures objects (%u) and " + "inuse memory blocks (%u)\n", + __FUNCTION__, textures_in_heap, blocks_in_mempool ); + return GL_FALSE; + } + +#if 0 + fprintf( stderr, "%s: textures_in_heap = %u\n", + __FUNCTION__, textures_in_heap ); +#endif + } + + + /* Check swapped texobj's have zero memblocks + */ + i = 0; + foreach ( t, swapped ) { + if ( t->memBlock != NULL ) { + fprintf( stderr, "%s: Swapped texobj %p has non-NULL memblock %p\n", + __FUNCTION__, (void *)t, (void *)t->memBlock ); + return GL_FALSE; + } + i++; + } + +#if 0 + fprintf( stderr, "%s: swapped texture count = %u\n", __FUNCTION__, i ); +#endif + + return GL_TRUE; +} + + + + +/****************************************************************************/ +/** + * Compute which mipmap levels that really need to be sent to the hardware. + * This depends on the base image size, GL_TEXTURE_MIN_LOD, + * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. + */ + +void +driCalculateTextureFirstLastLevel( driTextureObject * t ) +{ + struct gl_texture_object * const tObj = t->tObj; + const struct gl_texture_image * const baseImage = + tObj->Image[0][tObj->BaseLevel]; + + /* These must be signed values. MinLod and MaxLod can be negative numbers, + * and having firstLevel and lastLevel as signed prevents the need for + * extra sign checks. + */ + int firstLevel; + int lastLevel; + + /* Yes, this looks overly complicated, but it's all needed. + */ + + switch (tObj->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. + */ + + firstLevel = lastLevel = tObj->BaseLevel; + } + else { + firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); + firstLevel = MAX2(firstLevel, tObj->BaseLevel); + lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + lastLevel = MAX2(lastLevel, t->tObj->BaseLevel); + lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = MIN2(lastLevel, t->tObj->MaxLevel); + lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + } + break; + case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_4D_SGIS: + firstLevel = lastLevel = 0; + break; + default: + return; + } + + /* save these values */ + t->firstLevel = firstLevel; + t->lastLevel = lastLevel; +} + + + + +/** + * \name DRI texture formats. Pointers 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; +/*@}*/ + + +/** + * Initialize little endian target, host byte order independent texture formats + */ +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; + } + 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; + } +} diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.h new file mode 100644 index 000000000..705cd4d34 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.h @@ -0,0 +1,327 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + * Keith Whitwell + * Kevin E. Martin + * Gareth Hughes + */ +/* $XFree86:$ */ + +/** \file texmem.h + * Public interface to the DRI texture memory management routines. + * + * \sa texmem.c + */ + +#ifndef DRI_TEXMEM_H +#define DRI_TEXMEM_H + +#include "mtypes.h" +#include "mm.h" +#include "xf86drm.h" + +struct dri_tex_heap; +typedef struct dri_tex_heap driTexHeap; + +struct dri_texture_object; +typedef struct dri_texture_object driTextureObject; + + +/** + * Base texture object type. Each driver will extend this type with its own + * private data members. + */ + +struct dri_texture_object { + struct dri_texture_object * next; + struct dri_texture_object * prev; + + driTexHeap * heap; /**< Texture heap currently stored in */ + struct gl_texture_object * tObj;/**< Pointer to Mesa texture object + * If NULL, this texture object is a + * "placeholder" object representing + * texture memory in use by another context. + * A placeholder should have a heap and a memBlock. + */ + PMemBlock memBlock; /**< Memory block containing texture */ + unsigned bound; /**< Texture unit currently bound to */ + + unsigned totalSize; /**< Total size of the texture, + * including all mipmap levels + */ + + unsigned dirty_images[6]; /**< Flags for whether or not images + * need to be uploaded to local or + * AGP texture space. One flag set + * for each cube face for cubic + * textures. Bit zero corresponds to + * the base-level, which may or may + * not be the level zero mipmap. + */ + + unsigned timestamp; /**< Timestamp used to + * synchronize with 3d engine + * in hardware where textures + * are uploaded directly to + * the framebuffer. + */ + + unsigned firstLevel; /**< Image in \c tObj->Image[0] that + * corresponds to the base-level of + * this texture object. + */ + + unsigned lastLevel; /**< Last image in \c tObj->Image[0] + * used by the + * current LOD settings of + * this texture object. This + * value must be greater than + * or equal to \c firstLevel. + */ +}; + + +typedef void (destroy_texture_object_t)( void * driverContext, + driTextureObject * t ); + +/** + * Client-private representation of texture memory state. + * + * Clients will place one or more of these structs in their driver + * context struct to manage one or more global texture heaps. + */ + +struct dri_tex_heap { + + /** Client-supplied heap identifier + */ + unsigned heapId; + + /** Pointer to the client's private context + */ + void *driverContext; + + /** Total size of the heap, in bytes + */ + unsigned size; + + /** \brief \f$log_2\f$ of size of single heap region + * + * Each context takes memory from the global texture heap in + * \f$2^{logGranularity}\f$ byte blocks. The value of + * \a logGranularity is based on the amount of memory represented + * by the heap and the maximum number of regions in the SAREA. Given + * \a b bytes of texture memory an \a n regions in the SAREA, + * \a logGranularity will be \f$\lfloor\log_2( b / n )\rfloor\f$. + */ + unsigned logGranularity; + + /** \brief Required alignment of allocations in this heap + * + * The alignment shift is supplied to \a mmAllocMem when memory is + * allocated from this heap. The value of \a alignmentShift will + * typically reflect some require of the hardware. This value has + * \b no \b relation to \a logGranularity. \a alignmentShift is a + * per-context value. + * + * \sa mmAllocMem + */ + unsigned alignmentShift; + + /** Number of elements in global list (the SAREA). + */ + unsigned nrRegions; + + /** Pointer to SAREA \a driTexRegion array + */ + drmTextureRegionPtr global_regions; + + /** Pointer to the texture state age (generation number) in the SAREA + */ + unsigned * global_age; + + /** Local age (generation number) of texture state + */ + unsigned local_age; + + /** Memory heap used to manage texture memory represented by + * this texture heap. + */ + memHeap_t * memory_heap; + + /** List of objects that we currently believe to be in texture + * memory. + */ + driTextureObject texture_objects; + + /** Pointer to the list of texture objects that are not in + * texture memory. + */ + driTextureObject * swapped_objects; + + /** Size of the driver-speicific texture object. + */ + unsigned texture_object_size; + + + /** + * \brief Function to destroy driver-specific texture object data. + * + * This function is supplied by the driver so that the texture manager + * can release all resources associated with a texture object. This + * function should only release driver-specific data. That is, + * \a driDestroyTextureObject will release the texture memory + * associated with the texture object, it will release the memory + * for the texture object itself, and it will unlink the texture + * object from the texture object lists. + * + * \param driverContext Pointer to the driver supplied context + * \param t Texture object that is to be destroyed + * \sa driDestroyTextureObject + */ + + destroy_texture_object_t * destroy_texture_object; + + + /** + */ + unsigned * texture_swaps; + + /** + * Timestamp used to synchronize with 3d engine in hardware + * where textures are uploaded directly to the + * framebuffer. + */ + unsigned timestamp; + + /** \brief Kick/upload weight + * + * When not enough free space is available this weight + * influences the choice of the heap from which textures are + * kicked. By default the weight is equal to the heap size. + */ + double weight; + + /** \brief Kick/upload duty + * + * The heap with the highest duty will be chosen for kicking + * textures if not enough free space is available. The duty is + * reduced by the amount of data kicked. Rebalancing of + * negative duties takes the weights into account. + */ + int duty; +}; + + + + +/** + * Called by the client on lock contention to determine whether textures have + * been stolen. If another client has modified a region in which we have + * textures, then we need to figure out which of our textures have been + * removed and update our global LRU. + * + * \param heap Texture heap to be updated + * \hideinitializer + */ + +#define DRI_AGE_TEXTURES( heap ) \ + do { \ + if ( ((heap) != NULL) \ + && ((heap)->local_age != (heap)->global_age[0]) ) \ + driAgeTextures( heap ); \ + } while( 0 ) + + + + +/* This should be called whenever there has been contention on the hardware + * lock. driAgeTextures should not be called directly. Instead, clients + * should use DRI_AGE_TEXTURES, above. + */ + +void driAgeTextures( driTexHeap * heap ); + +void driUpdateTextureLRU( driTextureObject * t ); +void driSwapOutTextureObject( driTextureObject * t ); +void driDestroyTextureObject( driTextureObject * t ); +int driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, + driTextureObject * t ); + +GLboolean driIsTextureResident( GLcontext * ctx, + struct gl_texture_object * texObj ); + +driTexHeap * driCreateTextureHeap( unsigned heap_id, void * context, + unsigned size, unsigned alignmentShift, unsigned nr_regions, + drmTextureRegionPtr global_regions, unsigned * global_age, + driTextureObject * swapped_objects, unsigned texture_object_size, + destroy_texture_object_t * destroy_tex_obj ); +void driDestroyTextureHeap( driTexHeap * heap ); + +void +driCalculateMaxTextureLevels( driTexHeap * const * heaps, + unsigned nr_heaps, + struct gl_constants * limits, + unsigned max_bytes_per_texel, + unsigned max_2D_size, + unsigned max_3D_size, + unsigned max_cube_size, + unsigned max_rect_size, + unsigned mipmaps_at_once, + int all_textures_one_heap ); + +void +driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ); + +#define DRI_TEXMGR_DO_TEXTURE_1D 0x0001 +#define DRI_TEXMGR_DO_TEXTURE_2D 0x0002 +#define DRI_TEXMGR_DO_TEXTURE_3D 0x0004 +#define DRI_TEXMGR_DO_TEXTURE_CUBE 0x0008 +#define DRI_TEXMGR_DO_TEXTURE_RECT 0x0010 + +void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, + GLuint targets ); + +GLboolean driValidateTextureHeaps( driTexHeap * const * texture_heaps, + unsigned nr_heaps, const driTextureObject * swapped ); + +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 void driInitTextureFormats( void ); + +#endif /* DRI_TEXMEM_H */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.c new file mode 100644 index 000000000..fbe1991fa --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.c @@ -0,0 +1,695 @@ +/* + * (C) Copyright IBM Corporation 2002, 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file utils.c + * Utility functions for DRI drivers. + * + * \author Ian Romanick + */ + +#include +#include +#include "mtypes.h" +#include "extensions.h" +#include "utils.h" +#include "dispatch.h" + +int driDispatchRemapTable[ driDispatchRemapTable_size ]; + +#if defined(USE_X86_ASM) +#include "x86/common_x86_asm.h" +#endif + +#if defined(USE_PPC_ASM) +#include "ppc/common_ppc_features.h" +#endif + +unsigned +driParseDebugString( const char * debug, + const struct dri_debug_control * control ) +{ + unsigned flag; + + + flag = 0; + if ( debug != NULL ) { + while( control->string != NULL ) { + if ( !strcmp( debug, "all" ) || + strstr( debug, control->string ) != NULL ) { + flag |= control->flag; + } + + control++; + } + } + + return flag; +} + + + +/** + * Create the \c GL_RENDERER string for DRI drivers. + * + * Almost all DRI drivers use a \c GL_RENDERER string of the form: + * + * "Mesa DRI " + * + * Using the supplied chip name, driver data, and AGP speed, this function + * creates the string. + * + * \param buffer Buffer to hold the \c GL_RENDERER string. + * \param hardware_name Name of the hardware. + * \param driver_date Driver date. + * \param agp_mode AGP mode (speed). + * + * \returns + * The length of the string stored in \c buffer. This does \b not include + * the terminating \c NUL character. + */ +unsigned +driGetRendererString( char * buffer, const char * hardware_name, + const char * driver_date, GLuint agp_mode ) +{ +#define MAX_INFO 4 + const char * cpu[MAX_INFO]; + unsigned next = 0; + unsigned i; + unsigned offset; + + + offset = sprintf( buffer, "Mesa DRI %s %s", hardware_name, driver_date ); + + /* Append any AGP-specific information. + */ + switch ( agp_mode ) { + case 1: + case 2: + case 4: + case 8: + offset += sprintf( & buffer[ offset ], " AGP %ux", agp_mode ); + break; + + default: + break; + } + + /* Append any CPU-specific information. + */ +#ifdef USE_X86_ASM + if ( _mesa_x86_cpu_features ) { + cpu[next] = " x86"; + next++; + } +# ifdef USE_MMX_ASM + if ( cpu_has_mmx ) { + cpu[next] = (cpu_has_mmxext) ? "/MMX+" : "/MMX"; + next++; + } +# endif +# ifdef USE_3DNOW_ASM + if ( cpu_has_3dnow ) { + cpu[next] = (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!"; + next++; + } +# endif +# ifdef USE_SSE_ASM + if ( cpu_has_xmm ) { + cpu[next] = (cpu_has_xmm2) ? "/SSE2" : "/SSE"; + next++; + } +# endif + +#elif defined(USE_SPARC_ASM) + + cpu[0] = " SPARC"; + next = 1; + +#elif defined(USE_PPC_ASM) + if ( _mesa_ppc_cpu_features ) { + cpu[next] = (cpu_has_64) ? " PowerPC 64" : " PowerPC"; + next++; + } + +# ifdef USE_VMX_ASM + if ( cpu_has_vmx ) { + cpu[next] = "/Altivec"; + next++; + } +# endif + + if ( ! cpu_has_fpu ) { + cpu[next] = "/No FPU"; + next++; + } +#endif + + for ( i = 0 ; i < next ; i++ ) { + const size_t len = strlen( cpu[i] ); + + strncpy( & buffer[ offset ], cpu[i], len ); + offset += len; + } + + return offset; +} + + + + +#define need_GL_ARB_multisample +#define need_GL_ARB_transpose_matrix +#define need_GL_ARB_window_pos +#define need_GL_EXT_compiled_vertex_array +#define need_GL_EXT_polygon_offset +#define need_GL_EXT_texture_object +#define need_GL_EXT_vertex_array +#define need_GL_MESA_window_pos + +/* These are needed in *all* drivers because Mesa internally implements + * certain functionality in terms of functions provided by these extensions. + * For example, glBlendFunc is implemented by calling glBlendFuncSeparateEXT. + */ +#define need_GL_EXT_blend_func_separate +#define need_GL_NV_vertex_program + +#include "extension_helper.h" + +static const struct dri_extension all_mesa_extensions[] = { + { "GL_ARB_multisample", GL_ARB_multisample_functions }, + { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, + { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, + { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, + { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions }, + { "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions }, + { "GL_EXT_texture_object", GL_EXT_texture_object_functions }, + { "GL_EXT_vertex_array", GL_EXT_vertex_array_functions }, + { "GL_MESA_window_pos", GL_MESA_window_pos_functions }, + { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, + { NULL, NULL } +}; + + +/** + * Enable extensions supported by the driver. + * + * \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 + * we need to add entry-points (via \c driInitSingleExtension) for those + * new functions here. + */ +void driInitExtensions( GLcontext * ctx, + const struct dri_extension * extensions_to_enable, + GLboolean enable_imaging ) +{ + static int first_time = 1; + 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 ); + } + + if ( (ctx != NULL) && enable_imaging ) { + _mesa_enable_imaging_extensions( ctx ); + } + + for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) { + driInitSingleExtension( ctx, & extensions_to_enable[i] ); + } +} + + + + +/** + * Enable and add dispatch 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. + */ +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 ( ext->functions[i].remap_index != -1 ) { + driDispatchRemapTable[ ext->functions[i].remap_index ] = offset; + } + + if ( (ext->functions[i].offset != -1) + && (ext->functions[i].offset != offset) ) { + fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n", functions[0], + driDispatchRemapTable[ ext->functions[i].remap_index ], + ext->functions[i].offset); + } + } + } + + if ( ctx != NULL ) { + _mesa_enable_extension( ctx, ext->name ); + } +} + + +/** + * Utility function used by drivers to test the verions of other components. + * + * If one of the version requirements is not met, a message is logged using + * \c __driUtilMessage. + * + * \param driver_name Name of the driver. Used in error messages. + * \param driActual Actual DRI version supplied __driCreateNewScreen. + * \param driExpected Minimum DRI version required by the driver. + * \param ddxActual Actual DDX version supplied __driCreateNewScreen. + * \param ddxExpected Minimum DDX minor and range of DDX major version required by the driver. + * \param drmActual Actual DRM version supplied __driCreateNewScreen. + * \param drmExpected Minimum DRM version required by the driver. + * + * \returns \c GL_TRUE if all version requirements are met. Otherwise, + * \c GL_FALSE is returned. + * + * \sa __driCreateNewScreen, driCheckDriDdxDrmVersions2, __driUtilMessage + * + * \todo + * Now that the old \c driCheckDriDdxDrmVersions function is gone, this + * function and \c driCheckDriDdxDrmVersions2 should be renamed. + */ +GLboolean +driCheckDriDdxDrmVersions3(const char * driver_name, + const __DRIversion * driActual, + const __DRIversion * driExpected, + const __DRIversion * ddxActual, + const __DRIutilversion2 * ddxExpected, + const __DRIversion * drmActual, + const __DRIversion * drmExpected) +{ + static const char format[] = "%s DRI driver expected %s version %d.%d.x " + "but got version %d.%d.%d"; + static const char format2[] = "%s DRI driver expected %s version %d-%d.%d.x " + "but got version %d.%d.%d"; + + + /* Check the DRI version */ + if ( (driActual->major != driExpected->major) + || (driActual->minor < driExpected->minor) ) { + __driUtilMessage(format, driver_name, "DRI", + driExpected->major, driExpected->minor, + driActual->major, driActual->minor, driActual->patch); + return GL_FALSE; + } + + /* Check that the DDX driver version is compatible */ + if ( (ddxActual->major < ddxExpected->major_min) + || (ddxActual->major > ddxExpected->major_max) + || (ddxActual->minor < ddxExpected->minor) ) { + __driUtilMessage(format2, driver_name, "DDX", + ddxExpected->major_min, ddxExpected->major_max, ddxExpected->minor, + ddxActual->major, ddxActual->minor, ddxActual->patch); + return GL_FALSE; + } + + /* Check that the DRM driver version is compatible */ + if ( (drmActual->major != drmExpected->major) + || (drmActual->minor < drmExpected->minor) ) { + __driUtilMessage(format, driver_name, "DRM", + drmExpected->major, drmExpected->minor, + drmActual->major, drmActual->minor, drmActual->patch); + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean +driCheckDriDdxDrmVersions2(const char * driver_name, + const __DRIversion * driActual, + const __DRIversion * driExpected, + const __DRIversion * ddxActual, + const __DRIversion * ddxExpected, + const __DRIversion * drmActual, + const __DRIversion * drmExpected) +{ + __DRIutilversion2 ddx_expected; + ddx_expected.major_min = ddxExpected->major; + ddx_expected.major_max = ddxExpected->major; + ddx_expected.minor = ddxExpected->minor; + ddx_expected.patch = ddxExpected->patch; + return driCheckDriDdxDrmVersions3(driver_name, driActual, + driExpected, ddxActual, & ddx_expected, + drmActual, drmExpected); +} + + + +GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, + GLint *x, GLint *y, + GLsizei *width, GLsizei *height ) +{ + /* left clipping */ + if (*x < buffer->_Xmin) { + *width -= (buffer->_Xmin - *x); + *x = buffer->_Xmin; + } + + /* right clipping */ + if (*x + *width > buffer->_Xmax) + *width -= (*x + *width - buffer->_Xmax - 1); + + if (*width <= 0) + return GL_FALSE; + + /* bottom clipping */ + if (*y < buffer->_Ymin) { + *height -= (buffer->_Ymin - *y); + *y = buffer->_Ymin; + } + + /* top clipping */ + if (*y + *height > buffer->_Ymax) + *height -= (*y + *height - buffer->_Ymax - 1); + + if (*height <= 0) + return GL_FALSE; + + return GL_TRUE; +} + + + +/** + * Creates a set of \c __GLcontextModes that a driver will expose. + * + * A set of \c __GLcontextModes will be created based on the supplied + * parameters. The number of modes processed will be 2 * + * \c num_depth_stencil_bits * \c num_db_modes. + * + * For the most part, data is just copied from \c depth_bits, \c stencil_bits, + * \c db_modes, and \c visType into each \c __GLcontextModes element. + * However, the meanings of \c fb_format and \c fb_type require further + * explanation. The \c fb_format specifies which color components are in + * each pixel and what the default order is. For example, \c GL_RGB specifies + * that red, green, blue are available and red is in the "most significant" + * position and blue is in the "least significant". The \c fb_type specifies + * the bit sizes of each component and the actual ordering. For example, if + * \c GL_UNSIGNED_SHORT_5_6_5_REV is specified with \c GL_RGB, bits [15:11] + * are the blue value, bits [10:5] are the green value, and bits [4:0] are + * the red value. + * + * One sublte issue is the combination of \c GL_RGB or \c GL_BGR and either + * of the \c GL_UNSIGNED_INT_8_8_8_8 modes. The resulting mask values in the + * \c __GLcontextModes structure is \b identical to the \c GL_RGBA or + * \c GL_BGRA case, except the \c alphaMask is zero. This means that, as + * far as this routine is concerned, \c GL_RGB with \c GL_UNSIGNED_INT_8_8_8_8 + * still uses 32-bits. + * + * If in doubt, look at the tables used in the function. + * + * \param ptr_to_modes Pointer to a pointer to a linked list of + * \c __GLcontextModes. Upon completion, a pointer to + * the next element to be process will be stored here. + * If the function fails and returns \c GL_FALSE, this + * value will be unmodified, but some elements in the + * linked list may be modified. + * \param fb_format Format of the framebuffer. Currently only \c GL_RGB, + * \c GL_RGBA, \c GL_BGR, and \c GL_BGRA are supported. + * \param fb_type Type of the pixels in the framebuffer. Currently only + * \c GL_UNSIGNED_SHORT_5_6_5, + * \c GL_UNSIGNED_SHORT_5_6_5_REV, + * \c GL_UNSIGNED_INT_8_8_8_8, and + * \c GL_UNSIGNED_INT_8_8_8_8_REV are supported. + * \param depth_bits Array of depth buffer sizes to be exposed. + * \param stencil_bits Array of stencil buffer sizes to be exposed. + * \param num_depth_stencil_bits Number of entries in both \c depth_bits and + * \c stencil_bits. + * \param db_modes Array of buffer swap modes. If an element has a + * value of \c GLX_NONE, then it represents a + * single-buffered mode. Other valid values are + * \c GLX_SWAP_EXCHANGE_OML, \c GLX_SWAP_COPY_OML, and + * \c GLX_SWAP_UNDEFINED_OML. See the + * GLX_OML_swap_method extension spec for more details. + * \param num_db_modes Number of entries in \c db_modes. + * \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or + * \c GLX_DIRECT_COLOR. + * + * \returns + * \c GL_TRUE on success or \c GL_FALSE on failure. Currently the only + * cause of failure is a bad parameter (i.e., unsupported \c fb_format or + * \c fb_type). + * + * \todo + * There is currently no way to support packed RGB modes (i.e., modes with + * exactly 3 bytes per pixel) or floating-point modes. This could probably + * be done by creating some new, private enums with clever names likes + * \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32, + * \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it. + */ +GLboolean +driFillInModes( __GLcontextModes ** ptr_to_modes, + GLenum fb_format, GLenum fb_type, + const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes, + int visType ) +{ + static const u_int8_t bits_table[3][4] = { + /* R G B A */ + { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ + { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */ + { 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */ + }; + + /* The following arrays are all indexed by the fb_type masked with 0x07. + * Given the four supported fb_type values, this results in valid array + * indices of 3, 4, 5, and 7. + */ + static const u_int32_t masks_table_rgb[8][4] = { + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */ + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5_REV */ + { 0xFF000000, 0x00FF0000, 0x0000FF00, 0x00000000 }, /* 8_8_8_8 */ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 } /* 8_8_8_8_REV */ + }; + + static const u_int32_t masks_table_rgba[8][4] = { + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */ + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5_REV */ + { 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF }, /* 8_8_8_8 */ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }, /* 8_8_8_8_REV */ + }; + + static const u_int32_t masks_table_bgr[8][4] = { + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */ + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5_REV */ + { 0x0000FF00, 0x00FF0000, 0xFF000000, 0x00000000 }, /* 8_8_8_8 */ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }, /* 8_8_8_8_REV */ + }; + + static const u_int32_t masks_table_bgra[8][4] = { + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */ + { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5_REV */ + { 0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF }, /* 8_8_8_8 */ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, /* 8_8_8_8_REV */ + }; + + static const u_int8_t bytes_per_pixel[8] = { + 0, 0, 0, 2, 2, 4, 0, 4 + }; + + const u_int8_t * bits; + const u_int32_t * masks; + const int index = fb_type & 0x07; + __GLcontextModes * modes = *ptr_to_modes; + unsigned i; + unsigned j; + unsigned k; + + + if ( bytes_per_pixel[ index ] == 0 ) { + fprintf( stderr, "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.\n", + __FUNCTION__, __LINE__, fb_type ); + return GL_FALSE; + } + + + /* Valid types are GL_UNSIGNED_SHORT_5_6_5 and GL_UNSIGNED_INT_8_8_8_8 and + * the _REV versions. + * + * Valid formats are GL_RGBA, GL_RGB, and GL_BGRA. + */ + + switch ( fb_format ) { + case GL_RGB: + bits = (bytes_per_pixel[ index ] == 2) + ? bits_table[0] : bits_table[1]; + masks = masks_table_rgb[ index ]; + break; + + case GL_RGBA: + bits = (bytes_per_pixel[ index ] == 2) + ? bits_table[0] : bits_table[2]; + masks = masks_table_rgba[ index ]; + break; + + case GL_BGR: + bits = (bytes_per_pixel[ index ] == 2) + ? bits_table[0] : bits_table[1]; + masks = masks_table_bgr[ index ]; + break; + + case GL_BGRA: + bits = (bytes_per_pixel[ index ] == 2) + ? bits_table[0] : bits_table[2]; + masks = masks_table_bgra[ index ]; + break; + + default: + fprintf( stderr, "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.\n", + __FUNCTION__, __LINE__, fb_format ); + return GL_FALSE; + } + + + for ( k = 0 ; k < num_depth_stencil_bits ; k++ ) { + for ( i = 0 ; i < num_db_modes ; i++ ) { + for ( j = 0 ; j < 2 ; j++ ) { + + modes->redBits = bits[0]; + modes->greenBits = bits[1]; + modes->blueBits = bits[2]; + modes->alphaBits = bits[3]; + modes->redMask = masks[0]; + modes->greenMask = masks[1]; + modes->blueMask = masks[2]; + modes->alphaMask = masks[3]; + modes->rgbBits = modes->redBits + modes->greenBits + + modes->blueBits + modes->alphaBits; + + modes->accumRedBits = 16 * j; + modes->accumGreenBits = 16 * j; + modes->accumBlueBits = 16 * j; + modes->accumAlphaBits = (masks[3] != 0) ? 16 * j : 0; + modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG; + + modes->stencilBits = stencil_bits[k]; + modes->depthBits = depth_bits[k]; + + modes->visualType = visType; + modes->renderType = GLX_RGBA_BIT; + modes->drawableType = GLX_WINDOW_BIT; + modes->rgbMode = GL_TRUE; + + if ( db_modes[i] == GLX_NONE ) { + modes->doubleBufferMode = GL_FALSE; + } + else { + modes->doubleBufferMode = GL_TRUE; + modes->swapMethod = db_modes[i]; + } + + modes->haveAccumBuffer = ((modes->accumRedBits + + modes->accumGreenBits + + modes->accumBlueBits + + modes->accumAlphaBits) > 0); + modes->haveDepthBuffer = (modes->depthBits > 0); + modes->haveStencilBuffer = (modes->stencilBits > 0); + + modes = modes->next; + } + } + } + + *ptr_to_modes = modes; + return GL_TRUE; +} diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.h new file mode 100644 index 000000000..26d178f74 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.h @@ -0,0 +1,119 @@ +/* + * (C) Copyright IBM Corporation 2002, 2004 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + */ +/* $XFree86:$ */ + +#ifndef DRI_DEBUG_H +#define DRI_DEBUG_H + +#include "context.h" +#include "dri_util.h" + +struct dri_debug_control { + const char * string; + 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. + */ +struct dri_extension { + /** + * Name of the extension. + */ + const char * name; + + + /** + * Pointer to a list of \c dri_extension_function structures. The list + * is terminated by a structure with a \c NULL + * \c dri_extension_function::strings pointer. + */ + const struct dri_extension_function * functions; +}; + +extern unsigned driParseDebugString( const char * debug, + const struct dri_debug_control * control ); + +extern unsigned driGetRendererString( char * buffer, + const char * hardware_name, const char * driver_date, GLuint agp_mode ); + +extern void driInitExtensions( GLcontext * ctx, + const struct dri_extension * card_extensions, GLboolean enable_imaging ); + +extern void driInitSingleExtension( GLcontext * ctx, + const struct dri_extension * ext ); + +extern GLboolean driCheckDriDdxDrmVersions2(const char * driver_name, + const __DRIversion * driActual, const __DRIversion * driExpected, + const __DRIversion * ddxActual, const __DRIversion * ddxExpected, + const __DRIversion * drmActual, const __DRIversion * drmExpected); + +extern GLboolean driCheckDriDdxDrmVersions3(const char * driver_name, + const __DRIversion * driActual, const __DRIversion * driExpected, + const __DRIversion * ddxActual, const __DRIutilversion2 * ddxExpected, + const __DRIversion * drmActual, const __DRIversion * drmExpected); + +extern GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, + GLint *x, GLint *y, + GLsizei *width, GLsizei *height ); + +extern GLboolean driFillInModes( __GLcontextModes ** modes, + GLenum fb_format, GLenum fb_type, + const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes, int visType ); + +#endif /* DRI_DEBUG_H */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.c new file mode 100644 index 000000000..eebe42d96 --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.c @@ -0,0 +1,347 @@ +/* -*- mode: c; c-basic-offset: 3 -*- */ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + */ +/* $XFree86:$ */ + +#include "glheader.h" +#include "xf86drm.h" +#include "mtypes.h" +#include "macros.h" +#include "dd.h" +#include "vblank.h" +#include "xmlpool.h" + + +/****************************************************************************/ +/** + * Get the current MSC refresh counter. + * + * Stores the 64-bit count of vertical refreshes since some (arbitrary) + * point in time in \c count. Unless the value wraps around, which it + * may, it will never decrease. + * + * \warning This function is called from \c glXGetVideoSyncSGI, which expects + * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which + * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl + * currently always returns a \c sequence of type \c unsigned. + * + * \param priv Pointer to the DRI screen private struct. + * \param count Storage to hold MSC counter. + * \return Zero is returned on success. A negative errno value + * is returned on failure. + */ +int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count ) +{ + drmVBlank vbl; + int ret; + + /* Don't wait for anything. Just get the current refresh count. */ + + vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + + ret = drmWaitVBlank( priv->fd, &vbl ); + *count = (int64_t)vbl.reply.sequence; + + return ret; +} + + +/****************************************************************************/ +/** + * Wait for a specified refresh count. This implements most of the + * functionality of \c glXWaitForMscOML from the GLX_OML_sync_control spec. + * Waits for the \c target_msc refresh. If that has already passed, it + * waits until \f$(MSC \bmod divisor)\f$ is equal to \c remainder. If + * \c target_msc is 0, use the behavior of glXWaitVideoSyncSGI(), which + * omits the initial check against a target MSC value. + * + * This function is actually something of a hack. The problem is that, at + * the time of this writing, none of the existing DRM modules support an + * ioctl that returns a 64-bit count (at least not on 32-bit platforms). + * However, this function exists to support a GLX function that requires + * the use of 64-bit counts. As such, there is a little bit of ugly + * hackery at the end of this function to make the 32-bit count act like + * a 64-bit count. There are still some cases where this will break, but + * I believe it catches the most common cases. + * + * The real solution is to provide an ioctl that uses a 64-bit count. + * + * \param dpy Pointer to the \c Display. + * \param priv Pointer to the DRI drawable private. + * \param target_msc Desired refresh count to wait for. A value of 0 + * means to use the glXWaitVideoSyncSGI() behavior. + * \param divisor MSC divisor if \c target_msc is already reached. + * \param remainder Desired MSC remainder if \c target_msc is already + * reached. + * \param msc Buffer to hold MSC when done waiting. + * + * \return Zero on success or \c GLX_BAD_CONTEXT on failure. + */ + +int driWaitForMSC32( __DRIdrawablePrivate *priv, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc ) +{ + drmVBlank vbl; + + + if ( divisor != 0 ) { + unsigned int target = (unsigned int)target_msc; + unsigned int next = target; + unsigned int r; + int dont_wait = (target_msc == 0); + + do { + /* dont_wait means we're using the glXWaitVideoSyncSGI() behavior. + * The first time around, just get the current count and proceed + * to the test for (MSC % divisor) == remainder. + */ + vbl.request.type = dont_wait ? DRM_VBLANK_RELATIVE : + DRM_VBLANK_ABSOLUTE; + vbl.request.sequence = next; + + if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) { + /* FIXME: This doesn't seem like the right thing to return here. + */ + return GLX_BAD_CONTEXT; + } + + dont_wait = 0; + if (target_msc != 0 && vbl.reply.sequence == target) + break; + + /* Assuming the wait-done test fails, the next refresh to wait for + * will be one that satisfies (MSC % divisor) == remainder. The + * value (MSC - (MSC % divisor) + remainder) is the refresh value + * closest to the current value that would satisfy the equation. + * If this refresh has already happened, we add divisor to obtain + * the next refresh after the current one that will satisfy it. + */ + r = (vbl.reply.sequence % (unsigned int)divisor); + next = (vbl.reply.sequence - r + (unsigned int)remainder); + if (next <= vbl.reply.sequence) next += (unsigned int)divisor; + + } while ( r != (unsigned int)remainder ); + } + else { + /* If the \c divisor is zero, just wait until the MSC is greater + * than or equal to \c target_msc. + */ + + vbl.request.type = DRM_VBLANK_ABSOLUTE; + vbl.request.sequence = target_msc; + + if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) { + /* FIXME: This doesn't seem like the right thing to return here. + */ + return GLX_BAD_CONTEXT; + } + } + + *msc = (target_msc & 0xffffffff00000000LL); + *msc |= vbl.reply.sequence; + if ( *msc < target_msc ) { + *msc += 0x0000000100000000LL; + } + + return 0; +} + + +/****************************************************************************/ +/** + * Gets a set of default vertical-blank-wait flags based on the internal GLX + * API version and several configuration options. + */ + +GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ) +{ + GLuint flags = VBLANK_FLAG_INTERVAL; + int vblank_mode; + + + if ( driCheckOption( optionCache, "vblank_mode", DRI_ENUM ) ) + vblank_mode = driQueryOptioni( optionCache, "vblank_mode" ); + else + vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1; + + switch (vblank_mode) { + case DRI_CONF_VBLANK_NEVER: + flags = 0; + break; + case DRI_CONF_VBLANK_DEF_INTERVAL_0: + break; + case DRI_CONF_VBLANK_DEF_INTERVAL_1: + flags |= VBLANK_FLAG_THROTTLE; + break; + case DRI_CONF_VBLANK_ALWAYS_SYNC: + flags |= VBLANK_FLAG_SYNC; + break; + } + + return flags; +} + + +/****************************************************************************/ +/** + * Sets the default swap interval when the drawable is first bound to a + * direct rendering context. + */ + +void driDrawableInitVBlank( __DRIdrawablePrivate *priv, GLuint flags ) +{ + if ( priv->pdraw->swap_interval == (unsigned)-1 ) { + priv->pdraw->swap_interval = (flags & VBLANK_FLAG_THROTTLE) != 0 ? 1 : 0; + } +} + + +/****************************************************************************/ +/** + * Wrapper to call \c drmWaitVBlank. The main purpose of this function is to + * wrap the error message logging. The error message should only be logged + * the first time the \c drmWaitVBlank fails. If \c drmWaitVBlank is + * successful, \c vbl_seq will be set the sequence value in the reply. + * + * \param vbl Pointer to drmVBlank packet desribing how to wait. + * \param vbl_seq Location to store the current refresh counter. + * \param fd File descriptor use to call into the DRM. + * \return Zero on success or -1 on failure. + */ + +static int do_wait( drmVBlank * vbl, GLuint * vbl_seq, int fd ) +{ + int ret; + + + ret = drmWaitVBlank( fd, vbl ); + if ( ret != 0 ) { + static GLboolean first_time = GL_TRUE; + + if ( first_time ) { + fprintf(stderr, + "%s: drmWaitVBlank returned %d, IRQs don't seem to be" + " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH" + " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret); + first_time = GL_FALSE; + } + + return -1; + } + + *vbl_seq = vbl->reply.sequence; + return 0; +} + + +/****************************************************************************/ +/** + * Waits for the vertical blank for use with glXSwapBuffers. + * + * \param vbl_seq Vertical blank sequence number (MSC) after the last buffer + * swap. Updated after this wait. + * \param flags \c VBLANK_FLAG bits that control how long to wait. + * \param missed_deadline Set to \c GL_TRUE if the MSC after waiting is later + * than the "target" based on \c flags. The idea is that if + * \c missed_deadline is set, then the application is not + * achieving its desired framerate. + * \return Zero on success, -1 on error. + */ + +int +driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq, + GLuint flags, GLboolean * missed_deadline ) +{ + drmVBlank vbl; + unsigned original_seq; + unsigned deadline; + unsigned interval; + + + *missed_deadline = GL_FALSE; + if ( (flags & (VBLANK_FLAG_INTERVAL | + VBLANK_FLAG_THROTTLE | + VBLANK_FLAG_SYNC)) == 0 || + (flags & VBLANK_FLAG_NO_IRQ) != 0 ) { + return 0; + } + + + /* VBLANK_FLAG_SYNC means to wait for at least one vertical blank. If + * that flag is not set, do a fake wait for zero vertical blanking + * periods so that we can get the current MSC. + * + * VBLANK_FLAG_INTERVAL and VBLANK_FLAG_THROTTLE mean to wait for at + * least one vertical blank since the last wait. Since do_wait modifies + * vbl_seq, we have to save the original value of vbl_seq for the + * VBLANK_FLAG_INTERVAL / VBLANK_FLAG_THROTTLE calculation later. + */ + + original_seq = *vbl_seq; + + vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0; + vbl.request.type = DRM_VBLANK_RELATIVE; + + if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { + return -1; + } + + + vbl.request.type = DRM_VBLANK_ABSOLUTE; + + if ( (flags & VBLANK_FLAG_INTERVAL) != 0 ) { + interval = priv->pdraw->swap_interval; + /* this must have been initialized when the drawable was first bound + * to a direct rendering context. */ + assert ( interval != (unsigned)-1 ); + } + else if ( (flags & VBLANK_FLAG_THROTTLE) != 0 ) { + interval = 1; + } + else { + interval = 0; + } + + + /* Wait until the next vertical blank. If the interval is zero, then + * the deadline is one vertical blank after the previous wait. + */ + + vbl.request.sequence = original_seq + interval; + if ( *vbl_seq < vbl.request.sequence ) { + if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { + return -1; + } + } + + deadline = original_seq + ((interval == 0) ? 1 : interval); + *missed_deadline = ( *vbl_seq > deadline ); + + return 0; +} diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.h new file mode 100644 index 000000000..3dc965def --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.h @@ -0,0 +1,69 @@ +/* -*- mode: c; c-basic-offset: 3 -*- */ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Ian Romanick + */ +/* $XFree86:$ */ + +#ifndef DRI_VBLANK_H +#define DRI_VBLANK_H + +#include "context.h" +#include "dri_util.h" +#include "xmlconfig.h" + +#define VBLANK_FLAG_INTERVAL (1U << 0) /* Respect the swap_interval setting + */ +#define VBLANK_FLAG_THROTTLE (1U << 1) /* Wait 1 refresh since last call. + */ +#define VBLANK_FLAG_SYNC (1U << 2) /* Sync to the next refresh. + */ +#define VBLANK_FLAG_NO_IRQ (1U << 7) /* DRM has no IRQ to wait on. + */ + +extern int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count ); +extern int driWaitForMSC32( __DRIdrawablePrivate *priv, + int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc ); +extern GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ); +extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv, GLuint flags ); +extern int driWaitForVBlank( const __DRIdrawablePrivate *priv, + GLuint * vbl_seq, GLuint flags, GLboolean * missed_deadline ); + +#undef usleep +#include /* for usleep() */ +#include /* for sched_yield() */ + +#ifdef linux +#include /* for sched_yield() */ +#endif + +#define DO_USLEEP(nr) \ + do { \ + if (0) fprintf(stderr, "%s: usleep for %u\n", __FUNCTION__, nr ); \ + if (1) usleep( nr ); \ + sched_yield(); \ + } while( 0 ) + +#endif /* DRI_VBLANK_H */ diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.c new file mode 100644 index 000000000..b635894fe --- /dev/null +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.c @@ -0,0 +1,1002 @@ +/* + * XML DRI client-side driver configuration + * Copyright (C) 2003 Felix Kuehling + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to 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 + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 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 xmlconfig.c + * \brief Driver-independent client-side part of the XML configuration + * \author Felix Kuehling + */ + +#include "glheader.h" + +#include +#include +#include +#include +#include +#include +#include "imports.h" +#include "dri_util.h" +#include "xmlconfig.h" + +/* + * OS dependent ways of getting the name of the running program + */ +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include +#endif + +#undef GET_PROGRAM_NAME + +#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__) +# if !defined(__GLIBC__) || (__GLIBC__ < 2) +/* These aren't declared in any libc5 header */ +extern char *program_invocation_name, *program_invocation_short_name; +# endif +# define GET_PROGRAM_NAME() program_invocation_short_name +#elif defined(__FreeBSD__) && (__FreeBSD__ >= 2) +# include +# if (__FreeBSD_version >= 440000) +# include +# define GET_PROGRAM_NAME() getprogname() +# endif +#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100) +# include +# define GET_PROGRAM_NAME() getprogname() +#endif + +#if !defined(GET_PROGRAM_NAME) +# if defined(OpenBSD) || defined(NetBSD) || defined(__UCLIBC__) +/* This is a hack. It's said to work on OpenBSD, NetBSD and GNU. + * Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's + * used as a last resort, if there is no documented facility available. */ +static const char *__getProgramName () { + extern const char *__progname; + char * arg = strrchr(__progname, '/'); + if (arg) + return arg+1; + else + return __progname; +} +# define GET_PROGRAM_NAME() __getProgramName() +# else +# define GET_PROGRAM_NAME() "" +# warning "Per application configuration won't work with your OS version." +# endif +#endif + +/** \brief Find an option in an option cache with the name as key */ +static GLuint findOption (const driOptionCache *cache, const char *name) { + GLuint len = strlen (name); + GLuint size = 1 << cache->tableSize, mask = size - 1; + GLuint hash = 0; + GLuint i, shift; + + /* compute a hash from the variable length name */ + for (i = 0, shift = 0; i < len; ++i, shift = (shift+8) & 31) + hash += (GLuint)name[i] << shift; + hash *= hash; + hash = (hash >> (16-cache->tableSize/2)) & mask; + + /* this is just the starting point of the linear search for the option */ + for (i = 0; i < size; ++i, hash = (hash+1) & mask) { + /* if we hit an empty entry then the option is not defined (yet) */ + if (cache->info[hash].name == 0) + break; + else if (!strcmp (name, cache->info[hash].name)) + break; + } + /* this assertion fails if the hash table is full */ + assert (i < size); + + return hash; +} + +/** \brief Count the real number of options in an option cache */ +static GLuint countOptions (const driOptionCache *cache) { + GLuint size = 1 << cache->tableSize; + GLuint i, count = 0; + for (i = 0; i < size; ++i) + if (cache->info[i].name) + count++; + return count; +} + +/** \brief Like strdup but using MALLOC and with error checking. */ +#define XSTRDUP(dest,source) do { \ + GLuint len = strlen (source); \ + if (!(dest = MALLOC (len+1))) { \ + fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); \ + abort(); \ + } \ + memcpy (dest, source, len+1); \ +} while (0) + +static int compare (const void *a, const void *b) { + return strcmp (*(char *const*)a, *(char *const*)b); +} +/** \brief Binary search in a string array. */ +static GLuint bsearchStr (const XML_Char *name, + const XML_Char *elems[], GLuint count) { + const XML_Char **found; + found = bsearch (&name, elems, count, sizeof (XML_Char *), compare); + if (found) + return found - elems; + else + return count; +} + +/** \brief Locale-independent integer parser. + * + * Works similar to strtol. Leading space is NOT skipped. The input + * number may have an optional sign. Radix is specified by base. If + * base is 0 then decimal is assumed unless the input number is + * prefixed by 0x or 0X for hexadecimal or 0 for octal. After + * returning tail points to the first character that is not part of + * the integer number. If no number was found then tail points to the + * start of the input string. */ +static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { + GLint radix = base == 0 ? 10 : base; + GLint result = 0; + GLint sign = 1; + GLboolean numberFound = GL_FALSE; + const XML_Char *start = string; + + assert (radix >= 2 && radix <= 36); + + if (*string == '-') { + sign = -1; + string++; + } else if (*string == '+') + string++; + if (base == 0 && *string == '0') { + numberFound = GL_TRUE; + if (*(string+1) == 'x' || *(string+1) == 'X') { + radix = 16; + string += 2; + } else { + radix = 8; + string++; + } + } + do { + GLint digit = -1; + if (radix <= 10) { + if (*string >= '0' && *string < '0' + radix) + digit = *string - '0'; + } else { + if (*string >= '0' && *string <= '9') + digit = *string - '0'; + else if (*string >= 'a' && *string < 'a' + radix - 10) + digit = *string - 'a' + 10; + else if (*string >= 'A' && *string < 'A' + radix - 10) + digit = *string - 'A' + 10; + } + if (digit != -1) { + numberFound = GL_TRUE; + result = radix*result + digit; + string++; + } else + break; + } while (GL_TRUE); + *tail = numberFound ? string : start; + return sign * result; +} + +/** \brief Locale-independent floating-point parser. + * + * Works similar to strtod. Leading space is NOT skipped. The input + * number may have an optional sign. '.' is interpreted as decimal + * point and may occor at most once. Optionally the number may end in + * [eE], where is an integer as recognized by + * strToI. In that case the result is number * 10^exponent. After + * returning tail points to the first character that is not part of + * the floating point number. If no number was found then tail points + * to the start of the input string. + * + * Uses two passes for maximum accuracy. */ +static GLfloat strToF (const XML_Char *string, const XML_Char **tail) { + GLint nDigits = 0, pointPos, exponent; + GLfloat sign = 1.0f, result = 0.0f, scale; + const XML_Char *start = string, *numStart; + + /* sign */ + if (*string == '-') { + sign = -1.0f; + string++; + } else if (*string == '+') + string++; + + /* first pass: determine position of decimal point, number of + * digits, exponent and the end of the number. */ + numStart = string; + while (*string >= '0' && *string <= '9') { + string++; + nDigits++; + } + pointPos = nDigits; + if (*string == '.') { + string++; + while (*string >= '0' && *string <= '9') { + string++; + nDigits++; + } + } + if (nDigits == 0) { + /* no digits, no number */ + *tail = start; + return 0.0f; + } + *tail = string; + if (*string == 'e' || *string == 'E') { + const XML_Char *expTail; + exponent = strToI (string+1, &expTail, 10); + if (expTail == string+1) + exponent = 0; + else + *tail = expTail; + } else + exponent = 0; + string = numStart; + + /* scale of the first digit */ + scale = sign * (GLfloat)pow (10.0, (GLdouble)(pointPos-1 + exponent)); + + /* second pass: parse digits */ + do { + if (*string != '.') { + assert (*string >= '0' && *string <= '9'); + result += scale * (GLfloat)(*string - '0'); + scale *= 0.1f; + nDigits--; + } + string++; + } while (nDigits > 0); + + return result; +} + +/** \brief Parse a value of a given type. */ +static GLboolean parseValue (driOptionValue *v, driOptionType type, + const XML_Char *string) { + const XML_Char *tail; + /* skip leading white-space */ + string += strspn (string, " \f\n\r\t\v"); + switch (type) { + case DRI_BOOL: + if (!strcmp (string, "false")) { + v->_bool = GL_FALSE; + tail = string + 5; + } else if (!strcmp (string, "true")) { + v->_bool = GL_TRUE; + tail = string + 4; + } + else + return GL_FALSE; + break; + case DRI_ENUM: /* enum is just a special integer */ + case DRI_INT: + v->_int = strToI (string, &tail, 0); + break; + case DRI_FLOAT: + v->_float = strToF (string, &tail); + break; + } + + if (tail == string) + return GL_FALSE; /* empty string (or containing only white-space) */ + /* skip trailing white space */ + if (*tail) + tail += strspn (tail, " \f\n\r\t\v"); + if (*tail) + return GL_FALSE; /* something left over that is not part of value */ + + return GL_TRUE; +} + +/** \brief Parse a list of ranges of type info->type. */ +static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) { + XML_Char *cp, *range; + GLuint nRanges, i; + driOptionRange *ranges; + + XSTRDUP (cp, string); + /* pass 1: determine the number of ranges (number of commas + 1) */ + range = cp; + for (nRanges = 1; *range; ++range) + if (*range == ',') + ++nRanges; + + if ((ranges = MALLOC (nRanges*sizeof(driOptionRange))) == NULL) { + fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); + abort(); + } + + /* pass 2: parse all ranges into preallocated array */ + range = cp; + for (i = 0; i < nRanges; ++i) { + XML_Char *end, *sep; + assert (range); + end = strchr (range, ','); + if (end) + *end = '\0'; + sep = strchr (range, ':'); + if (sep) { /* non-empty interval */ + *sep = '\0'; + if (!parseValue (&ranges[i].start, info->type, range) || + !parseValue (&ranges[i].end, info->type, sep+1)) + break; + if (info->type == DRI_INT && + ranges[i].start._int > ranges[i].end._int) + break; + if (info->type == DRI_FLOAT && + ranges[i].start._float > ranges[i].end._float) + break; + } else { /* empty interval */ + if (!parseValue (&ranges[i].start, info->type, range)) + break; + ranges[i].end = ranges[i].start; + } + if (end) + range = end+1; + else + range = NULL; + } + FREE (cp); + if (i < nRanges) { + FREE (ranges); + return GL_FALSE; + } else + assert (range == NULL); + + info->nRanges = nRanges; + info->ranges = ranges; + return GL_TRUE; +} + +/** \brief Check if a value is in one of info->ranges. */ +static GLboolean checkValue (const driOptionValue *v, const driOptionInfo *info) { + GLuint i; + assert (info->type != DRI_BOOL); /* should be caught by the parser */ + if (info->nRanges == 0) + return GL_TRUE; + switch (info->type) { + case DRI_ENUM: /* enum is just a special integer */ + case DRI_INT: + for (i = 0; i < info->nRanges; ++i) + if (v->_int >= info->ranges[i].start._int && + v->_int <= info->ranges[i].end._int) + return GL_TRUE; + break; + case DRI_FLOAT: + for (i = 0; i < info->nRanges; ++i) + if (v->_float >= info->ranges[i].start._float && + v->_float <= info->ranges[i].end._float) + return GL_TRUE; + break; + default: + assert (0); /* should never happen */ + } + return GL_FALSE; +} + +/** \brief Output a warning message. */ +#define XML_WARNING1(msg) do {\ + __driUtilMessage ("Warning in %s line %d, column %d: "msg, data->name, \ + XML_GetCurrentLineNumber(data->parser), \ + XML_GetCurrentColumnNumber(data->parser)); \ +} while (0) +#define XML_WARNING(msg,args...) do { \ + __driUtilMessage ("Warning in %s line %d, column %d: "msg, data->name, \ + XML_GetCurrentLineNumber(data->parser), \ + XML_GetCurrentColumnNumber(data->parser), \ + args); \ +} while (0) +/** \brief Output an error message. */ +#define XML_ERROR1(msg) do { \ + __driUtilMessage ("Error in %s line %d, column %d: "msg, data->name, \ + XML_GetCurrentLineNumber(data->parser), \ + XML_GetCurrentColumnNumber(data->parser)); \ +} while (0) +#define XML_ERROR(msg,args...) do { \ + __driUtilMessage ("Error in %s line %d, column %d: "msg, data->name, \ + XML_GetCurrentLineNumber(data->parser), \ + XML_GetCurrentColumnNumber(data->parser), \ + args); \ +} while (0) +/** \brief Output a fatal error message and abort. */ +#define XML_FATAL1(msg) do { \ + fprintf (stderr, "Fatal error in %s line %d, column %d: "msg"\n", \ + data->name, \ + XML_GetCurrentLineNumber(data->parser), \ + XML_GetCurrentColumnNumber(data->parser)); \ + abort();\ +} while (0) +#define XML_FATAL(msg,args...) do { \ + fprintf (stderr, "Fatal error in %s line %d, column %d: "msg"\n", \ + data->name, \ + XML_GetCurrentLineNumber(data->parser), \ + XML_GetCurrentColumnNumber(data->parser), \ + args); \ + abort();\ +} while (0) + +/** \brief Parser context for __driConfigOptions. */ +struct OptInfoData { + const char *name; + XML_Parser parser; + driOptionCache *cache; + GLboolean inDriInfo; + GLboolean inSection; + GLboolean inDesc; + GLboolean inOption; + GLboolean inEnum; + int curOption; +}; + +/** \brief Elements in __driConfigOptions. */ +enum OptInfoElem { + OI_DESCRIPTION = 0, OI_DRIINFO, OI_ENUM, OI_OPTION, OI_SECTION, OI_COUNT +}; +static const XML_Char *OptInfoElems[] = { + "description", "driinfo", "enum", "option", "section" +}; + +/** \brief Parse attributes of an enum element. + * + * We're not actually interested in the data. Just make sure this is ok + * for external configuration tools. + */ +static void parseEnumAttr (struct OptInfoData *data, const XML_Char **attr) { + GLuint i; + const XML_Char *value = NULL, *text = NULL; + driOptionValue v; + GLuint opt = data->curOption; + for (i = 0; attr[i]; i += 2) { + if (!strcmp (attr[i], "value")) value = attr[i+1]; + else if (!strcmp (attr[i], "text")) text = attr[i+1]; + else XML_FATAL("illegal enum attribute: %s.", attr[i]); + } + if (!value) XML_FATAL1 ("value attribute missing in enum."); + if (!text) XML_FATAL1 ("text attribute missing in enum."); + if (!parseValue (&v, data->cache->info[opt].type, value)) + XML_FATAL ("illegal enum value: %s.", value); + if (!checkValue (&v, &data->cache->info[opt])) + XML_FATAL ("enum value out of valid range: %s.", value); +} + +/** \brief Parse attributes of a description element. + * + * We're not actually interested in the data. Just make sure this is ok + * for external configuration tools. + */ +static void parseDescAttr (struct OptInfoData *data, const XML_Char **attr) { + GLuint i; + const XML_Char *lang = NULL, *text = NULL; + for (i = 0; attr[i]; i += 2) { + if (!strcmp (attr[i], "lang")) lang = attr[i+1]; + else if (!strcmp (attr[i], "text")) text = attr[i+1]; + else XML_FATAL("illegal description attribute: %s.", attr[i]); + } + if (!lang) XML_FATAL1 ("lang attribute missing in description."); + if (!text) XML_FATAL1 ("text attribute missing in description."); +} + +/** \brief Parse attributes of an option element. */ +static void parseOptInfoAttr (struct OptInfoData *data, const XML_Char **attr) { + enum OptAttr {OA_DEFAULT = 0, OA_NAME, OA_TYPE, OA_VALID, OA_COUNT}; + static const XML_Char *optAttr[] = {"default", "name", "type", "valid"}; + const XML_Char *attrVal[OA_COUNT] = {NULL, NULL, NULL, NULL}; + const char *defaultVal; + driOptionCache *cache = data->cache; + GLuint opt, i; + for (i = 0; attr[i]; i += 2) { + GLuint attrName = bsearchStr (attr[i], optAttr, OA_COUNT); + if (attrName >= OA_COUNT) + XML_FATAL ("illegal option attribute: %s", attr[i]); + attrVal[attrName] = attr[i+1]; + } + if (!attrVal[OA_NAME]) XML_FATAL1 ("name attribute missing in option."); + if (!attrVal[OA_TYPE]) XML_FATAL1 ("type attribute missing in option."); + if (!attrVal[OA_DEFAULT]) XML_FATAL1 ("default attribute missing in option."); + + opt = findOption (cache, attrVal[OA_NAME]); + if (cache->info[opt].name) + XML_FATAL ("option %s redefined.", attrVal[OA_NAME]); + data->curOption = opt; + + XSTRDUP (cache->info[opt].name, attrVal[OA_NAME]); + + if (!strcmp (attrVal[OA_TYPE], "bool")) + cache->info[opt].type = DRI_BOOL; + else if (!strcmp (attrVal[OA_TYPE], "enum")) + cache->info[opt].type = DRI_ENUM; + else if (!strcmp (attrVal[OA_TYPE], "int")) + cache->info[opt].type = DRI_INT; + else if (!strcmp (attrVal[OA_TYPE], "float")) + cache->info[opt].type = DRI_FLOAT; + else + XML_FATAL ("illegal type in option: %s.", attrVal[OA_TYPE]); + + defaultVal = getenv (cache->info[opt].name); + if (defaultVal != NULL) { + /* don't use XML_WARNING, we want the user to see this! */ + fprintf (stderr, + "ATTENTION: default value of option %s overridden by environment.\n", + cache->info[opt].name); + } else + defaultVal = attrVal[OA_DEFAULT]; + if (!parseValue (&cache->values[opt], cache->info[opt].type, defaultVal)) + XML_FATAL ("illegal default value: %s.", defaultVal); + + if (attrVal[OA_VALID]) { + if (cache->info[opt].type == DRI_BOOL) + XML_FATAL1 ("boolean option with valid attribute."); + if (!parseRanges (&cache->info[opt], attrVal[OA_VALID])) + XML_FATAL ("illegal valid attribute: %s.", attrVal[OA_VALID]); + if (!checkValue (&cache->values[opt], &cache->info[opt])) + XML_FATAL ("default value out of valid range '%s': %s.", + attrVal[OA_VALID], defaultVal); + } else if (cache->info[opt].type == DRI_ENUM) { + XML_FATAL1 ("valid attribute missing in option (mandatory for enums)."); + } else { + cache->info[opt].nRanges = 0; + cache->info[opt].ranges = NULL; + } +} + +/** \brief Handler for start element events. */ +static void optInfoStartElem (void *userData, const XML_Char *name, + const XML_Char **attr) { + struct OptInfoData *data = (struct OptInfoData *)userData; + enum OptInfoElem elem = bsearchStr (name, OptInfoElems, OI_COUNT); + switch (elem) { + case OI_DRIINFO: + if (data->inDriInfo) + XML_FATAL1 ("nested elements."); + if (attr[0]) + XML_FATAL1 ("attributes specified on element."); + data->inDriInfo = GL_TRUE; + break; + case OI_SECTION: + if (!data->inDriInfo) + XML_FATAL1 ("
must be inside ."); + if (data->inSection) + XML_FATAL1 ("nested
elements."); + if (attr[0]) + XML_FATAL1 ("attributes specified on
element."); + data->inSection = GL_TRUE; + break; + case OI_DESCRIPTION: + if (!data->inSection && !data->inOption) + XML_FATAL1 (" must be inside or inDesc) + XML_FATAL1 ("nested elements."); + data->inDesc = GL_TRUE; + parseDescAttr (data, attr); + break; + case OI_OPTION: + if (!data->inSection) + XML_FATAL1 ("